deploying a war with dependencies in bundled jars

classic Classic list List threaded Threaded
39 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

Achim Nierbeck
Hi, 

please re-read my last mail. 
The issue you face isn't because of a wrong import, but the jar you use doesn't export the required packages. 

regards, Achim 
 

2015-01-06 18:42 GMT+01:00 jefoy1101 <[hidden email]>:
MANIFEST.MF <http://karaf.922171.n3.nabble.com/file/n4037636/MANIFEST.MF>

Hi AChim here is my updated MANIFEST

but I'm still getting this ClassNotFoundException eventhough I already have
the jar and the package exported

2015-01-06 11:41:02,402 | ERROR | pool-8-thread-2  | RegisterWebAppVisitorWC
| 91 - org.ops4j.pax.web.pax-web-extender-war - 3.1.2 | Registration
exception. Skipping.
java.lang.ClassNotFoundException:
com.pinsightmedia.adgateway.framework.AdMarvelPerfFilter not found by
com.pinsightmedia.adgateway.framework [158]
        at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
        at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
        at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)[org.apache.felix.framework-4.2.1.jar:]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
        at
org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1844)[org.apache.felix.framework-4.2.1.jar:]
        at
org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937)[org.apache.felix.framework-4.2.1.jar:]
        at
org.ops4j.pax.swissbox.core.BundleClassLoader.findClass(BundleClassLoader.java:176)[84:org.ops4j.pax.web.pax-web-spi:3.1.2]
        at
org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:194)[84:org.ops4j.pax.web.pax-web-spi:3.1.2]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
        at
org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorHS.loadClass(RegisterWebAppVisitorHS.java:244)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.visit(RegisterWebAppVisitorWC.java:261)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:652)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:864)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:317)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[karaf-org.osgi.core.jar:]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:101)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebObserver.deploy(WebObserver.java:213)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebObserver$1.doStart(WebObserver.java:175)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.extender.SimpleExtension.start(SimpleExtension.java:58)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender$1.run(AbstractExtender.java:266)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_21]
        at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_21]
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_21]
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_21]
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_21]
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_21]
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_21]
        at java.lang.Thread.run(Thread.java:722)[:1.7.0_21]



--
View this message in context: http://karaf.922171.n3.nabble.com/deploying-a-war-with-dependencies-in-bundled-jars-tp4037488p4037636.html
Sent from the Karaf - User mailing list archive at Nabble.com.



--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master 

Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

jefoy1101
I've tried to use your servicemix bundle of aws-java-sdk and right now it is pointing to that bundles,

But from what I'm seeing on the stacktrace it is not a problem in my jar file it is a problem in my war file, the class com.pinsightmedia.adgateway.framework.AdMarvelPerfFilter is in my framework.war and when I try to find it using class-find AdMarvelPerfFilter in the karaf prompt it is finding that class

ploy/adgateway-framework-3.0.1-SNAPSHOT-7UL.war
2015-01-06 15:00:22,060 | ERROR | pool-7-thread-1  | RegisterWebAppVisitorWC          | 91 - org.ops4j.pax.web.pax-web-extender-war - 3.1.2 | Registration exception. Skipping.
java.lang.ClassNotFoundException: com.pinsightmedia.adgateway.framework.AdMarvelPerfFilter not found by com.pinsightmedia.adgateway.framework [170]
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)[org.apache.felix.framework-4.2.1.jar:]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
        at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1844)[org.apache.felix.framework-4.2.1.jar:]
        at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937)[org.apache.felix.framework-4.2.1.jar:]
        at org.ops4j.pax.swissbox.core.BundleClassLoader.findClass(BundleClassLoader.java:176)[84:org.ops4j.pax.web.pax-web-spi:3.1.2]
        at org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:194)[84:org.ops4j.pax.web.pax-web-spi:3.1.2]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
        at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorHS.loadClass(RegisterWebAppVisitorHS.java:244)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.visit(RegisterWebAppVisitorWC.java:261)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:652)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf-org.osgi.core.jar:]
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:864)[karaf-org.osgi.core.jar:]
        at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf-org.osgi.core.jar:]
        at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[karaf-org.osgi.core.jar:]
        at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:317)[karaf-org.osgi.core.jar:]
        at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[karaf-org.osgi.core.jar:]
        at org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:101)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.WebObserver.deploy(WebObserver.java:213)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.WebObserver$1.doStart(WebObserver.java:175)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.extender.SimpleExtension.start(SimpleExtension.java:58)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender$1.run(AbstractExtender.java:266)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_21]
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_21]
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_21]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_21]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_21]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_21]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_21]
        at java.lang.Thread.run(Thread.java:722)[:1.7.0_21]
^C

karaf@root()> find-class AdMarvelPerfFilter

Ad Gateway Framework (170)
WEB-INF/classes/com/pinsightmedia/adgateway/framework/AdMarvelPerfFilter.class
karaf@root()>

Sorry I'm a bit confuse, Here is the updated manisfest
MANIFEST.MF
Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

Achim Nierbeck
Hi, 

I went through this thread again. 
Looks like you mixed a couple of different issues here. 
Let me sum these up for you so I can find the root cause. 

1) War isn't capable of importing a certain package
2) Lib isn't capable of finding appropriate package for amazon client -- according to screenshot
3) War isn't capable of finding appropriate framework class


1) this has been fixed by configuring the maven-bundle-plugin correctly
2) this has been fixed by using the servicemix bundle for amazon sdk
3) this one is new 

Now it would be great if you could clear up some things. 
a) the manifest you posted previously is it the one from case 1) the war file or is it one that's supposed to be the library?
b) does your war manifest actually does contain a Import-Package part containing the required package?

regards, Achim 



2015-01-06 22:19 GMT+01:00 jefoy1101 <[hidden email]>:
I've tried to use your servicemix bundle of aws-java-sdk and right now it is
pointing to that bundles,

But from what I'm seeing on the stacktrace it is not a problem in my jar
file it is a problem in my war file, the class
com.pinsightmedia.adgateway.framework.AdMarvelPerfFilter is in my
framework.war and when I try to find it using class-find AdMarvelPerfFilter
in the karaf prompt it is finding that class

