Discussion:
Camel Weblogic 12c
Frank Ertl
2013-05-30 09:54:21 UTC
Permalink
Hi Jose,

as I stated in this thread:
http://camel.465427.n5.nabble.com/Spring-Camel-Context-initialization-error-in-weblogic-12c-td5733202.html
<http://camel.465427.n5.nabble.com/Spring-Camel-Context-initialization-error-in-weblogic-12c-td5733202.html>
the error concerning JAXB is a classloading issue in weblogic 12c and could
be solved by changing the classloading policy.

However it's not sure that this is the only issue. All I can say is that I
have camel up and running on weblogic 12c. It's not been that easy as one
would expect but finally it works.

By the way why do you think it's not a proper solution to patch a jar with
information that's needed by weblogic to work correctly?

Frank
jose
2013-05-30 09:32:10 UTC
Permalink
Hi, I am trying to use Camel with Weblogic 12c but I am getting lots of
problems. First, I tried to use Camel with Spring but I got a name collision
error. In this forum there is a post that suggest to insert a
jaxb.properties file into Camel libraries, which I don't think it is a
proper solution.

Then I have tried to use Camel without Spring, just using a camel-config.xml
file and Camel servlet (as explained in the Camel examples) but I am still
getting this error:

*java.lang.RuntimeException: Error loading routes from resource:
classpath:/camel-config.xml*
at
org.apache.camel.component.servletlistener.CamelServletContextListener.extractRoutes(CamelServletContextListener.java:389)
at
org.apache.camel.component.servletlistener.CamelServletContextListener.contextInitialized(CamelServletContextListener.java:108)
at
weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:582)
at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
at
weblogic.servlet.internal.EventsManager.executeContextListener(EventsManager.java:233)
at
weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:190)
at
weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:175)
at
weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1730)
at
weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2740)
at
weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1704)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:781)
at
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213)
at
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:70)
at
weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:212)
at
weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:111)
at
weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
at
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213)
at
weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
at
weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:70)
at
weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:24)
at
weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:729)
at
weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35)
at
weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:258)
at
weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:48)
at
weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165)
at
weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:79)
at
weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:582)
at
weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:148)
at
weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:114)
at
weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:335)
at
weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:844)
at
weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1253)
at
weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:440)
at
weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:163)
at
weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:195)
at
weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:13)
at
weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:68)
at
weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused By: javax.xml.bind.JAXBException: Provider
org.eclipse.persistence.jaxb.JAXBContextFactory could not be instantiated:
javax.xml.bind.JAXBException:
Exception Description: The property or field outputs was specified in
propOrder but is not a valid property.
- with linked exception:
[Exception [EclipseLink-50012] (Eclipse Persistence Services -
2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.JAXBException
Exception Description: The property or field outputs was specified in
propOrder but is not a valid property.]
- with linked exception:
*[javax.xml.bind.JAXBException:
Exception Description: The property or field outputs was specified in
propOrder but is not a valid property.*

After I few days trying to get Camel+Weblogic 12 working without success I
wonder if Camel supports Weblogic 12c.

Please help.

Thank you very much.

Jose
Jose
2013-05-30 15:30:47 UTC
Permalink
Hi Frank, thanks for your quick replied.

I had already read that post but it didn't work for me.

I have eventually managed to fix the problem. This is my solution.

- I am using Camel without Spring, just using camel-config.xml file instead.
Camel is started by a listener in the web.xml file

- In order to fix the jaxb issue, I have created the file
META-INF/services/javax.xml.bind.JAXBContext, its content is just
"com.sun.xml.bind.v2.ContextFactory".

- I have created the file
META-INF/services/com.sun.xml.ws.spi.db.BindingContextFactory, its content
is just "com.sun.xml.ws.db.glassfish.JAXBRIContextFactory".

- I have added this in my weblogic.xml file (my application is a WAR file):

<container-descriptor>
<prefer-web-inf-classes>false</prefer-web-inf-classes>
<prefer-application-resources>

<resource-name>META-INF/services/com.sun.xml.ws.spi.db.BindingContextFactory</resource-name>

<resource-name>META-INF/services/javax.xml.bind.JAXBContext</resource-name>
</prefer-application-resources>
</container-descriptor>

This configuration overrides the default Weblogic jaxb provider. This way is
working for me. I hope it could help.

By the way, I am trying to use this configuration but using Spring
(camel-spring). Now I am getting an occasional NullPointerException when
parsing the applicationContext. I am using Camel 2.11 and JDK7.

Does Camel 2.11 support JDK7?

Thanks a lot.

Jose
Christian Müller
2013-05-30 20:19:19 UTC
Permalink
Yes, Camel 2.11 supports Java 7. Which specific version do you use? Try
upgrading to the actual version.

Best,
Christian

Sent from a mobile device
Post by Jose
Hi Frank, thanks for your quick replied.
I had already read that post but it didn't work for me.
I have eventually managed to fix the problem. This is my solution.
- I am using Camel without Spring, just using camel-config.xml file instead.
Camel is started by a listener in the web.xml file
- In order to fix the jaxb issue, I have created the file
META-INF/services/javax.xml.bind.JAXBContext, its content is just
"com.sun.xml.bind.v2.ContextFactory".
- I have created the file
META-INF/services/com.sun.xml.ws.spi.db.BindingContextFactory, its content
is just "com.sun.xml.ws.db.glassfish.JAXBRIContextFactory".
<container-descriptor>
<prefer-web-inf-classes>false</prefer-web-inf-classes>
<prefer-application-resources>
<resource-name>META-INF/services/com.sun.xml.ws.spi.db.BindingContextFactory</resource-name>
<resource-name>META-INF/services/javax.xml.bind.JAXBContext</resource-name>
</prefer-application-resources>
</container-descriptor>
This configuration overrides the default Weblogic jaxb provider. This way is
working for me. I hope it could help.
By the way, I am trying to use this configuration but using Spring
(camel-spring). Now I am getting an occasional NullPointerException when
parsing the applicationContext. I am using Camel 2.11 and JDK7.
Does Camel 2.11 support JDK7?
Thanks a lot.
Jose
--
http://camel.465427.n5.nabble.com/Camel-Weblogic-12c-tp5733473p5733515.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Jose
2013-05-31 07:59:30 UTC
Permalink
Hi Christian,

I am using Java 7 update 17.

Thank you.
Preben.Asmussen
2013-05-31 20:31:42 UTC
Permalink
Hi Jose

Seems that Oracle has a distribution of the override ready in wls see
http://docs.oracle.com/cd/E24329_01/web.1211/e24964/data_types.htm#CIHBHDGI

I guess you can add this jar to your war file and set wls to load your
classes and libs first.

<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>

I'm not on wls 12c now - but I can see that when going there I have to
prepare for some plumbing again. Maybe it's time to look for alternatives.
Jose
2013-06-03 10:55:36 UTC
Permalink
Hi Preben,

Thanks for the link.

I have managed to run Camel in Weblogic 12 but without using Spring
following the instructions described in this link:
http://docs.oracle.com/cd/E24329_01/web.1211/e24964/data_types.htm#CIHBHDGI
Loading...