jsf 2.2 (final) not works on Jboss 7.1.1 - jboss7.x

seems for me JSF 2.2 is not working at all on JBoss 7.1.1
with jboss's multi jsf I just dropped in replacement of the jsf api and jsf implementation modules with respective jars of jsf 2.2
when my application starts I see following error:
01:46:59,286 INFO [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-5) Initializing Mojarra 2.2.0 ( 20130502-2118 https://svn.java.net/svn/mojarra~svn/tags/2.2.0#11930) for context '/broker'
01:46:59,922 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-5) Critical error during deployment: : java.lang.NoClassDefFoundError: com/sun/faces/spi/InjectionProvider
at javax.faces.FactoryFinder$FactoryManager.copyInjectionProviderFromFacesContext(FactoryFinder.java:1051) [jboss-jsf-api_2.2_spec-2.2.0.jar:2.2.0]
at javax.faces.FactoryFinder$FactoryManager.<init>(FactoryFinder.java:1035) [jboss-jsf-api_2.2_spec-2.2.0.jar:2.2.0]
at javax.faces.FactoryFinder$FactoryManagerCache.getApplicationFactoryManager(FactoryFinder.java:856) [jboss-jsf-api_2.2_spec-2.2.0.jar:2.2.0]
at javax.faces.FactoryFinder$FactoryManagerCache.getApplicationFactoryManager(FactoryFinder.java:793) [jboss-jsf-api_2.2_spec-2.2.0.jar:2.2.0]
at javax.faces.FactoryFinder$FactoryManagerCache.access$100(FactoryFinder.java:768) [jboss-jsf-api_2.2_spec-2.2.0.jar:2.2.0]
at javax.faces.FactoryFinder.setFactory(FactoryFinder.java:409) [jboss-jsf-api_2.2_spec-2.2.0.jar:2.2.0]
at com.sun.faces.config.processor.FactoryConfigProcessor.setFactory(FactoryConfigProcessor.java:317) [jsf-impl-2.2.0.jar:2.2.0]
at com.sun.faces.config.processor.FactoryConfigProcessor.processFactories(FactoryConfigProcessor.java:259) [jsf-impl-2.2.0.jar:2.2.0]
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:216) [jsf-impl-2.2.0.jar:2.2.0]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:435) [jsf-impl-2.2.0.jar:2.2.0]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:214) [jsf-impl-2.2.0.jar:2.2.0]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_09]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_09]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]
Caused by: java.lang.ClassNotFoundException: com.sun.faces.spi.InjectionProvider from [Module "javax.faces.api:main" from local module loader #70dc82be (roots: /Users/ilyadyoshin/develop/jboss-as-7.1.1.Final/modules)]
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)
... 19 more
Even more: when I look through contents of the jsf-api.jar I see this class.

may be I'm late but for other peoples who fall into the same problem, I found a solution here : https://community.jboss.org/thread/203257?start=0&tstart=0
Add to the module.xml of your JSF API module a depency to the JSF IMPL module by adding this line :
<module name="com.sun.jsf-impl"/>
Some changes may be required when multiple JSF versions exists on the AS.
Tested with JBoss 7.1 and JSF 2.2.0m12
EDIT : I didn't saw "(final)" in your subject, with the final JSF 2.2 version I ran into another probleme with NoContextActiveException for FlowDefinition :(

You are right, JSF 2.2 seems only to be supported starting from Wildfly / AS 8. I found a thread at JBoss community with installation instructions, followed by the information that it makes no sense to install with AS 7.1.1.