ploy/adgateway-framework-3.0.1-SNAPSHOT-7UL.war
2015-01-06 15:00:22,060 | ERROR | pool-7-thread-1  | RegisterWebAppVisitorWC
| 91 - org.ops4j.pax.web.pax-web-extender-war - 3.1.2 | Registration
exception. Skipping.
java.lang.ClassNotFoundException:
com.pinsightmedia.adgateway.framework.AdMarvelPerfFilter not found by
com.pinsightmedia.adgateway.framework [170]
        at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
        at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
        at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)[org.apache.felix.framework-4.2.1.jar:]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
        at
org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1844)[org.apache.felix.framework-4.2.1.jar:]
        at
org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937)[org.apache.felix.framework-4.2.1.jar:]
        at
org.ops4j.pax.swissbox.core.BundleClassLoader.findClass(BundleClassLoader.java:176)[84:org.ops4j.pax.web.pax-web-spi:3.1.2]
        at
org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:194)[84:org.ops4j.pax.web.pax-web-spi:3.1.2]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
        at
org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorHS.loadClass(RegisterWebAppVisitorHS.java:244)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.visit(RegisterWebAppVisitorWC.java:261)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:652)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:864)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:317)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[karaf-org.osgi.core.jar:]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:101)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebObserver.deploy(WebObserver.java:213)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebObserver$1.doStart(WebObserver.java:175)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.extender.SimpleExtension.start(SimpleExtension.java:58)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender$1.run(AbstractExtender.java:266)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_21]
        at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_21]
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_21]
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_21]
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_21]
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_21]
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_21]
        at java.lang.Thread.run(Thread.java:722)[:1.7.0_21]
^C

karaf@root()> find-class AdMarvelPerfFilter

Ad Gateway Framework (170)
WEB-INF/classes/com/pinsightmedia/adgateway/framework/AdMarvelPerfFilter.class
karaf@root()>

Sorry I'm a bit confuse, Here is the updated manisfest
MANIFEST.MF <http://karaf.922171.n3.nabble.com/file/n4037640/MANIFEST.MF>



--
View this message in context: http://karaf.922171.n3.nabble.com/deploying-a-war-with-dependencies-in-bundled-jars-tp4037488p4037640.html
Sent from the Karaf - User mailing list archive at Nabble.com.



--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master 

Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

jefoy1101
In reply to this post by Achim Nierbeck
Hi Achim thank you for summing it up

Now it would be great if you could clear up some things.
a) the manifest you posted previously is it the one from case 1) the war file or is it one that's supposed to be the library?
 > It is the manifest of the war file

b) does your war manifest actually does contain a Import-Package part containing the required package?
> yes it does contain the import package which could be verified in the manifest attached yesterday
Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

jefoy1101
In reply to this post by Achim Nierbeck
Hi Achim thank you for summing it up

Now it would be great if you could clear up some things.
a) the manifest you posted previously is it the one from case 1) the war file or is it one that's supposed to be the library?
 > It is the manifest of the war file

b) does your war manifest actually does contain a Import-Package part containing the required package?
> yes it does contain the import package which could be verified in the manifest attached yesterday

On Wed, Jan 7, 2015 at 1:51 AM, Achim Nierbeck [via Karaf] <[hidden email]> wrote:
Hi, 

I went through this thread again. 
Looks like you mixed a couple of different issues here. 
Let me sum these up for you so I can find the root cause. 

1) War isn't capable of importing a certain package
2) Lib isn't capable of finding appropriate package for amazon client -- according to screenshot
3) War isn't capable of finding appropriate framework class


1) this has been fixed by configuring the maven-bundle-plugin correctly
2) this has been fixed by using the servicemix bundle for amazon sdk
3) this one is new 

Now it would be great if you could clear up some things. 
a) the manifest you posted previously is it the one from case 1) the war file or is it one that's supposed to be the library?
b) does your war manifest actually does contain a Import-Package part containing the required package?

regards, Achim 



2015-01-06 22:19 GMT+01:00 jefoy1101 <[hidden email]>:
I've tried to use your servicemix bundle of aws-java-sdk and right now it is
pointing to that bundles,

But from what I'm seeing on the stacktrace it is not a problem in my jar
file it is a problem in my war file, the class
com.pinsightmedia.adgateway.framework.AdMarvelPerfFilter is in my
framework.war and when I try to find it using class-find AdMarvelPerfFilter
in the karaf prompt it is finding that class

ploy/adgateway-framework-3.0.1-SNAPSHOT-7UL.war
2015-01-06 15:00:22,060 | ERROR | pool-7-thread-1  | RegisterWebAppVisitorWC
| 91 - org.ops4j.pax.web.pax-web-extender-war - 3.1.2 | Registration
exception. Skipping.
java.lang.ClassNotFoundException:
com.pinsightmedia.adgateway.framework.AdMarvelPerfFilter not found by
com.pinsightmedia.adgateway.framework [170]
        at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
        at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
        at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)[org.apache.felix.framework-4.2.1.jar:]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
        at
org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1844)[org.apache.felix.framework-4.2.1.jar:]
        at
org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937)[org.apache.felix.framework-4.2.1.jar:]
        at
org.ops4j.pax.swissbox.core.BundleClassLoader.findClass(BundleClassLoader.java:176)[84:org.ops4j.pax.web.pax-web-spi:3.1.2]
        at
org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:194)[84:org.ops4j.pax.web.pax-web-spi:3.1.2]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
        at
org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorHS.loadClass(RegisterWebAppVisitorHS.java:244)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.visit(RegisterWebAppVisitorWC.java:261)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:652)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:864)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:317)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[karaf-org.osgi.core.jar:]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:101)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebObserver.deploy(WebObserver.java:213)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebObserver$1.doStart(WebObserver.java:175)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.extender.SimpleExtension.start(SimpleExtension.java:58)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender$1.run(AbstractExtender.java:266)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_21]
        at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_21]
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_21]
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_21]
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_21]
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_21]
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_21]
        at java.lang.Thread.run(Thread.java:722)[:1.7.0_21]
^C

karaf@root()> find-class AdMarvelPerfFilter

Ad Gateway Framework (170)
WEB-INF/classes/com/pinsightmedia/adgateway/framework/AdMarvelPerfFilter.class
karaf@root()>

Sorry I'm a bit confuse, Here is the updated manisfest
MANIFEST.MF <http://karaf.922171.n3.nabble.com/file/n4037640/MANIFEST.MF>



--
View this message in context: http://karaf.922171.n3.nabble.com/deploying-a-war-with-dependencies-in-bundled-jars-tp4037488p4037640.html
Sent from the Karaf - User mailing list archive at Nabble.com.



--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master 




