我對我的pom.xml
文件有麻煩。我知道,關於這個問題有很多話題,但是他們中的任何一個都能解決我的問題。AbstractMethodError:REST中的javax.ws.rs.core.UriBuilder.uri,EJB應用程序
@Path("/actors")
public class MainController {
@EJB
private ActorDaoLocal actorDao;
}
@Local
public interface ActorDaoLocal {
//some stuff here
}
@Stateless
public class ActorDao implements ActorDaoLocal {
@PersistenceContext
private EntityManager em ;
//some stuff here
}
@ManagedBean(name = "ActorBean")
@ApplicationScoped
public class ActorBean {
@EJB
private ActorDaoLocal usersDao;
}
在我的應用程序,當我在ActorBean
沒有註解如下:
@ManagedBean(name = "ActorBean")
@ApplicationScoped
actorDao是空的MainController
然而,當我加入這個註解和依賴它我正在獲取例外:
java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder;
at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:651)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
我的pom.xml
:
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.18</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<version>1.18</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
<version>1.18</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.18</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
<version>1.18</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>ejb-api</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>7.0</version>
<type>jar</type>
</dependency>
請幫我解決這個問題,我在我的pom文件中找不到錯誤。
我在Tomcat的8
我已經試過該帖子的提示 – Araneo