The thread referenced in the other answer (https://community.jboss.org/thread/203257) has been updated. I've tried it on my AS 7.1.1 and it works

Related

Geoserver 2.14+ fails on Glassfish4+ - Anyone succeeded with this?

During hardware migration, thought it sensible to upgrade Geoserver from 2.13.0 to 2.14.2 on Glassfish 4.0 hoping to cure flakiness.
JVM is configured to use a non-standard data directory using JVM parameter:
-DGEOSERVER_DATA_DIR=/geoserver
Using the .war downloaded from Geoserver.org, deployment fails
2.15.x exhibits the same failure
2.13.0 deploys and runs, albeit with some flakiness (similar stack track shown on the home-page of geoserver once logged in)
The issue appears platform independent, environments used:
Windows 10 X64 running Oracle Java 1.8.0_161 on Glassfish 4 OR Glassfish 5 (including fresh out-of box installs of Glassfish)
CentOS 7 running OpenJDK 1.8.0_222 on Glassfish 4
The WAR did deploy on a localhost (W10) install of TomCat, albeit without the custom data directory set
If latest GeoServer builds could be made to work on Glassfish 4, this would save considerable time and expense
Any suggestions appreciated
Severe: Exception during lifecycle processing
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gwcFacade' defined in URL [jar:file:/E:/glassfish-4.0/glassfish/domains/domain1/applications/geoserver/WEB-INF/lib/gs-gwc-2.14.5.jar!/applicationContext.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.geoserver.gwc.GWC]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkNotNull(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
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:360)
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 org.glassfish.admin.rest.resources.admin.CommandResource.executeCommand(CommandResource.java:396)
at org.glassfish.admin.rest.resources.admin.CommandResource.execCommandSimpInMultOut(CommandResource.java:234)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:125)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:91)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:346)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:341)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:101)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:224)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:198)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:946)
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:331)
at org.glassfish.admin.rest.adapter.JerseyContainerCommandService$3.service(JerseyContainerCommandService.java:165)
at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:181)
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:748)
Severe: Exception while loading the app
Severe: Undeployment failed for context /geoserver
Warning: The web application [/geoserver] registered the JDBC driver [org.h2.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Severe: The web application [/geoserver] created a ThreadLocal with key of type [java.lang.ThreadLocal.SuppliedThreadLocal] (value [java.lang.ThreadLocal$SuppliedThreadLocal#e524836]) and a value of type [org.geowebcache.storage.CompositeBlobStore.StoreSuitabilityCheck] (value [EXISTING]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Severe: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gwcFacade' defined in URL [jar:file:/E:/glassfish-4.0/glassfish/domains/domain1/applications/geoserver/WEB-INF/lib/gs-gwc-2.14.5.jar!/applicationContext.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.geoserver.gwc.GWC]: Constructor threw exception; nested exception is java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkNotNull(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
The reason why you are seeing this is because the application you are trying to deploy packages a different Google Guava version than the one that Glassfish ships with. Unfortunately Glassfish favours its own packaged version which does not have the method com.google.common.base.Preconditions.checkNotNull(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;).
There exist some (more or less involved) workarounds.
https://github.com/eclipse-ee4j/glassfish/issues/20850
Since you seem to have a WAR archive, this comment https://github.com/eclipse-ee4j/glassfish/issues/20850#issuecomment-422010251 suggests that it might be enough to disable the classloader delegation in the glassfish-web.xml. Maybe you are lucky and this is indeed helping with your WAR file.
Otherwise you'll have to switch to Payara which seems to have this bug fixed since some time.

Jboss 7 deploy struts war file

When i try to deploy war file in jboss 7 AS server i got following error
23:23:07,111 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC00001: Failed to start service jboss.deployment.unit."testapp.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."testapp.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "testapp.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_95]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_95]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_95]
Caused by: java.lang.RuntimeException: Error getting reflective information for class fr.improve.struts.taglib.layout.LabelledTag with ClassLoader ModuleClassLoader for Module "deployment.testapp.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: Lorg/apache/struts/util/MessageResources;
at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_95]
at java.lang.Class.privateGetDeclaredFields(Class.java:2509) [rt.jar:1.7.0_95]
at java.lang.Class.getDeclaredFields(Class.java:1819) [rt.jar:1.7.0_95]
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.struts.util.MessageResources from [Module "deployment.testapp.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
... 15 more
23:23:07,118 INFO [org.jboss.as.server] (HttpManagementService-threads - 7) JBAS015870: Deploy of deployment "testapp.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"testapp.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"testapp.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"testapp.war\""}}
23:23:07,206 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment testapp.war in 87ms
23:23:07,206 INFO [org.jboss.as.controller] (HttpManagementService-threads - 7) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.deployment.unit."testapp.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."testapp.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "testapp.war"
This problem happens when you try to deploy an ear/war/jar deployment in jboss7/wildfly and you have not specified what dependencies need your application.
Jboss7/Wildfly has his own module class loader to isolate applications and dependencies running into the same java virtual machine.
All deployments in jboss/wildfly are loaded as modules (not only the content included in modules folder, the content of deployments folder are modules too).
If you don't have packaged "struts" jar into the application deployment file, you will need to deploy the required dependencies as modules and tell to jboss that your application depends on it.
So, you have at least five alternatives:
Build your application as an Uber-Jar including your dependencies
inside.
Deploy your application and dependencies in the deployments folder and add a manifest entry in your application to tell to jboss that
your application depends on it.
Deploy your application and application dependencies (jars) in the deployments folder and add a jboss deployment descriptor xml in your
application to tell to jboss that your application depends on it.
Deploy your application in the deployments folder and create modules for your dependencies (if do not exist) and add a manifest
entry in your application to tell to jboss that your application
depends on it.
Deploy your application in deployments folder and create modules for your dependencies (if do not exist) and use a jboss deployment
descriptor xml in your application to tell to jboss that your
application depends on it.
For more information visit:
jboss 7 classloader
jboss 7 deployment descriptors

OSGi JAX-RS Connector with Adobe CQ 5.6 (MOXY)

We are getting an exception while accessing a JAX-RS service installed in my local Adobe CQ (5.6.1). I'm using the OSGi JAX-RS Connector project for JAX-RS integration in CQ using "provider-moxy".
While accessing my test service, the system is is throwing an Exception as follows
15.09.2015 18:03:45.862 *INFO* [0:0:0:0:0:0:0:1 [1442343820762] GET /services/person/get HTTP/1.1] servletengine Servlet threw exception: org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: org/eclipse/persistence/internal/jaxb/many/MapEntry
at org.glassfish.jersey.servlet.internal.ResponseWriter.rethrow(ResponseWriter.java:256)
at org.glassfish.jersey.servlet.internal.ResponseWriter.failure(ResponseWriter.java:238)
at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:486)
at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:316)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:291)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1140)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:403)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:386)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:334)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
at com.eclipsesource.jaxrs.publisher.internal.ServletContainerBridge.service(ServletContainerBridge.java:76)
at org.apache.felix.http.base.internal.handler.ServletHandler.doHandle(ServletHandler.java:96)
at org.apache.felix.http.base.internal.handler.ServletHandler.handle(ServletHandler.java:79)
at org.apache.felix.http.base.internal.dispatch.ServletPipeline.handle(ServletPipeline.java:42)
at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:49)
at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
at org.apache.sling.i18n.impl.I18NFilter.doFilter(I18NFilter.java:127)
at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
at com.adobe.granite.license.impl.LicenseCheckFilter.doFilter(LicenseCheckFilter.java:179)
at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
at org.apache.sling.security.impl.ReferrerFilter.doFilter(ReferrerFilter.java:263)
at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
at org.apache.felix.http.sslfilter.internal.SslFilter.doFilter(SslFilter.java:55)
at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
at org.apache.sling.engine.impl.log.RequestLoggerFilter.doFilter(RequestLoggerFilter.java:75)
at org.apache.felix.http.base.internal.handler.FilterHandler.doHandle(FilterHandler.java:88)
at org.apache.felix.http.base.internal.handler.FilterHandler.handle(FilterHandler.java:76)
at org.apache.felix.http.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:47)
at org.apache.felix.http.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:33)
at org.apache.felix.http.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:48)
at org.apache.felix.http.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:39)
at
...............................
But the reported class is already present in "org.eclipse.persistence.moxy-2.6.0.jar" which is in activated state.
As I'm stuck , any pointers to solve this issue is greatly appreciated.
Update
The stack trace also says
Caused by: java.lang.ClassNotFoundException: org.eclipse.persistence.internal.jaxb.many.MapEntry not found by my-bundle [308]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1500)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1923)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.persistence.internal.jaxb.JaxbClassLoader.loadClass(JaxbClassLoader.java:107)
... 91 more
But the manifest creation directive for my-bundle is
Import-Package * Import-Package
Thanks and Regards,
San
It seems the error can be solved by adding an Import-package statement for "org.eclipse.persistence.internal.jaxb.many" in my custom bundle.