If you reply to this email, your message will be added to the discussion below:
http://karaf.922171.n3.nabble.com/deploying-a-war-with-dependencies-in-bundled-jars-tp4037488p4037650.html
To unsubscribe from deploying a war with dependencies in bundled jars, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

Achim Nierbeck
Hi, 

ok, so that rather lengthy manifest is the one from the war :-)

Bundle-ClassPath: .,adgateway-client-7UL-3.0.1-SNAPSHOT.jar,adgateway-
 provider-3.0.1-SNAPSHOT.jar,adgateway-domain-3.0.1-SNAPSHOT.jar

this part worries me ...

first of all usually it's bad style for a WAB to have the "." as part of the classpath, it's default for standard bundles, but shouldn't be used in WABs. 
second, and I guess that's the issue, you are missing the WEB-INF/classes part. 
That's usually the place where your classes reside in a WAR/WAB.
Especially since your wab exports those classes I guess this is it. 

Now one more question, are you sure you need to export those from the WAB?

regards, Achim 


2015-01-07 15:50 GMT+01:00 jefoy1101 <[hidden email]>:
Hi Achim thank you for summing it up

Now it would be great if you could clear up some things.
a) the manifest you posted previously is it the one from case 1) the war
file or is it one that's supposed to be the library?
* > It is the manifest of the war file *

b) does your war manifest actually does contain a Import-Package part
containing the required package?
*> yes it does contain the import package which could be verified in the
manifest attached yesterday*

On Wed, Jan 7, 2015 at 1:51 AM, Achim Nierbeck [via Karaf] <
[hidden email]> wrote:

> Hi,
>
> I went through this thread again.
> Looks like you mixed a couple of different issues here.
> Let me sum these up for you so I can find the root cause.
>
> 1) War isn't capable of importing a certain package
> 2) Lib isn't capable of finding appropriate package for amazon client --
> according to screenshot
> 3) War isn't capable of finding appropriate framework class
>
>
> 1) this has been fixed by configuring the maven-bundle-plugin correctly
> 2) this has been fixed by using the servicemix bundle for amazon sdk
> 3) this one is new
>
> Now it would be great if you could clear up some things.
> a) the manifest you posted previously is it the one from case 1) the war
> file or is it one that's supposed to be the library?
> b) does your war manifest actually does contain a Import-Package part
> containing the required package?
>
> regards, Achim
>
>
>
> 2015-01-06 22:19 GMT+01:00 jefoy1101 <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=4037650&i=0>>:
>
>> I've tried to use your servicemix bundle of aws-java-sdk and right now it
>> is
>> pointing to that bundles,
>>
>> But from what I'm seeing on the stacktrace it is not a problem in my jar
>> file it is a problem in my war file, the class
>> com.pinsightmedia.adgateway.framework.AdMarvelPerfFilter is in my
>> framework.war and when I try to find it using class-find
>> AdMarvelPerfFilter
>> in the karaf prompt it is finding that class
>>
>> ploy/adgateway-framework-3.0.1-SNAPSHOT-7UL.war
>> 2015-01-06 15:00:22,060 | ERROR | pool-7-thread-1  |
>> RegisterWebAppVisitorWC
>> | 91 - org.ops4j.pax.web.pax-web-extender-war - 3.1.2 | Registration
>> exception. Skipping.
>> java.lang.ClassNotFoundException:
>> com.pinsightmedia.adgateway.framework.AdMarvelPerfFilter not found by
>> com.pinsightmedia.adgateway.framework [170]
>>         at
>>
>> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
>>         at
>>
>> org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
>>         at
>>
>> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)[org.apache.felix.framework-4.2.1.jar:]
>>         at
>> java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
>>         at
>>
>> org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1844)[org.apache.felix.framework-4.2.1.jar:]
>>         at
>>
>> org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937)[org.apache.felix.framework-4.2.1.jar:]
>>         at
>>
>> org.ops4j.pax.swissbox.core.BundleClassLoader.findClass(BundleClassLoader.java:176)[84:org.ops4j.pax.web.pax-web-spi:3.1.2]
>>         at
>>
>> org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:194)[84:org.ops4j.pax.web.pax-web-spi:3.1.2]
>>         at
>> java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
>>         at
>>
>> org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorHS.loadClass(RegisterWebAppVisitorHS.java:244)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
>>         at
>>
>> org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.visit(RegisterWebAppVisitorWC.java:261)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
>>         at
>>
>> org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:652)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
>>         at
>>
>> org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
>>         at
>>
>> org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
>>         at
>>
>> org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
>>         at
>>
>> org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf-org.osgi.core.jar:]
>>         at
>>
>> org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:864)[karaf-org.osgi.core.jar:]
>>         at
>>
>> org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf-org.osgi.core.jar:]
>>         at
>>
>> org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[karaf-org.osgi.core.jar:]
>>         at
>>
>> org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:317)[karaf-org.osgi.core.jar:]
>>         at
>>
>> org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[karaf-org.osgi.core.jar:]
>>         at
>>
>> org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:101)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
>>         at
>>
>> org.ops4j.pax.web.extender.war.internal.WebObserver.deploy(WebObserver.java:213)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
>>         at
>>
>> org.ops4j.pax.web.extender.war.internal.WebObserver$1.doStart(WebObserver.java:175)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
>>         at
>>
>> org.ops4j.pax.web.extender.war.internal.extender.SimpleExtension.start(SimpleExtension.java:58)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
>>         at
>>
>> org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender$1.run(AbstractExtender.java:266)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
>>         at
>>
>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_21]
>>         at
>>
>> java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_21]
>>         at
>> java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_21]
>>         at
>>
>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_21]
>>         at
>>
>> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_21]
>>         at
>>
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_21]
>>         at
>>
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_21]
>>         at java.lang.Thread.run(Thread.java:722)[:1.7.0_21]
>> ^C
>>
>> karaf@root()> find-class AdMarvelPerfFilter
>>
>> Ad Gateway Framework (170)
>>
>> WEB-INF/classes/com/pinsightmedia/adgateway/framework/AdMarvelPerfFilter.class
>> karaf@root()>
>>
>> Sorry I'm a bit confuse, Here is the updated manisfest
>> MANIFEST.MF <http://karaf.922171.n3.nabble.com/file/n4037640/MANIFEST.MF>
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/deploying-a-war-with-dependencies-in-bundled-jars-tp4037488p4037640.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>
>
>
> --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> Project Lead
> blog <http://notizblog.nierbeck.de/>
> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
>
> Software Architect / Project Manager / Scrum Master
>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://karaf.922171.n3.nabble.com/deploying-a-war-with-dependencies-in-bundled-jars-tp4037488p4037650.html
>  To unsubscribe from deploying a war with dependencies in bundled jars, click
> here
> < > .
> NAML
> <
http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://karaf.922171.n3.nabble.com/deploying-a-war-with-dependencies-in-bundled-jars-tp4037488p4037664.html
Sent from the Karaf - User mailing list archive at Nabble.com.



