I'm planning to start using PrimeFaces Push coming with PrimeFaces 5.0.
I've tried to run the same example found here http://www.primefaces.org/showcase/push/notify.xhtml using Wildfly 8.1 but I can't receive any push message from backend bean.
Here is what I've on wildfly console :
01:50:34,926 INFO [org.atmosphere.cpr.AtmosphereFramework] (Thread-261) Latest version of Atmosphere's JavaScript Client 2.2.2
01:50:34,926 INFO [org.atmosphere.cpr.AtmosphereFramework] (Thread-261)
Current version of Atmosphere 2.2.0-RC3
Newest version of Atmosphere available 2.1.7
01:50:37,447 ERROR [org.atmosphere.interceptor.JavaScriptProtocol] (default task-61) Invalid Atmosphere Version 2.2.0-javascript
01:50:37,448 WARN [org.atmosphere.websocket.protocol.SimpleHttpProtocol] (default task-61) Status code higher or equal than 400 Status 501 Message OK
01:50:41,957 INFO [stdout] (default task-62) sending message
01:55:37,760 ERROR [org.atmosphere.cpr.AsynchronousProcessor] (default task-63) Failed to cancel resource: 8cf3d711-00c2-4e52-9d78-97cd04c0b585: java.lang.NullPointerException
at org.primefaces.push.impl.PushEndpointHandlerProxy.onStateChange(PushEndpointHandlerProxy.java:241) [primefaces-5.0.jar:5.0]
at org.atmosphere.cpr.AsynchronousProcessor.invokeAtmosphereHandler(AsynchronousProcessor.java:492) [atmosphere-runtime-2.2.0-RC3.jar:2.2.0-RC3]
at org.atmosphere.cpr.AsynchronousProcessor.completeLifecycle(AsynchronousProcessor.java:444) [atmosphere-runtime-2.2.0-RC3.jar:2.2.0-RC3]
at org.atmosphere.cpr.AsynchronousProcessor.endRequest(AsynchronousProcessor.java:548) [atmosphere-runtime-2.2.0-RC3.jar:2.2.0-RC3]
at org.atmosphere.websocket.DefaultWebSocketProcessor.executeClose(DefaultWebSocketProcessor.java:676) [atmosphere-runtime-2.2.0-RC3.jar:2.2.0-RC3]
at org.atmosphere.websocket.DefaultWebSocketProcessor.close(DefaultWebSocketProcessor.java:628) [atmosphere-runtime-2.2.0-RC3.jar:2.2.0-RC3]
at org.atmosphere.container.JSR356Endpoint.onClose(JSR356Endpoint.java:221) [atmosphere-runtime-2.2.0-RC3.jar:2.2.0-RC3]
at io.undertow.websockets.jsr.UndertowSession.close(UndertowSession.java:181) [undertow-websockets-jsr-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.websockets.jsr.UndertowSession.close(UndertowSession.java:171) [undertow-websockets-jsr-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.websockets.jsr.FrameHandler$1.run(FrameHandler.java:93) [undertow-websockets-jsr-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.websockets.jsr.ServerWebSocketContainer$1.run(ServerWebSocketContainer.java:303) [undertow-websockets-jsr-1.0.15.Final.jar:1.0.15.Final]
at io.undertow.websockets.jsr.OrderedExecutor$ExecutorTask.run(OrderedExecutor.java:49) [undertow-websockets-jsr-1.0.15.Final.jar:1.0.15.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_55]
Here is my web.xml configuration for PrimeFaces push:
<context-param>
<param-name>primefaces.PUSH_SERVER_URL</param-name>
<param-value>http://127.0.0.1:8080</param-value>
</context-param>
<servlet>
<servlet-name>Push Servlet</servlet-name>
<servlet-class>org.primefaces.push.PushServlet</servlet-class>
<load-on-startup>0</load-on-startup>
<async-supported>true</async-supported>
</servlet>
<servlet-mapping>
<servlet-name>Push Servlet</servlet-name>
<url-pattern>/primepush/*</url-pattern>
</servlet-mapping>
I appreciate your help to solve this issue.
I had the same problem using Primefaces 5.0 and Atmosphere Runtime 2.2.0.
Solved it, by changing to Atmosphere 2.1.7 (which is still the newest version according to log output). Now push messages work fine...
Related
I have issue with richfaces3.3.3.Final, jsf2.0, facelet1.1.14 with weblogic 12c.
Application is deploying successfully. While loading the login page getting the following exception.
Logs:-
java.io.IOException: Error parsing [jar:file:/C:/Oracle_Home12.2.1.2/wlserver/modules/glassfish.jsf.jar!/META-INF/mojarra_ext.taglib.xml]:
at com.sun.facelets.compiler.TagLibraryConfig.create(TagLibraryConfig.java:410)
at com.sun.facelets.compiler.TagLibraryConfig.loadImplicit(TagLibraryConfig.java:431)
at com.sun.facelets.compiler.Compiler.initialize(Compiler.java:87)
at com.sun.facelets.compiler.Compiler.compile(Compiler.java:104)
at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:197)
at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:144)
at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:95)
java.io.IOException: Error parsing [zip:C:/Oracle_Home12.2.1.2/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/gems_2.0/n3ib5y/lib/jsf-impl-2.0.0.jar!/META-INF/taglib/ui.taglib.xml]:
at com.sun.facelets.compiler.TagLibraryConfig.create(TagLibraryConfig.java:410)
at com.sun.facelets.compiler.TagLibraryConfig.loadImplicit(TagLibraryConfig.java:431)
at com.sun.facelets.compiler.Compiler.initialize(Compiler.java:87)
at com.sun.facelets.compiler.Compiler.compile(Compiler.java:104)
at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:197)
at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:144)
at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:95)
at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:517)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
at org.springframework.faces.webflow.FlowViewHandler.renderView(FlowViewHandler.java:99)
Caused By: org.xml.sax.SAXException: Error Handling [zip:C:/Oracle_Home12.2.1.2/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/gems_2.0/n3ib5y/lib/jsf-impl-2.0.0.jar!/META-INF/taglib/ui.taglib.xml#41,31]
at com.sun.facelets.compiler.TagLibraryConfig$LibraryHandler.error(TagLibraryConfig.java:376)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:137)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.rootElementSpecified(XMLDTDValidator.java:1599)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1877)
Note:-
I have already check the *.taglib.xml version it was 2.0, which will compatible with JSF2.0. Please help to solve.
I am trying to upgrade my grails project from grails 1.1.1 to grails 1.2.1.
when I am trying to run my application I am getting below error message:
I am using java 1.7._09 and GGTS 3.6.4.
This is my application.properties file:
when I am trying to add tomcat 1.2.1 in my application.properties file I am getting below error:
My GGTS is using default groovy compiler 2.3. Should I need to change the groovy complier?
I have searched in Google but I didn't understand:
search result from google
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:266)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:143)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:155)
at gant.Gant.processTargets(Gant.groovy:480)
at org.codehaus.groovy.grails.cli.GrailsScriptRunner.callPluginOrGrailsScript(GrailsScriptRunner.java:485)
at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeCommand(GrailsScriptRunner.java:301)
at org.codehaus.groovy.grails.cli.GrailsScriptRunner.main(GrailsScriptRunner.java:115)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:215)
at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:240)
Caused by: java.lang.IllegalArgumentException: addChild: Child name 'grails-errorhandler' is not unique
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:781)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardContext.addChild(StandardContext.java:2128)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:925)
at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:193)
at org.apache.tomcat.util.digester.Rule.end(Rule.java:229)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1140)
... 438 more
startup.ContextConfig Occurred at line 7 column 422
startup.ContextConfig Marking this application unavailable due to previous error(s)
core.StandardContext Error getConfigured
core.StandardContext Context [/BASF_bdw] startup failed due to previous errors
Server running. Browse to http://localhost:8080/BASF_bdw
plugins.DefaultGrailsPluginManager Started to scan for plugin changes in every 5000ms.
I have found duplicate servlet name in .grails/***/resource/web.xml while running the run-app command in GGTS.
<servlet>
<servlet-name>grails-errorhandler</servlet-name>
<servlet-class>org.codehaus.groovy.grails.web.servlet.ErrorHandlingServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>grails-errorhandler</servlet-name>
<servlet-class>org.codehaus.groovy.grails.web.servlet.ErrorHandlingServlet</servlet-class>
</servlet>
may I know why it is generating duplicate servlet name and how to fix this ?
The blog says that you should search for every class that extends the class Exception or a subclass of it and convert it from a groovy to a java class. However, it looks like it is not your code, but the internal Grails code that throws the exception.
Looking at your previous questions, it seems your final goal is to make your war runnable in a Java 7 Environment.
You should stick to java 6 on your upgrade-journey until you hit a Grails version that just runs on Java 7.
After every successful upgrade, compile your project with Java 6 and try to run it in a servlet container that runs on Java 7. Perhaps you'r lucky and it just works.
I'm pretty sure that this will not the last problem.
I don't know how many lines of code your project has, perhaps it's an option to reimplement the whole project in grails 3.
Our JSF web application based on java 7 se, JSF 2.1, using Mojarra 2.1.27 was working fine on Apache Tomcat 7.0.41 and below. When we attempted to upgrade to Tomcat 7.0.42 and above (we've tried every version up to 7.0.50), after application start up, on the first hit to any URL in the webapp, we see the following error in the tomcat logs:
I've debugged through this, and it seems the source of the Exception comes from the defaultFacesContext being null.
Stack Trace
INFO: Server startup in 1591 ms
Feb 03, 2014 6:32:25 PM org.apache.catalina.core.StandardContext fireRequestDestroyEvent
SEVERE: Exception sending request initialized lifecycle event to listener instance of class com.sun.faces.config.ConfigureListener
java.lang.UnsupportedOperationException
at javax.faces.context.FacesContext.getExceptionHandler(FacesContext.java:287)
at javax.faces.event.ExceptionQueuedEventContext.getListenersForEventClass(ExceptionQueuedEventContext.java:262)
at com.sun.faces.application.ApplicationImpl.invokeComponentListenersFor(ApplicationImpl.java:2128)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:289)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:247)
at com.sun.faces.application.WebappLifecycleListener.requestDestroyed(WebappLifecycleListener.java:125)
at com.sun.faces.config.ConfigureListener.requestDestroyed(ConfigureListener.java:344)
at org.apache.catalina.core.StandardContext.fireRequestDestroyEvent(StandardContext.java:6151)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:207)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:409)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1044)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:313)
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:744)
I've reproduced this start-up exception issue with a very simple application with only one static JSF page with just Hello World and no backing bean, and a minimal web.xml, shown below. Everything works as expected on Tomcat 7.0.41, but always results in the following error on Tomcat 7.0.42+.
Just wondering if anyone else has run into this issue?
<?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_3_0.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<display-name>JSF TEST</display-name>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
</web-app>
remove that obsolete listener, and put
<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>*.jsf</url-pattern>
</servlet-mapping>
I can't seem to figure this one out...
When deploying a JSF web app Glassfish complains about not being able to find JSFSServlet.
It's Glassfish 4 EE and I checked that c:/glassfish4/glassfish/modules contains javax.faces.jar.
My webapp doesn't have a JSF jar included in the WEB-INF/lib so there is no clash with the jar on the glassfish server.
I've re-installed my JDK and re-set my JAVA_HOME & path environment variables. Confirmed these are working by running java -version & javac -version from the command prompt which indicate I am running JDK1.7.25.
I've tried running Glassfish by:
1) Using eclipse (pointing to the correct JDK)
2) Standalone with WAR
And I get the same result!
What may be related is the install failed for Glassfish with the "requires version 1.6 or above" message and I had to install using glassfish-4-install.exe -j %JAVA_HOME%
Any help would be much appreciated! Here is the stack trace from glassfish:
2013-10-28T11:35:36.815+0200|SEVERE: Exception during lifecycle processing
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.ClassNotFoundException: javax.faces.webapp.JSFServlet
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:724)
SOLVED! Eclipse was listing javax.faces.JSFServlet as the class for JSF.
Changed this to javax.faces.webapp.FacesServlet!
This question already has answers here:
How to use PrimeFaces p:fileUpload? Listener method is never invoked or UploadedFile is null / throws an error / not usable
(11 answers)
Closed 6 years ago.
I am using <p:fileUpload> to upload a file from my jsf page to a backing bean and getting following eror:
22:39:06,942 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "myweb.war"
22:39:07,341 INFO [org.jboss.as.jpa] (MSC service thread 1-4) JBAS011401: Read persistence.xml for mywebPU
22:39:07,399 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."myweb.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."myweb.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "myweb.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]
Caused by: java.lang.RuntimeException: Error getting reflective information for class org.primefaces.webapp.filter.FileUploadFilter with ClassLoader ModuleClassLoader for Module "deployment.myweb.war:main" from Service Module Loader
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:85)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:70)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory
at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_21]
at java.lang.Class.privateGetDeclaredFields(Class.java:2317) [rt.jar:1.7.0_21]
at java.lang.Class.getDeclaredFields(Class.java:1762) [rt.jar:1.7.0_21]
at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 10 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileItemFactory from [Module "deployment.myweb.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
... 15 more
22:39:07,429 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "myweb.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"myweb.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"myweb.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"myweb.war\""}}
22:39:07,433 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."myweb.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."myweb.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "myweb.war"
22:39:07,441 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"myweb.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"myweb.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"myweb.war\""}}}}
22:39:07,818 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment myweb.war in 381ms
My jsf page:
<h:form enctype="multipart/form-data">
<p:messages showDetail="true"/>
<p:fileUpload value="#{admin_post.uploadFile}" mode="simple" />
<p:commandButton value="Submit" ajax="false" actionListener="#{admin_post.upload}"/>
</h:form>
My web.xml: (The error occurs while using PrimeFaces FileUpload Filter)
<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
<init-param>
<param-name>thresholdSize</param-name>
<param-value>51200</param-value>
</init-param>
<init-param>
<param-name>uploadDirectory</param-name>
<param-value>/tmp</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
How can I solve this problem?
For those who didn't read comments:
Adding commons-fileupload-xx.jar
and common-io-xx.jar to the classpath solved the problem perfectly.