Topic
  • 6 replies
  • Latest Post - ‏2013-07-25T10:20:02Z by bpaskin
SystemAdmin
SystemAdmin
37422 Posts

Pinned topic WebSphere 8: el-api.jar (in app) conflicts with javax.j2ee.el.jar (in WS)

‏2013-01-04T15:50:25Z |
Hi!

In short: is there a way to tell WebSphere to use classes from the application's own el-api.jar instead of from (the built-in) javax.j2ee.el.jar?
Story:
I know there are discussions on the internet about this problem during migrating applications from WAS 6.1 to WAS 8, but neither of them mentions explicitly this point:

The whole thing gets stuck when WAS 8 tries to load javax.el.ExpressionFactory from el-api.jar (included in the EAR). At this point, however, it has already loaded it from javax.j2ee.el.jar. (Which didn't exist in WAS 6.1.) If you switch on verbose class loading:

class load: javax.el.ExpressionFactory from: file:/C:/Program Files/IBM/WebSphere/AppServer/plugins/javax.j2ee.el.jar
(BEFORE you would even install the application!)

It seems, since this latter jar is already loaded before one would install the EAR of the application containing el-api.jar, WAS 8 stumbles upon a class loading conflict, regardless of whether you've specified for it to use the PARENT_LAST class loading strategy or not.

I can compile and install the application by using javax.j2ee.el.jar instead of el-api.jar in it, but on the one hand I'm not aware of what long-term consequences this might have (I haven't been able to get it running either way so far), on the other hand the ultimate goal would be to be able to install the original EAR (containing its own JSF libraries etc.) on the WAS 8 server with as few modifications as possible.