--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master 

Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

jefoy1101
The .(dot) on that manifest was generated by the maven bundle

<plugin>
                                <groupId>org.apache.felix</groupId>
                                <artifactId>maven-bundle-plugin</artifactId>
                                <extensions>true</extensions>
                                <configuration>
                                        <supportedProjectTypes>
                                                <supportedProjectType>jar</supportedProjectType>
                                                <supportedProjectType>bundle</supportedProjectType>
                                                <supportedProjectType>war</supportedProjectType>
                                        </supportedProjectTypes>
                                        <instructions>
                                                <Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
                                                <Bundle-Version>${project.version}</Bundle-Version>
                                                <Import-Package>
                                                        com.pinsightmedia.adgateway.framework.*,
                            com.pinsightmedia.adgateway.client.*,
                            com.pinsightmedia.adgateway.dsp.*,
                            com.pinsightmedia.adgateway.domain.*,
                            org.apache.servicemix.bundles.aws-java-sdk.*,,
                            *;
                                                        resolution:=optional
                                                </Import-Package>
                                                <Export-Package>
                                                com.pinsightmedia.adgateway.framework.*,
                        com.pinsightmedia.adgateway.client.*,
                        com.pinsightmedia.adgateway.dsp.*,
                        com.pinsightmedia.adgateway.domain.*,
                                                org.apache.servicemix.bundles.aws-java-sdk.*,
                                                !*
                                                </Export-Package>
                                                <Bundle-Classpath>
                                                        WEB-INF/classes
                                                </Bundle-Classpath>
                                                <Web-ContextPath>agwar</Web-ContextPath>
                                                <Embed-Dependency>
                                                  com.pinsightmedia.adgateway.framework.*,
                                                  com.pinsightmedia.adgateway.client.*,
                                                  com.pinsightmedia.adgateway.dsp.*,
                                                  com.pinsightmedia.adgateway.domain.*,
                                                  adgateway-client-7UL,
                                                  adgateway-provider,
                                                  adgateway-domain,
                                                  org.apache.servicemix.bundles.aws-java-sdk
                                                  </Embed-Dependency>
                                                <Embed-Transitive>true</Embed-Transitive>
                                                <_removeheaders>
                                                        Include-Resource,
                                                        Private-Package,
                                                        Embed-Dependency,
                                                        Embed-Transitive,
                                                        Ignore-Package
                                                </_removeheaders>
                                        </instructions>
                                </configuration>
                                <executions>
                                        <execution>
                                                <id>generate-manifest</id>
                                                <phase>process-classes</phase>
                                                <goals>
                                                        <goal>manifest</goal>
                                                </goals>
                                        </execution>
                                </executions>
                        </plugin>
                        <plugin>
                                <artifactId>maven-war-plugin</artifactId>
                                <configuration>
                                        <archive>
                                                <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
                                        </archive>
                                </configuration>
                        </plugin>


Second I already have the WEB-INF/classes  since the start of this thread,

also I did not bundle it as  WAB i just copy and paste my war to the deploy folder of Karaf 3.0.3

What I'm confuse about is that the classname that is not found is in the war file and if I try to find-class in Karaf prompt> it is there, and if you looked at the MANIFEST file I am seeing the packages was imported

Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

jefoy1101
I tried to get the war-spring install on my local machine , but im getting the same issue

015-01-07 12:47:01,535 | INFO  | raf-3.0.2/deploy | fileinstall                      | 7 - org.apache.felix.fileinstall - 3.4.2 | Started bundle: file:/mss-root/mss/apache-karaf-3.0.2/deploy/war-spring.war
2015-01-07 12:47:01,544 | WARN  | pool-7-thread-1  | AbstractLifeCycle                | 77 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.15.v20140411 | FAILED helloworld: java.lang.NoClassDefFoundError: org/springframework/web/context/WebApplicationContext
java.lang.NoClassDefFoundError: org/springframework/web/context/WebApplicationContext
        at java.lang.Class.getDeclaredConstructors0(Native Method)[:1.7.0_21]
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2413)[:1.7.0_21]
        at java.lang.Class.getConstructor0(Class.java:2723)[:1.7.0_21]
        at java.lang.Class.newInstance0(Class.java:345)[:1.7.0_21]
        at java.lang.Class.newInstance(Class.java:327)[:1.7.0_21]
        at org.eclipse.jetty.servlet.ServletContextHandler$Context.createServlet(ServletContextHandler.java:1075)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at org.eclipse.jetty.servlet.ServletHolder.newInstance(ServletHolder.java:957)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:514)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:344)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doStart(HttpServiceContext.java:222)[86:org.ops4j.pax.web.pax-web-jetty:3.1.2]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:202)[86:org.ops4j.pax.web.pax-web-jetty:3.1.2]
        at org.ops4j.pax.web.service.internal.HttpServiceStarted.end(HttpServiceStarted.java:1032)[85:org.ops4j.pax.web.pax-web-runtime:3.1.2]
        at org.ops4j.pax.web.service.internal.HttpServiceProxy.end(HttpServiceProxy.java:422)[85:org.ops4j.pax.web.pax-web-runtime:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.end(RegisterWebAppVisitorWC.java:341)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:678)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf-org.osgi.core.jar:]
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:864)[karaf-org.osgi.core.jar:]
        at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf-org.osgi.core.jar:]
        at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[karaf-org.osgi.core.jar:]
        at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:317)[karaf-org.osgi.core.jar:]
        at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[karaf-org.osgi.core.jar:]
        at org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:101)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.WebObserver.deploy(WebObserver.java:213)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.WebObserver$1.doStart(WebObserver.java:175)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.extender.SimpleExtension.start(SimpleExtension.java:58)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender$1.run(AbstractExtender.java:266)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_21]
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_21]
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_21]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_21]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_21]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_21]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_21]
        at java.lang.Thread.run(Thread.java:722)[:1.7.0_21]
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.WebApplicationContext not found by spring-webmvc [212]
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
        ... 42 more
