Mojarra 및 Weld를 사용하여 Apache TomEE에서 웹 애플리케이션을 실행하고 싶습니다.
TomEE의 OpenWebBeans 대신 Weld CDI 사용
my/WEB-INF/lib 디렉토리에 "javax.faces-2.1.21.jar"및 "weld-servlet.jar"을 넣습니다. 나는 또한 빈 "beans.xml"을 WEB-INF 폴더에 추가했다. 다음 톰캣의 응용 프로그램이 제대로 작동 배포
/WEB-INF/web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>TestWeldOnTomEE</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.faces.PROJECT_STATE</param-name>
<param-value>Development</param-value>
</context-param>
<listener>
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
</listener>
</web-app>
을하지만 TomEE와 내가 얻을 : 내 "web.xml을"은 다음과 같습니다 서버 시작시 오류 :
SEVERE: Error configuring application listener of class org.jboss.weld.environment.servlet.Listener
java.lang.ClassNotFoundException: org.jboss.weld.environment.servlet.Listener
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1713)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1558)
at org.apache.tomee.catalina.LazyStopWebappClassLoader._loadClass(LazyStopWebappClassLoader.java:103)
at org.apache.tomee.catalina.LazyStopWebappClassLoader.loadClass(LazyStopWebappClassLoader.java:98)
at org.apache.tomee.catalina.JavaeeInstanceManager.newInstance(JavaeeInstanceManager.java:54)
at org.apache.tomee.catalina.JavaeeInstanceManager.newInstance(JavaeeInstanceManager.java:48)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4733)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5291)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
01,238,007,316,275,523,
TomEE가 이미 다른 CDI 프레임 워크 (OpenWebB)를 사용하고있어서 문제가 있습니까? TomEE를 Weld와 함께 사용할 수 있습니까?
왜 이렇게하고 싶은지 궁금합니다. –