Is there a way to tell the WAS 8 server to reload the possibly conflicting classes in the application from el-api.jar or even not to load javax.j2ee.el.jar in the first place? (Like I mentioned, specifying PARENT_CLASS doesn't have any effect on this.)
Thanks,
Agoston
The exception by the way that is thrown when WAS 8 tries to load javax.el.ExpressionFactory from el-api.jar (when starting the installed application):

(Sorry that it's in German, some googling identifies the Eglish version of this error message as:
'java.lang.LinkageError: loading constraint violation: loader "com/ibm/ws/classloader/CompoundClassLoader@1ef123a" previously initiated loading for a different type with name "javax/el/ExpressionFactory" defined by loader org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader@1f75d64"')
java.lang.LinkageError: Übertretung der Ladeeinschränkung: Ladeprogramm "com/ibm/ws/classloader/CompoundClassLoader@1ef123a" hat zuvor das Laden für einen anderen Typ mit dem Namen "javax/el/ExpressionFactory", der durch Ladeprogramm "org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader@1f75d64" definiert ist, eingeleitet.
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:262)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:69)
at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:829)
at com.ibm.ws.classloader.CompoundClassLoader.localFindClass(CompoundClassLoader.java:744)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:585)
at java.lang.ClassLoader.loadClass(ClassLoader.java:627)
at java.lang.Class.getDeclaredFieldsImpl(Native Method)
at java.lang.Class.getDeclaredFields(Class.java:546)
at com.ibm.ffdc.util.formatting.Introspector$1.run(Introspector.java:138)
at com.ibm.ffdc.util.formatting.Introspector$1.run(Introspector.java:136)
at java.security.AccessController.doPrivileged(AccessController.java:254)
at com.ibm.ffdc.util.formatting.Introspector.getDeclaredFields(Introspector.java:135)
at com.ibm.ffdc.util.formatting.Introspector.formatTo(Introspector.java:94)
at com.ibm.ffdc.util.provider.IncidentStream$2.writeTo(IncidentStream.java:194)
at com.ibm.ffdc.util.provider.IncidentStream.write(IncidentStream.java:198)
at com.ibm.ffdc.util.provider.IncidentStream.write(IncidentStream.java:129)
at com.ibm.ffdc.util.formatting.JavaUtilFormatter.formatTo(JavaUtilFormatter.java:56)
at com.ibm.ffdc.util.formatting.JavaUtilFormatter.formatTo(JavaUtilFormatter.java:42)
at com.ibm.ffdc.util.provider.IncidentStream$2.writeTo(IncidentStream.java:194)
at com.ibm.ffdc.util.provider.IncidentStream.write(IncidentStream.java:198)
at com.ibm.ffdc.util.provider.IncidentStream.write(IncidentStream.java:129)
at com.ibm.ffdc.util.formatting.Introspector.formatTo(Introspector.java:109)
at com.ibm.ffdc.util.provider.IncidentStream$2.writeTo(IncidentStream.java:194)
at com.ibm.ffdc.util.provider.IncidentStream.write(IncidentStream.java:198)
at com.ibm.ffdc.util.provider.IncidentStream.write(IncidentStream.java:129)
at com.ibm.ws.ffdc.impl.DMAdapter.formatTo(DMAdapter.java:88)
at com.ibm.ffdc.util.provider.IncidentLogger.writeIncidentTo(IncidentLogger.java:63)
at com.ibm.ws.ffdc.impl.FfdcProvider.logIncident(FfdcProvider.java:205)
at com.ibm.ws.ffdc.impl.FfdcProvider.logIncident(FfdcProvider.java:136)
at com.ibm.ffdc.util.provider.FfdcProvider.log(FfdcProvider.java:251)
at com.ibm.ws.ffdc.impl.FfdcProvider.log(FfdcProvider.java:149)
at com.ibm.ffdc.util.provider.IncidentEntry.log(IncidentEntry.java:105)
at com.ibm.ffdc.util.provider.Ffdc.log(Ffdc.java:94)
at com.ibm.ws.ffdc.FFDCFilter.processException(FFDCFilter.java:114)
at com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(FFDCWrapper.java:6)
at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1653)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:410)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:746)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:422)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:714)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1160)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1369)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:638)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:967)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:766)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1354)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2150)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$1.run(CompositionUnitMgrImpl.java:663)
at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:5413)
at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:5539)
at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:677)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:621)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1246)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:256)
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1085)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:966)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:773)
at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1335)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1228)
at com.ibm.ws.management.commands.AdminServiceCommands$InvokeCmd.execute(AdminServiceCommands.java:251)
at com.ibm.ws.console.core.mbean.MBeanHelper.invoke(MBeanHelper.java:241)
at com.ibm.ws.console.appdeployment.ApplicationDeploymentCollectionAction.execute(ApplicationDeploymentCollectionAction.java:564)
at org.apache.struts.action.RequestProcessor.processActionPerform(Unknown Source)
at org.apache.struts.action.RequestProcessor.process(Unknown Source)
at org.apache.struts.action.ActionServlet.process(Unknown Source)
at org.apache.struts.action.ActionServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1214)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:774)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:125)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:926)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1023)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:1384)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:193)
at org.apache.struts.action.RequestProcessor.doForward(Unknown Source)
at org.apache.struts.tiles.TilesRequestProcessor.doForward(Unknown Source)
at org.apache.struts.action.RequestProcessor.processForwardConfig(Unknown Source)
at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Unknown Source)
at org.apache.struts.action.RequestProcessor.process(Unknown Source)
at org.apache.struts.action.ActionServlet.process(Unknown Source)
at org.apache.struts.action.ActionServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1214)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:774)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:125)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:92)
at com.ibm.ws.console.core.servlet.WSCUrlFilter.setUpCommandAssistance(WSCUrlFilter.java:950)
at com.ibm.ws.console.core.servlet.WSCUrlFilter.continueStoringTaskState(WSCUrlFilter.java:499)
at com.ibm.ws.console.core.servlet.WSCUrlFilter.doFilter(WSCUrlFilter.java:320)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:192)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:89)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:926)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1023)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:895)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1784)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1659)
Updated on 2013-02-19T22:45:41Z at 2013-02-19T22:45:41Z by shivam_IST
  • gas
    gas
    891 Posts

    Re: WebSphere 8: el-api.jar (in app) conflicts with javax.j2ee.el.jar (in WS)

    ‏2013-01-04T16:35:06Z  
    Hi,

    Since WAS v8 fully supports JEE6, it contains el implementation.
    I'd recommend remove any duplicated jars from the application and use provided implementations.
    You should only add third party libraries if you need features not provided by the platform otherwise you may hit some classloader configuration issues.

    Gas
  • SystemAdmin
    SystemAdmin
    37422 Posts

    Re: WebSphere 8: el-api.jar (in app) conflicts with javax.j2ee.el.jar (in WS)

    ‏2013-01-07T11:06:42Z  
    • gas
    • ‏2013-01-04T16:35:06Z
    Hi,

    Since WAS v8 fully supports JEE6, it contains el implementation.
    I'd recommend remove any duplicated jars from the application and use provided implementations.
    You should only add third party libraries if you need features not provided by the platform otherwise you may hit some classloader configuration issues.

    Gas
    Hi!

    Yes, I'm well aware of the fact that WAS8 contains an EL implementation (it's pretty much there implicitly in my original post).

    However, if I "remove any duplicated jars", I'm pretty sure that I will have to heavily adjust the code (if I can get the project to run at all) -- all because WAS8 forces me to use its own jars!

    (Btw. we are simultaneously trying to go the other way as well, i.e., throwing away duplicates -- and keep getting mysterious exceptions, just as we expected. It would spare us SO much time to just be able to deploy the same EAR, which btw. should be a pretty obvious expectation!)
    So the question still stands: how can I tell WAS8 not to force me to use its own EL implementation (or any of its own jars for that matter)?
    Thanks,
    Agoston
  • bpaskin
    bpaskin
    4058 Posts

    Re: WebSphere 8: el-api.jar (in app) conflicts with javax.j2ee.el.jar (in WS)

    ‏2013-01-08T12:49:41Z  
    Hi!

    Yes, I'm well aware of the fact that WAS8 contains an EL implementation (it's pretty much there implicitly in my original post).

    However, if I "remove any duplicated jars", I'm pretty sure that I will have to heavily adjust the code (if I can get the project to run at all) -- all because WAS8 forces me to use its own jars!

    (Btw. we are simultaneously trying to go the other way as well, i.e., throwing away duplicates -- and keep getting mysterious exceptions, just as we expected. It would spare us SO much time to just be able to deploy the same EAR, which btw. should be a pretty obvious expectation!)
    So the question still stands: how can I tell WAS8 not to force me to use its own EL implementation (or any of its own jars for that matter)?
    Thanks,
    Agoston
    Hi, you can change the classloader for the module. Or you can use an isolated classloader and/or use it in a shared library.

    Brian
  • shivam_IST
    shivam_IST
    1 Post

    Re: WebSphere 8: el-api.jar (in app) conflicts with javax.j2ee.el.jar (in WS)

    ‏2013-02-19T22:45:41Z  
    • bpaskin
    • ‏2013-01-08T12:49:41Z
    Hi, you can change the classloader for the module. Or you can use an isolated classloader and/or use it in a shared library.

    Brian
    Hello,

    I am having a similar problem with Websphere 7. Does anybody found any solution ?

    So far tried following solutions :-

    1. Isolated classloader
    2. Tried to use Websphere out of the box EL by deleting el-api and el-ri under my webmodule, but I am getting erron in Rich faces

    Any help will be appreciated ..

    Regards
    Shivam
  • DeepaRao
    DeepaRao
    1 Post

    Re: WebSphere 8: el-api.jar (in app) conflicts with javax.j2ee.el.jar (in WS)

    ‏2013-07-24T21:22:56Z  
    Hello,

    I am having a similar problem with Websphere 7. Does anybody found any solution ?

    So far tried following solutions :-

    1. Isolated classloader
    2. Tried to use Websphere out of the box EL by deleting el-api and el-ri under my webmodule, but I am getting erron in Rich faces

    Any help will be appreciated ..

    Regards
    Shivam

    Did you get any solution...I am having the same problem.

    Tried -Classloader PARENT last. -did not help

    Tried adding in web.xml -

            
    
    <context-param
    >
                    
    
    <param-name
    >com.sun.faces.expressionFactory
    
    </param-name
    >
                    
    
    <param-value
    >com.sun.el.ExpressionFactoryImpl
    
    </param-value
    >
            
    
    </context-param
    >
    

    Did not help

  • bpaskin
    bpaskin
    4058 Posts

    Re: WebSphere 8: el-api.jar (in app) conflicts with javax.j2ee.el.jar (in WS)

    ‏2013-07-25T10:20:02Z  
    • DeepaRao
    • ‏2013-07-24T21:22:56Z

    Did you get any solution...I am having the same problem.

    Tried -Classloader PARENT last. -did not help

    Tried adding in web.xml -

    <pre class="xml" dir="ltr" style="font-family:monospace;"> <context-param > <param-name >com.sun.faces.expressionFactory </param-name > <param-value >com.sun.el.ExpressionFactoryImpl </param-value > </context-param > </pre>

    Did not help

    Why do you want to use your own EL when it is supplied as part of the JEE spec?

    Put it in a shared library and set it to an isolated classloader.

    Regards,

    Brian