2015-01-07 12:47:01,546 | WARN  | pool-7-thread-1  | AbstractLifeCycle                | 77 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.15.v20140411 | FAILED HttpServiceContext{httpContext=WebAppHttpContext{org.ops4j.pax.web.samples.spring - 213}}: java.lang.NoClassDefFoundError: org/springframework/web/context/WebApplicationContext
java.lang.NoClassDefFoundError: org/springframework/web/context/WebApplicationContext
        at java.lang.Class.getDeclaredConstructors0(Native Method)[:1.7.0_21]
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2413)[:1.7.0_21]
        at java.lang.Class.getConstructor0(Class.java:2723)[:1.7.0_21]
        at java.lang.Class.newInstance0(Class.java:345)[:1.7.0_21]
        at java.lang.Class.newInstance(Class.java:327)[:1.7.0_21]
        at org.eclipse.jetty.servlet.ServletContextHandler$Context.createServlet(ServletContextHandler.java:1075)
        at org.eclipse.jetty.servlet.ServletHolder.newInstance(ServletHolder.java:957)
        at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:514)
        at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:344)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791)
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doStart(HttpServiceContext.java:222)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:202)[86:org.ops4j.pax.web.pax-web-jetty:3.1.2]
        at org.ops4j.pax.web.service.internal.HttpServiceStarted.end(HttpServiceStarted.java:1032)[85:org.ops4j.pax.web.pax-web-runtime:3.1.2]
        at org.ops4j.pax.web.service.internal.HttpServiceProxy.end(HttpServiceProxy.java:422)[85:org.ops4j.pax.web.pax-web-runtime:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.end(RegisterWebAppVisitorWC.java:341)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:678)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf-org.osgi.core.jar:]
        at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:864)[karaf-org.osgi.core.jar:]
        at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf-org.osgi.core.jar:]
        at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[karaf-org.osgi.core.jar:]
        at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:317)[karaf-org.osgi.core.jar:]
        at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[karaf-org.osgi.core.jar:]
        at org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:101)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.WebObserver.deploy(WebObserver.java:213)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.WebObserver$1.doStart(WebObserver.java:175)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.extender.SimpleExtension.start(SimpleExtension.java:58)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender$1.run(AbstractExtender.java:266)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_21]
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_21]
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_21]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_21]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_21]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_21]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_21]
        at java.lang.Thread.run(Thread.java:722)[:1.7.0_21]
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.WebApplicationContext not found by spring-webmvc [212]
        at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
        at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
        at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
        ... 42 more
^C

karaf@root()> find-class WebApplicationContext

spring-osgi-web (211)
org/springframework/osgi/web/context/support/OsgiBundleXmlWebApplicationContext.class

OPS4J Pax Web - Samples - Spring OSGi (213)
org/springframework/osgi/web/context/support/OsgiBundleXmlWebApplicationContext.class
karaf@root()>


It's like it is looking for the class but It cannot find the class even though it's there, is this something related with class loader?
Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

Achim Nierbeck
Please take a look at the required bundles for the spring-osgi showcase of Pax-Web [1]. 

regards, Achim 


2015-01-07 19:47 GMT+01:00 jefoy1101 <[hidden email]>:
I tried to get the war-spring install on my local machine , but im getting
the same issue

015-01-07 12:47:01,535 | INFO  | raf-3.0.2/deploy | fileinstall
| 7 - org.apache.felix.fileinstall - 3.4.2 | Started bundle:
file:/mss-root/mss/apache-karaf-3.0.2/deploy/war-spring.war
2015-01-07 12:47:01,544 | WARN  | pool-7-thread-1  | AbstractLifeCycle
| 77 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.15.v20140411 |
FAILED helloworld: java.lang.NoClassDefFoundError:
org/springframework/web/context/WebApplicationContext
java.lang.NoClassDefFoundError:
org/springframework/web/context/WebApplicationContext
        at java.lang.Class.getDeclaredConstructors0(Native Method)[:1.7.0_21]
        at
java.lang.Class.privateGetDeclaredConstructors(Class.java:2413)[:1.7.0_21]
        at java.lang.Class.getConstructor0(Class.java:2723)[:1.7.0_21]
        at java.lang.Class.newInstance0(Class.java:345)[:1.7.0_21]
        at java.lang.Class.newInstance(Class.java:327)[:1.7.0_21]
        at
org.eclipse.jetty.servlet.ServletContextHandler$Context.createServlet(ServletContextHandler.java:1075)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at
org.eclipse.jetty.servlet.ServletHolder.newInstance(ServletHolder.java:957)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at
org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:514)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at
org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:344)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at
org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at
org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doStart(HttpServiceContext.java:222)[86:org.ops4j.pax.web.pax-web-jetty:3.1.2]
        at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at
org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:202)[86:org.ops4j.pax.web.pax-web-jetty:3.1.2]
        at
org.ops4j.pax.web.service.internal.HttpServiceStarted.end(HttpServiceStarted.java:1032)[85:org.ops4j.pax.web.pax-web-runtime:3.1.2]
        at
org.ops4j.pax.web.service.internal.HttpServiceProxy.end(HttpServiceProxy.java:422)[85:org.ops4j.pax.web.pax-web-runtime:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.end(RegisterWebAppVisitorWC.java:341)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:678)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:864)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:317)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[karaf-org.osgi.core.jar:]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:101)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebObserver.deploy(WebObserver.java:213)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebObserver$1.doStart(WebObserver.java:175)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.extender.SimpleExtension.start(SimpleExtension.java:58)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender$1.run(AbstractExtender.java:266)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_21]
        at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_21]
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_21]
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_21]
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_21]
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_21]
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_21]
        at java.lang.Thread.run(Thread.java:722)[:1.7.0_21]
Caused by: java.lang.ClassNotFoundException:
org.springframework.web.context.WebApplicationContext not found by
spring-webmvc [212]
        at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
        at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
        at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
        ... 42 more
2015-01-07 12:47:01,546 | WARN  | pool-7-thread-1  | AbstractLifeCycle
| 77 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.15.v20140411 |
FAILED
HttpServiceContext{httpContext=WebAppHttpContext{org.ops4j.pax.web.samples.spring
- 213}}: java.lang.NoClassDefFoundError:
org/springframework/web/context/WebApplicationContext
java.lang.NoClassDefFoundError:
org/springframework/web/context/WebApplicationContext
        at java.lang.Class.getDeclaredConstructors0(Native Method)[:1.7.0_21]
        at
