Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tomcat v6 v7 v8 agent includes services that cause class loading issues with apache-tomee-plus 1.7.2 #11

Closed
spetix opened this issue Apr 15, 2019 · 2 comments
Assignees
Labels

Comments

@spetix
Copy link
Contributor

spetix commented Apr 15, 2019

agent's contextLoader is registered before official one present in jaxb-impl.jar and we got a NoClassDefFoundError (see tomee log, below). Removing META-INF/services/javax.xml.bind.JAXBContext (that is already provided by tomee) and META-INF/services/javax.management.remote.JMXConnectorProvider and another solves the issue.

Shall we have a openssoclientsdk.jar specific for tomee without the above shaded resources?

Apr 15, 2019 9:46:09 AM org.apache.openejb.config.ConfigurationFactory configureApplication
INFO: Configuring enterprise application: /usr/share/tomee/webapps/portal
java.lang.NoClassDefFoundError: org/forgerock/openam/sdk/javax/activation/DataSource
        at org.forgerock.openam.sdk.com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl.<clinit>(RuntimeBuiltinLeafInfoImpl.java:474)
        at org.forgerock.openam.sdk.com.sun.xml.bind.v2.model.impl.RuntimeTypeInfoSetImpl.<init>(RuntimeTypeInfoSetImpl.java:63)
        at org.forgerock.openam.sdk.com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:128)
        at org.forgerock.openam.sdk.com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createTypeInfoSet(RuntimeModelBuilder.java:84)
        at org.forgerock.openam.sdk.com.sun.xml.bind.v2.model.impl.ModelBuilder.<init>(ModelBuilder.java:162)
        at org.forgerock.openam.sdk.com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.<init>(RuntimeModelBuilder.java:92)
        at org.forgerock.openam.sdk.com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:455)
        at org.forgerock.openam.sdk.com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:303)
        at org.forgerock.openam.sdk.com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:139)
        at org.forgerock.openam.sdk.com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1156)
        at org.forgerock.openam.sdk.com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:165)
        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 javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:247)
        at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:234)
        at javax.xml.bind.ContextFinder.find(ContextFinder.java:441)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:641)
        at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:584)
        at ***************************.Navigation.load(Navigation.java:85)
        at ***************************.AdminRS.<clinit>(AdminRS.java:116)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at org.apache.openejb.util.Classes.forName(Classes.java:64)
        at org.apache.openejb.config.rules.ValidationBase.loadClass(ValidationBase.java:151)
        at org.apache.openejb.config.rules.CheckMethods.check_unusedCreateMethods(CheckMethods.java:318)
        at org.apache.openejb.config.rules.CheckMethods.validate(CheckMethods.java:55)
        at org.apache.openejb.config.rules.ValidationBase.validate(ValidationBase.java:50)
        at org.apache.openejb.config.AppValidator.validate(AppValidator.java:101)
        at org.apache.openejb.config.ValidateModules.deploy(ValidateModules.java:38)
        at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:403)
        at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:971)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1227)
        at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1100)
        at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5416)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1095)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1930)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.forgerock.openam.sdk.javax.activation.DataSource
        at org.apache.openejb.core.TempClassLoader.loadClass(TempClassLoader.java:176)
        at org.apache.openejb.core.TempClassLoader.loadClass(TempClassLoader.java:80)
        ... 50 more
@spetix spetix changed the title tomcat v6 v7 v8 agent includes services that cause class loading issues with apache-tomee-plus 7.1.0 tomcat v6 v7 v8 agent includes services that cause class loading issues with apache-tomee-plus 1.7.2 Apr 15, 2019
@spetix
Copy link
Contributor Author

spetix commented Apr 15, 2019

@vharseko: I've created a specialized bundle for tomee only that seems to work properly in my fork. Let me know if you want me to merge or if you have a better solution than the following:

  • repack in jee-agent-clientsdk openam-clientsdk shading the offending services
  • create a specific bundle jee-agents-distribution-tomee that uses that in place of the original one in lib/openssoclient.jar

@vharseko
Copy link
Member

thanks @spetix for detect problem^ please check bbb8265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants