Expand my Community achievements bar.

SOLVED

JMS Client in AEM using Weblogic IntialContext

Avatar

Level 2

Hii,

I am creating a client code to post a message in weblogic queue from AEM.It is working fine in Standalone java main.

However stocked up with class loading issue while loading it from AEM.

These errors are coming while pkg installation import list.

weblogic.descriptor -- Cannot be resolved
weblogic.j2ee.descriptor -- Cannot be resolved
weblogic.jndi.factories.java -- Cannot be resolved
weblogic.jndi.internal -- Cannot be resolved
weblogic.logging from hrdi-integration (473)
weblogic.security.acl.internal -- Cannot be resolved
weblogic.utils.concurrent.atomic -- Cannot be resolved
weblogic.utils.jars -- Cannot be resolved

Please enlighten if anyone has implemented JMS client in AEM.

1 Accepted Solution

Avatar

Correct answer by
Employee

I would assume that these packages are intended to be provided by the container (WebLogic) and not by another bundle. If so, you need to have the OSGi framework export them. This can be done by adjusting the sling.properties file or by deploying a special fragment bundle (which doesn't actually contain any code, just a manifest).

More information on the former approach can be found here: https://sling.apache.org/documentation/configuration.html#osgi-boot-delegation-support

An example of the latter approach can be found here: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/framework-extension-xml

Regards,

Justin

View solution in original post

5 Replies

Avatar

Correct answer by
Employee

I would assume that these packages are intended to be provided by the container (WebLogic) and not by another bundle. If so, you need to have the OSGi framework export them. This can be done by adjusting the sling.properties file or by deploying a special fragment bundle (which doesn't actually contain any code, just a manifest).

More information on the former approach can be found here: https://sling.apache.org/documentation/configuration.html#osgi-boot-delegation-support

An example of the latter approach can be found here: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/framework-extension-xml

Regards,

Justin

Avatar

Level 2

Hi Justin,

 

Thank you for your reply.Please find the steps exactly I am  doing in osgi context and in standalone ,

Standalone JAVA client - I am using three jars- jms-api-1.1-rev-1.jar,wlclient.jar and wljmsclient.jar . Standalone client is working fine with these third party jars .No other transitive dependency .

 

OSGI Context - Created separate osgi bundle which contains jms client code in a servlet   and I am adding  those three third party jars as bundle-class-path in bundleplugin like below .

<Bundle-ClassPath>.,{maven-dependencies},lib/jms-api-1.1-rev-1.jar,lib/wlclient.jar,lib/wljmsclient.jar</Bundle-ClassPath> 

 

All these jars are available in the bundle but still I am getting these errors while bundle activation.

 

Regards,

Patty

Avatar

Level 1

I have faced similar issues for posting the message to Tibco JMS queue. It was working with standalone Java class but it was failing when I was using it in AEM in a bundle.
I managed to resolve the issue -
1. Created a fragment bundle <bundle-core> with all Tibco dependent jars. I embedded those jars in the bundle and exported the classes<Export-Package>.
2. Created a second bundle <bundle-service> with application code to connect to Tiboc server.  Imported  the necessary classes from first bundle <bundle-core>.
3. Used Tibco connection factory object to create the queue connection and session.< Earlier I tried to use JNDI lookup for connection but it failed.>


Hope it might help.

Avatar

Level 10

This means that these Java libs are not part of the AEM OSGi service container. I will see if anyone internally have added these libs to AEM. 

Avatar

Level 2

Hi SmacDonald,

 

Thank you for your reply.Please find the steps exactly I am  doing in osgi context and in standalone ,

Standalone JAVA client - I am using three jars- jms-api-1.1-rev-1.jar,wlclient.jar and wljmsclient.jar . Standalone client is working fine with these third party jars .No other transitive dependency .

 

OSGI Context - Created separate osgi bundle which contains jms client code in a servlet   and I am adding  those three third party jars as bundle-class-path in bundleplugin like below .

<Bundle-ClassPath>.,{maven-dependencies},lib/jms-api-1.1-rev-1.jar,lib/wlclient.jar,lib/wljmsclient.jar</Bundle-ClassPath> 

 

All these jars are available in the bundle but still I am getting these errors while bundle activation.

 

Regards,

Patty