java.lang.Class.privateGetDeclaredConstructors(Class.java:2413)[:1.7.0_21]
        at java.lang.Class.getConstructor0(Class.java:2723)[:1.7.0_21]
        at java.lang.Class.newInstance0(Class.java:345)[:1.7.0_21]
        at java.lang.Class.newInstance(Class.java:327)[:1.7.0_21]
        at
org.eclipse.jetty.servlet.ServletContextHandler$Context.createServlet(ServletContextHandler.java:1075)
        at
org.eclipse.jetty.servlet.ServletHolder.newInstance(ServletHolder.java:957)
        at
org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:514)
        at org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:344)
        at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at
org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:791)
        at
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
        at
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
        at
org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doStart(HttpServiceContext.java:222)
        at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[77:org.eclipse.jetty.aggregate.jetty-all-server:8.1.15.v20140411]
        at
org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:202)[86:org.ops4j.pax.web.pax-web-jetty:3.1.2]
        at
org.ops4j.pax.web.service.internal.HttpServiceStarted.end(HttpServiceStarted.java:1032)[85:org.ops4j.pax.web.pax-web-runtime:3.1.2]
        at
org.ops4j.pax.web.service.internal.HttpServiceProxy.end(HttpServiceProxy.java:422)[85:org.ops4j.pax.web.pax-web-runtime:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.end(RegisterWebAppVisitorWC.java:341)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:678)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:932)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:864)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:317)[karaf-org.osgi.core.jar:]
        at
org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[karaf-org.osgi.core.jar:]
        at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:101)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebObserver.deploy(WebObserver.java:213)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.WebObserver$1.doStart(WebObserver.java:175)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.extender.SimpleExtension.start(SimpleExtension.java:58)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
org.ops4j.pax.web.extender.war.internal.extender.AbstractExtender$1.run(AbstractExtender.java:266)[91:org.ops4j.pax.web.pax-web-extender-war:3.1.2]
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_21]
        at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.7.0_21]
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.7.0_21]
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_21]
        at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_21]
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_21]
        at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_21]
        at java.lang.Thread.run(Thread.java:722)[:1.7.0_21]
Caused by: java.lang.ClassNotFoundException:
org.springframework.web.context.WebApplicationContext not found by
spring-webmvc [212]
        at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
        at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
        at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:356)[:1.7.0_21]
        ... 42 more
^C

karaf@root()> find-class WebApplicationContext

spring-osgi-web (211)
org/springframework/osgi/web/context/support/OsgiBundleXmlWebApplicationContext.class

OPS4J Pax Web - Samples - Spring OSGi (213)
org/springframework/osgi/web/context/support/OsgiBundleXmlWebApplicationContext.class
karaf@root()>


It's like it is looking for the class but It cannot find the class even
though it's there, is this something related with class loader?




--
View this message in context: http://karaf.922171.n3.nabble.com/deploying-a-war-with-dependencies-in-bundled-jars-tp4037488p4037667.html
Sent from the Karaf - User mailing list archive at Nabble.com.



--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master 

Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

jefoy1101
This post was updated on .
Hi Achim, Still getting some issue on the sample, Anyway I just notice on my project that im working on

If I have this instruction below im losing some of the dependency like the com.fasterxml.jackson.databind

<instructions>
                                                <Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
                                                <Bundle-Version>${project.version}</Bundle-Version>
                                                <Import-Package>
                                                        com.pinsightmedia.adgateway.framework.*,
                            com.pinsightmedia.adgateway.client.*,
                            com.pinsightmedia.adgateway.dsp.*,
                            com.pinsightmedia.adgateway.domain.*,
                            org.apache.servicemix.bundles.aws-java-sdk.*,
                            *;
                                                        resolution:=optional
                                                </Import-Package>
                                                <Export-Package>
                                                !*
                                                </Export-Package>
                                                <Bundle-Classpath>
                                                        WEB-INF/classes
                                                </Bundle-Classpath>
                                                <Web-ContextPath>agwar</Web-ContextPath>
                                                <Embed-Dependency>
                                                  com.pinsightmedia.adgateway.framework.*,
                                                  com.pinsightmedia.adgateway.client.*,
                                                  com.pinsightmedia.adgateway.dsp.*,
                                                  com.pinsightmedia.adgateway.domain.*,
                                                  org.apache.servicemix.bundles.aws-java-sdk
                                                  </Embed-Dependency>
                                                <Embed-Transitive>true</Embed-Transitive>                                               
                                        </instructions>

but If I added this  adgateway-domain one line on my Embed-Dependency it changes alot, like the Bundle-ClassPath, added some jar classes like com.fasterxml.jackson.databind added Embedded Artifacts in the Manifest Headers etc

<Embed-Dependency>
                                                  com.pinsightmedia.adgateway.framework.*,
                                                  com.pinsightmedia.adgateway.client.*,
                                                  com.pinsightmedia.adgateway.dsp.*,
                                                  com.pinsightmedia.adgateway.domain.*,
                                                  adgateway-domain,
                                                  org.apache.servicemix.bundles.aws-java-sdk
                                                  </Embed-Dependency>



If I Understand correctly the explanation here on Bundle-ClassPath and IMport package

I could just put my war file in the deploy folder, and have the 3 jars in the Bundle-Classpath ( where the 3 jars has been auto-wrap bundle) I should be good to go, or If I want it mo standalone on my war I could just import those necessary packages and remove the bundle class path to WEB-INF/classes I should also be good right?