Error when deploying on JBoss AS 7.1

I am having a problem with deploying my application on JBoss AS 7.1. Here is what happened, we have a project that has been build on JDK 1.4 currently running on JRun 4. We are migrating the project to JDK 1.7 and deploy on JBoss AS 7.1.1.
Made required changes to the project compile in eclipse using JDK 1.7 like "enum", changed implementation of Log4j, etc. However the current project heavily relies on jaxb ver 1.0 implementation (which we would make changes over a period of time to the latest jaxb version and convert the project to web services).
However when I try to deploy the same project in JBoss I get an error as below, any help to get this resolved would be really appreciated.
12:39:55,710 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Starting deployment of "presto.war"
12:40:00,590 WARN [org.jboss.as.server.deployment] (MSC service thread 1-5) Class Path entry lib/xerces-1.2.3.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/presto.war/WEB-INF/lib/fop.jar" does not point to a valid jar for a Class-Path reference.
12:40:00,591 WARN [org.jboss.as.server.deployment] (MSC service thread 1-5) Class Path entry lib/xalan-2.0.0.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/presto.war/WEB-INF/lib/fop.jar" does not point to a valid jar for a Class-Path reference.
12:40:00,593 WARN [org.jboss.as.server.deployment] (MSC service thread 1-5) Class Path entry lib/xalanj1compat.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/presto.war/WEB-INF/lib/fop.jar" does not point to a valid jar for a Class-Path reference.
12:40:00,595 WARN [org.jboss.as.server.deployment] (MSC service thread 1-5) Class Path entry lib/batik.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/presto.war/WEB-INF/lib/fop.jar" does not point to a valid jar for a Class-Path reference.
12:40:00,596 WARN [org.jboss.as.server.deployment] (MSC service thread 1-5) Class Path entry lib/jimi-1.0.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/presto.war/WEB-INF/lib/fop.jar" does not point to a valid jar for a Class-Path reference.
12:40:00,598 WARN [org.jboss.as.server.deployment] (MSC service thread 1-5) Class Path entry lib/logkit-1.0b4.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/presto.war/WEB-INF/lib/fop.jar" does not point to a valid jar for a Class-Path reference.
12:40:00,599 WARN [org.jboss.as.server.deployment] (MSC service thread 1-5) Class Path entry lib/avalon-framework-4.0.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/presto.war/WEB-INF/lib/fop.jar" does not point to a valid jar for a Class-Path reference.
12:40:00,611 WARN [org.jboss.as.server.deployment] (MSC service thread 1-5) Class Path entry jaxp.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/presto.war/WEB-INF/lib/xalan.jar" does not point to a valid jar for a Class-Path reference.
12:40:00,612 WARN [org.jboss.as.server.deployment] (MSC service thread 1-5) Class Path entry crimson.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/presto.war/WEB-INF/lib/xalan.jar" does not point to a valid jar for a Class-Path reference.
12:40:00,617 WARN [org.jboss.as.server.deployment] (MSC service thread 1-5) Class Path entry sax.jar in "/C:/jboss-as-7.1.1.Final/standalone/deployments/presto.war/WEB-INF/lib/xt.jar" does not point to a valid jar for a Class-Path reference.
12:40:01,495 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.unit."presto.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."presto.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "presto.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_51]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
Caused by: java.lang.RuntimeException: Error getting reflective information for class org.apache.taglibs.xtags.xslt.XalanStyleTag with ClassLoader ModuleClassLoader for Module "deployment.presto.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: Lorg/apache/xalan/xslt/XSLTResultTarget;
at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.7.0_51]
at java.lang.Class.privateGetDeclaredFields(Class.java:2397) [rt.jar:1.7.0_51]
at java.lang.Class.getDeclaredFields(Class.java:1806) [rt.jar:1.7.0_51]
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.xalan.xslt.XSLTResultTarget from [Module "deployment.presto.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
... 15 more
From the error stack you can see that:
Caused by: java.lang.ClassNotFoundException: org.apache.xalan.xslt.XSLTResultTarget from [Module "deployment.presto.war:main" from Service Module Loader]
So the class jar file getting loaded is from default JBOSS Modules and clearly the xalan.jar that comes with the JBoss 7(jboss-as-7.1.1.Final\modules\org\apache\xalan\main) does not contain that that class:
You need to either start using the jar file that your application refers to by replacing it with this jar(which is not reccomended) or use jboss-deployment-structure.xml to do so. This link could help you to decide what works best for you

Apache CXF issue on Glassfish

I created a web-service app based on Apache CXF (2.7.5), deployed it on a Glassfish 3.0.1 and it works fine till I turn on WS-Sec support. Then I get the following exception when I try to do a web-service request:
Caused by: javax.xml.crypto.NoSuchMechanismException: class configured for XMLSignatureFactory(provider: ApacheXMLDSig)cannot be found.
at javax.xml.crypto.dsig.XMLDSigSecurity.doGetImpl(Unknown Source) ~[webservices-osgi.jar:1.0]
at javax.xml.crypto.dsig.XMLDSigSecurity.getImpl(Unknown Source) ~[webservices-osgi.jar:1.0]
at javax.xml.crypto.dsig.XMLDSigSecurity.getImpl(Unknown Source) ~[webservices-osgi.jar:1.0]
at javax.xml.crypto.dsig.XMLSignatureFactory.findInstance(Unknown Source) ~[webservices-osgi.jar:1.0]
at javax.xml.crypto.dsig.XMLSignatureFactory.getInstance(Unknown Source) ~[webservices-osgi.jar:1.0]
at org.apache.ws.security.message.WSSecSignature.init(WSSecSignature.java:127) ~[wss4j-1.6.10.jar:1.6.10]
at org.apache.ws.security.message.WSSecSignature.<init>(WSSecSignature.java:120) ~[wss4j-1.6.10.jar:1.6.10]
at org.apache.cxf.ws.security.wss4j.policyhandlers.AbstractBindingBuilder.getSignatureBuilder(AbstractBindingBuilder.java:1730) ~[cxf-rt-ws-security-2.7.5.jar:2.7.5]
at org.apache.cxf.ws.security.wss4j.policyhandlers.AsymmetricBindingHandler.doSignature(AsymmetricBindingHandler.java:546) ~[cxf-rt-ws-security-2.7.5.jar:2.7.5]
at org.apache.cxf.ws.security.wss4j.policyhandlers.AsymmetricBindingHandler.doSignBeforeEncrypt(AsymmetricBindingHandler.java:147) ~[cxf-rt-ws-security-2.7.5.jar:2.7.5]
... 273 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.apache.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory
at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:744) ~[felix.jar:na]
at org.apache.felix.framework.ModuleImpl.access$100(ModuleImpl.java:61) ~[felix.jar:na]
at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1656) ~[felix.jar:na]
at java.lang.ClassLoader.loadClass(ClassLoader.java:247) ~[na:1.6.0_43]
It seems that CXF invokes the XMLSignatureFactory class contained by Glassfish's default webservice provider implementation instead of invoking it's own one (it's in the xmlsec.jar file). All CXF files are packed into my war file and also have the <class-loader delegate="false" /> set in sun-web.xml.
Can someone help me why the Glassfish classloader works this way and how could I fix this?
I managed to find out that Glassfish (at least the 3.0.1 version) modifies the default class loading behavior to "protect" some packages (mostly javax. packages) in it's classpath. That's the reason why it finds and uses classes in it's modules directory instead of the one in my war's lib.
To solve this a JVM option should be added to the domain.xml:
<jvm-options>-Dcom.sun.enterprise.overrideablejavaxpackages=javax.xml.crypto,javax.xml.crypto.dsig</jvm-options>
With this Glassfish will allow to use your libs in your war file. But even with this setting it's problematic to use CXF with WS-Securityy along with Metro. The better solution is to use a Glassfish with only Web Profile not Full Profile as Web Profile doesn't have Metro included.