But this is not happening on my current project :(

all I want is to create my war standalone and get my dependencies thru (auto-wrap bundles the one inside my ag_lib folder that contains my 1.jar, 2.jar, 3.jar)

Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

Achim Nierbeck
Hi,

sorry, now you've lost me. 
Could you provide a small sample project on github with your intention, so I can actually take a look at the sources. 
The only thing I got so far is, that you want to deploy non-osgi-bundles and wars and expect those to magically have all issues
resolved concerning package import/exports. If that's the quintessence of your trying, than I've got to tell you that will not work. 

regards, Achim 
 

2015-01-08 5:22 GMT+01:00 jefoy1101 <[hidden email]>:
Hi Achim, Still getting some issue on the sample, Anyway I just notice on my
project that im working on

If I have this instruction below im losing some of the dependency like the
com.fasterxml.jackson.databind

<instructions>
                                                <Bundle-SymbolicName>${bundle.symbolicName}</Bundle-SymbolicName>
                                                <Bundle-Version>${project.version}</Bundle-Version>
                                                <Import-Package>
                                                        com.pinsightmedia.adgateway.framework.*,
                            com.pinsightmedia.adgateway.client.*,
                            com.pinsightmedia.adgateway.dsp.*,
                            com.pinsightmedia.adgateway.domain.*,
                            org.apache.servicemix.bundles.aws-java-sdk.*,
                            *;
                                                        resolution:=optional
                                                </Import-Package>
                                                <Export-Package>
                                                !*
                                                </Export-Package>
                                                <Bundle-Classpath>
                                                        WEB-INF/classes
                                                </Bundle-Classpath>
                                                <Web-ContextPath>agwar</Web-ContextPath>
                                                <Embed-Dependency>
                                                  com.pinsightmedia.adgateway.framework.*,
                                                  com.pinsightmedia.adgateway.client.*,
                                                  com.pinsightmedia.adgateway.dsp.*,
                                                  com.pinsightmedia.adgateway.domain.*,
                                                  org.apache.servicemix.bundles.aws-java-sdk
                                                  </Embed-Dependency>
                                                <Embed-Transitive>true</Embed-Transitive>
                                        </instructions>

but If I added this  adgateway-domain one line on my Embed-Dependency it
changes alot, like the Bundle-ClassPath, added some jar classes like
com.fasterxml.jackson.databind added Embedded Artifacts in the Manifest
Headers etc

<Embed-Dependency>
                                                  com.pinsightmedia.adgateway.framework.*,
                                                  com.pinsightmedia.adgateway.client.*,
                                                  com.pinsightmedia.adgateway.dsp.*,
                                                  com.pinsightmedia.adgateway.domain.*,
                                                  adgateway-domain,
                                                  org.apache.servicemix.bundles.aws-java-sdk
                                                  </Embed-Dependency>



If I Understand correctly the explanation here on Bundle-ClassPath and
IMport package

I could just put my war file in the deploy folder, and have the 3 jars in
the Bundle-Classpath ( where the 3 jars has been auto-wrap bundle) I should
be good to go, or If I want it mo standalone on my war I could just import
those necessary packages and remove the bundle class path to WEB-INF/classes
I should also be good right?

But this is not happening on my current project :(

all I want is to create my war standalone and get my dependencies thru
(auto-wrap bundles the one inside my ag_lib folder that contains my 1.jar,
2.jar, 3.jar)





--
View this message in context: http://karaf.922171.n3.nabble.com/deploying-a-war-with-dependencies-in-bundled-jars-tp4037488p4037672.html
Sent from the Karaf - User mailing list archive at Nabble.com.



--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master 

Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

jefoy1101
This post was updated on .
HI Achim here is the sample project

From the sample project it's the helloworld servlet that I have instantiated the singleton from my provider.jar that call another function inside the domain.jar, there is also a call for hello(String name) inside it.

Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

Achim Nierbeck
Hi, 

ok, so far so good, the wab looks fine, but your provider and domain jars aren't osgi bundles. 
You should make sure those are OSGi bundles first.
On the other hand you seem to have a high coupling with those two jars, why don't you just embed those then?
Especially since you don't use any services I guess the best would be to start with one "uber" bundle first. 
After that start extracting your services for reuse. Always make sure to have low coupling between bundles and high cohesion inside your bundles. 

regards, Achim 


2015-01-10 19:50 GMT+01:00 jefoy1101 <[hidden email]>:
HI Achim here is the sample project

From the sample project it's the helloworld servlet that I have instantiated
the singleton from my provider.jar that call another function inside the
domain.jar, there is also a call for hello(String name) inside it.

sample war with external jar implementation
<https://github.com/jj110178/agkaraf>
provider.jar
<http://karaf.922171.n3.nabble.com/file/n4037741/adgateway-provider-3.jar>
domain.jar
<http://karaf.922171.n3.nabble.com/file/n4037741/adgateway-domain-3.jar>




--
View this message in context: http://karaf.922171.n3.nabble.com/deploying-a-war-with-dependencies-in-bundled-jars-tp4037488p4037741.html
Sent from the Karaf - User mailing list archive at Nabble.com.



--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master 

Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

jefoy1101
Hi Achim,

I made the provider jar to be an OSGI bundle by changing the pom and have the maven bundle plugin, build and deploy to ag_lib, same with domain

I'm seeing that I am able to call the my function in the provider.jar and domain.jar from the logs below, but having this issue on instantiating the AmazonS3Client

2015-01-12 09:47:57,401 | INFO  | FelixStartLevel  | HttpServiceFactoryImpl           | 99 - org.ops4j.pax.web.pax-web-runtime - 3.1.2 | Binding bundle: [org.ops4j.pax.web.servlet3.samples.war [199]] to http service
2015-01-12 09:47:57,438 | INFO  | pool-7-thread-1  | S3Properties                     | 220 - adgateway-provider - 3.0.1.SNAPSHOT | Loading file from S3: admarvel-web.properties
2015-01-12 09:47:57,476 | WARN  | pool-7-thread-1  | AbstractLifeCycle                | 91 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.15.v20140411 | FAILED helloWorld: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
        at com.amazonaws.util.VersionInfoUtils.userAgent(VersionInfoUtils.java:139)
        at com.amazonaws.util.VersionInfoUtils.initializeUserAgent(VersionInfoUtils.java:134)
        at com.amazonaws.util.VersionInfoUtils.getUserAgent(VersionInfoUtils.java:95)
        at com.amazonaws.ClientConfiguration.<clinit>(ClientConfiguration.java:42)[124:org.apache.servicemix.bundles.aws-java-sdk:1.9.8.1]
        at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:379)[124:org.apache.servicemix.bundles.aws-java-sdk:1.9.8.1]
        at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:318)[124:org.apache.servicemix.bundles.aws-java-sdk:1.9.8.1]
        at com.pinsightmedia.adgateway.util.S3Properties.load(S3Properties.java:53)
        at com.pinsightmedia.adgateway.dsp.admarvel.AdMarvelProperties.load(AdMarvelProperties.java:53)[220:adgateway-provider:3.0.1.SNAPSHOT]
        at com.pinsightmedia.adgateway.dsp.admarvel.AdMarvelProperties.<clinit>(AdMarvelProperties.java:29)[220:adgateway-provider:3.0.1.SNAPSHOT]
        at org.ops4j.web.samples.helloworld.servlet3.internal.HelloWorld.<clinit>(HelloWorld.java:29)[199:org.ops4j.pax.web.servlet3.samples.war:4.1.0.SNAPSHOT]

Caused by: java.lang.IllegalArgumentException
        at com.amazonaws.internal.config.InternalConfig.loadfrom(InternalConfig.java:231)[124:org.apache.servicemix.bundles.aws-java-sdk:1.9.8.1]
        at com.amazonaws.internal.config.InternalConfig.load(InternalConfig.java:249)[124:org.apache.servicemix.bundles.aws-java-sdk:1.9.8.1]
        at com.amazonaws.internal.config.InternalConfig$Factory.<clinit>(InternalConfig.java:284)[124:org.apache.servicemix.bundles.aws-java-sdk:1.9.8.1]
        ... 53 more
Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

Achim Nierbeck
Hi, 

looks like you got some sort of IllegalArgument there :-)

Caused by: java.lang.IllegalArgumentException

At this point I think it's a application issue, not an osgi resolving issue. 

regards, Achim 
 

2015-01-12 17:20 GMT+01:00 jefoy1101 <[hidden email]>:
Hi Achim,

I made the provider jar to be an OSGI bundle by changing the pom and have
the maven bundle plugin, build and deploy to ag_lib, same with domain

I'm seeing that I am able to call the my function in the provider.jar and
domain.jar from the logs below, but having this issue on instantiating the
AmazonS3Client

2015-01-12 09:47:57,401 | INFO  | FelixStartLevel  | HttpServiceFactoryImpl
| 99 - org.ops4j.pax.web.pax-web-runtime - 3.1.2 | Binding bundle:
[org.ops4j.pax.web.servlet3.samples.war [199]] to http service
2015-01-12 09:47:57,438 | INFO  | pool-7-thread-1  | S3Properties
| 220 - adgateway-provider - 3.0.1.SNAPSHOT | Loading file from S3:
admarvel-web.properties
2015-01-12 09:47:57,476 | WARN  | pool-7-thread-1  | AbstractLifeCycle
| 91 - org.eclipse.jetty.aggregate.jetty-all-server - 8.1.15.v20140411 |
FAILED helloWorld: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
        at com.amazonaws.util.VersionInfoUtils.userAgent(VersionInfoUtils.java:139)
        at
com.amazonaws.util.VersionInfoUtils.initializeUserAgent(VersionInfoUtils.java:134)
        at
com.amazonaws.util.VersionInfoUtils.getUserAgent(VersionInfoUtils.java:95)
        at
com.amazonaws.ClientConfiguration.<clinit>(ClientConfiguration.java:42)[124:org.apache.servicemix.bundles.aws-java-sdk:1.9.8.1]
        at
com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:379)[124:org.apache.servicemix.bundles.aws-java-sdk:1.9.8.1]
        at
com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:318)[124:org.apache.servicemix.bundles.aws-java-sdk:1.9.8.1]
        at com.pinsightmedia.adgateway.util.S3Properties.load(S3Properties.java:53)
        at
com.pinsightmedia.adgateway.dsp.admarvel.AdMarvelProperties.load(AdMarvelProperties.java:53)[220:adgateway-provider:3.0.1.SNAPSHOT]
        at
com.pinsightmedia.adgateway.dsp.admarvel.AdMarvelProperties.<clinit>(AdMarvelProperties.java:29)[220:adgateway-provider:3.0.1.SNAPSHOT]
        at
org.ops4j.web.samples.helloworld.servlet3.internal.HelloWorld.<clinit>(HelloWorld.java:29)[199:org.ops4j.pax.web.servlet3.samples.war:4.1.0.SNAPSHOT]

Caused by: java.lang.IllegalArgumentException
        at
com.amazonaws.internal.config.InternalConfig.loadfrom(InternalConfig.java:231)[124:org.apache.servicemix.bundles.aws-java-sdk:1.9.8.1]
        at
com.amazonaws.internal.config.InternalConfig.load(InternalConfig.java:249)[124:org.apache.servicemix.bundles.aws-java-sdk:1.9.8.1]
        at
com.amazonaws.internal.config.InternalConfig$Factory.<clinit>(InternalConfig.java:284)[124:org.apache.servicemix.bundles.aws-java-sdk:1.9.8.1]
        ... 53 more



--
View this message in context: http://karaf.922171.n3.nabble.com/deploying-a-war-with-dependencies-in-bundled-jars-tp4037488p4037758.html
Sent from the Karaf - User mailing list archive at Nabble.com.



--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master 

Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

jefoy1101
This post was updated on .
I tried to research and look thoroughly on that exception, I thought it was really an exception on my code but, I tried to removed the mvn bundle plugin config on my pom.xml and put my two classes that invokes the function in reading I/O in Amazon S3 and it worked like a charm, so I don't think it's an exception to the code or to the AmazonS3Client initialization, I think it a jar conflict between something and the amazonaws,

And here is one more thing that I tried, With Maven Bundle Plugin commenting out the

// AmazonS3Client s3CLient = new AmazonS3Client();

and call my function hello(String) inside provider.jar it worked perfect,

so my config from my war to my external jar is working without the AmazonS3

But if I removed the Maven Bundle Plugin on my pom.xml and test reading I/O in S3 inside my HelloWorld servlet it is working perfect as well.

Do you still think its an application issue?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

jefoy1101
I've commit my sample code on the github

I have the sample function in the servlet and I have the maven bundle plugin inside the pom.xml

once you deploy it it will give you exactly the same Exception which is IllegalArgumentException as well

but if you removed the plugin config of maven bundle plugin config and re deploy it will work to read the I/O in S3

Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

jefoy1101
Hi Achim,

I believe there is an issue with karaf and AWS, in my servlet(no other classes or external jars involve) i created a simple send() that sends email using AmazonSES all is working with my junit test but when I deploy it to karaf, my manifest is correct but got the same exception

java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.ClientConfiguration
        at com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceClient.

Same as previous exception except that its referring to AmazonS3Client as the first test is reading properties file in S3 bucket.

From my simple HelloWorldServlet.java alone I verified the issue, It is in my github project posted above

May I as a favor to verify the issue? or should I post it to Jira in Karaf?

Thanks



Reply | Threaded
Open this post in threaded view
|

Re: deploying a war with dependencies in bundled jars

jefoy1101
Thank Achim for the help, for everyone that will have the same issue, there is a bug in smx bundle of aws-java-sdk it has a missing file please refer to the issue

https://issues.apache.org/jira/browse/SMX4-1921
12