You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by wagner <wa...@gmail.com> on 2012/07/23 21:10:36 UTC

Servlet Class is not found by servicemix in WEB-INF/lib package

Hi,
I'm working on in a archetypeArtifactId=war-archetype based
project.(https://github.com/wagnermarques/ops4j_pax_war_archetype_fzlbpms_template/blob/master/README.md)

This project are using dwr framework that works ok with jetty maven plugin,
but deploying the war package on servicemix results in a exception below. 

I'm seeing that the servicemix container could not get the dwrservlet from
apropriate jar in the WEB-INF/lib and are saying it, but how could I
configure servicemix to find dwr?

Best Regards!


15:50:44,221 | INFO  | use-07-11/deploy | WebXmlObserver                   |
170 - org.ops4j.pax.web.pax-web-extender-war - 1.0.3 | Using
[ops4j_pax_war_archetype_fzlbpms_template] as web application context name

15:50:44,221 | INFO  | use-07-11/deploy | WebXmlObserver                   |
170 - org.ops4j.pax.web.pax-web-extender-war - 1.0.3 | Using [] as web
application root path

15:50:44,224 | INFO  | use-07-11/deploy | HttpServiceFactoryImpl           |
164 - org.ops4j.pax.web.pax-web-runtime - 1.0.3 | Binding bundle:
[ops4j_pax_war_archetype_fzlbpms_template [228]] to http service

15:50:44,225 | INFO  | use-07-11/deploy | log                              |
116 - org.eclipse.jetty.util - 7.4.5.fuse20111017 | started
HttpServiceContext{httpContext=org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext@5541bd}



15:50:44,225 | WARN  | use-07-11/deploy | JettyServerWrapper               |
166 - org.ops4j.pax.web.pax-web-jetty - 1.0.3 | *osgi.web.contextpath
couldn't be set, it's not configured

*
15:50:44,276 | ERROR | use-07-11/deploy | RegisterWebAppVisitorWC          |
170 - org.ops4j.pax.web.pax-web-extender-war - 1.0.3 | Registration
exception. Skipping.
*java.lang.ClassNotFoundException: org.directwebremoting.servlet.DwrServlet
not found by *ops4j_pax_war_archetype_fzlbpms_template [228]
	at
org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:852)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
	at
org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:74)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
	at
org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1846)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)[:1.6.0_30]
	at
org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:710)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
	at
org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1624)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
	at
org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:909)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
	at
org.ops4j.pax.swissbox.core.BundleClassLoader.findClass(BundleClassLoader.java:176)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:194)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)[:1.6.0_30]
	at
org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorHS.newInstance(RegisterWebAppVisitorHS.java:221)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.visit(RegisterWebAppVisitorWC.java:200)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:583)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.register(WebAppPublisher.java:170)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.serviceChanged(WebAppPublisher.java:155)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.serviceChanged(WebAppPublisher.java:119)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.swissbox.tracker.ReplaceableService.setService(ReplaceableService.java:114)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.swissbox.tracker.ReplaceableService.access$100(ReplaceableService.java:28)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.swissbox.tracker.ReplaceableService$CollectionListener.serviceAdded(ReplaceableService.java:183)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.swissbox.tracker.ServiceCollection$Tracker.addingService(ServiceCollection.java:181)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:896)[karaf.jar:2.2.2-fuse-07-11]
	at
org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)[karaf.jar:2.2.2-fuse-07-11]
	at
org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:184)[karaf.jar:2.2.2-fuse-07-11]
	at
org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:339)[karaf.jar:2.2.2-fuse-07-11]
	at
org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:273)[karaf.jar:2.2.2-fuse-07-11]
	at
org.ops4j.pax.swissbox.tracker.ServiceCollection.onStart(ServiceCollection.java:139)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle$Stopped.start(AbstractLifecycle.java:121)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle.start(AbstractLifecycle.java:49)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.swissbox.tracker.ReplaceableService.onStart(ReplaceableService.java:146)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle$Stopped.start(AbstractLifecycle.java:121)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle.start(AbstractLifecycle.java:49)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:81)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.web.extender.war.internal.WebXmlObserver.doPublish(WebXmlObserver.java:304)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.web.extender.war.internal.WebXmlObserver.addingEntries(WebXmlObserver.java:153)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.swissbox.extender.BundleWatcher.register(BundleWatcher.java:186)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.swissbox.extender.BundleWatcher.access$000(BundleWatcher.java:45)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.ops4j.pax.swissbox.extender.BundleWatcher$1.bundleChanged(BundleWatcher.java:127)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
	at
org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:795)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
	at
org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:717)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
	at
org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:597)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
	at
org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3781)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
	at
org.apache.felix.framework.Felix.startBundle(Felix.java:1792)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
	at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:927)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
	at
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1183)[7:org.apache.felix.fileinstall:3.3.1.fuse-07-11]
	at
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1161)[7:org.apache.felix.fileinstall:3.3.1.fuse-07-11]
	at
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:466)[7:org.apache.felix.fileinstall:3.3.1.fuse-07-11]
	at
org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:271)[7:org.apache.felix.fileinstall:3.3.1.fuse-07-11]






--
View this message in context: http://servicemix.396122.n5.nabble.com/Servlet-Class-is-not-found-by-servicemix-in-WEB-INF-lib-package-tp5713940.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Servlet Class is not found by servicemix in WEB-INF/lib package

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

You war bundle can import any package available in the OSGi container and hence can use it.

Freeman
-------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042

On 2012-7-26, at 下午9:05, wagner wrote:

> Many thanks,
> 
> karaf@root> list | grep fzlbpms
> [ 248] [*Active*     ] [            ] [       ] [   60]
> ops4j_pax_war_archetype_fzlbpms_template (1.0.0.SNAPSHOT)
> 
> whith folowing Package-Import configuration:
> <Import-Package> 
>                                    !com.google.inject, 
>                                    !com.google.inject.binder, 
>                                    !com.google.inject.util,
>                                    !com.opensymphony.webwork.dispatcher,
> 
> !com.opensymphony.webwork.dispatcher.mapper,
>                                    !com.opensymphony.xwork,
>                                    !com.opensymphony.xwork.config,
>                                    !com.opensymphony.xwork.util,
>                                    !javax.faces,
>                                    !javax.faces.application,
>                                    !javax.faces.context,
>                                    !javax.faces.el,
>                                    !javax.faces.lifecycle,
>                                    !javax.portlet,
>                                    !net.sf.hibernate,
>                                    !nu.xom,
>                                    !org.apache.bsf,
> 
>                                   * !org.apache.commons.io,
>                                    !org.apache.commons.io.output,*
> 
>                                   * !org.apache.log,*
> 
>                                    !org.apache.struts.action,
>                                    !org.apache.struts.config,
>                                    !org.apache.struts.util,
> 
>                                    !org.hibernate,
>                                    !org.hibernate.classic,
>                                    !org.hibernate.engine,
>                                    !org.hibernate.proxy,
>                                    *!org.springframework.**,
>                                    javax.servlet, javax.servlet.http,
> !javax.jws, * </Import-Package>
> 					
> 
> I'm really not planning to use the most of dwr dependecies that was
> excluded, but I am afraid that some them are vital to dwr works properly,
> like 
> 
> org.apache.log
> org.apache.commons.io,
> org.apache.commons.io.output
> and maybe org.apache.bsf
> 
> and, if you don't mind, I'd like to ask you:
> 
> Considering that servicemix provide spring and apache log bundles, is there
> a way to make dwr recognize these  bundles and make dwr use it as its
> dependencies? 
> 
> thanks again
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/Servlet-Class-is-not-found-by-servicemix-in-WEB-INF-lib-package-tp5713940p5714001.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Servlet Class is not found by servicemix in WEB-INF/lib package

Posted by wagner <wa...@gmail.com>.
Many thanks,

karaf@root> list | grep fzlbpms
[ 248] [*Active*     ] [            ] [       ] [   60]
ops4j_pax_war_archetype_fzlbpms_template (1.0.0.SNAPSHOT)

whith folowing Package-Import configuration:
 <Import-Package> 
                                    !com.google.inject, 
                                    !com.google.inject.binder, 
                                    !com.google.inject.util,
                                    !com.opensymphony.webwork.dispatcher,
                                   
!com.opensymphony.webwork.dispatcher.mapper,
                                    !com.opensymphony.xwork,
                                    !com.opensymphony.xwork.config,
                                    !com.opensymphony.xwork.util,
                                    !javax.faces,
                                    !javax.faces.application,
                                    !javax.faces.context,
                                    !javax.faces.el,
                                    !javax.faces.lifecycle,
                                    !javax.portlet,
                                    !net.sf.hibernate,
                                    !nu.xom,
                                    !org.apache.bsf,
                                    
                                   * !org.apache.commons.io,
                                    !org.apache.commons.io.output,*
                                    
                                   * !org.apache.log,*
                                    
                                    !org.apache.struts.action,
                                    !org.apache.struts.config,
                                    !org.apache.struts.util,

                                    !org.hibernate,
                                    !org.hibernate.classic,
                                    !org.hibernate.engine,
                                    !org.hibernate.proxy,
                                    *!org.springframework.**,
                                    javax.servlet, javax.servlet.http,
!javax.jws, * </Import-Package>
					

I'm really not planning to use the most of dwr dependecies that was
excluded, but I am afraid that some them are vital to dwr works properly,
like 

org.apache.log
org.apache.commons.io,
org.apache.commons.io.output
and maybe org.apache.bsf

and, if you don't mind, I'd like to ask you:

Considering that servicemix provide spring and apache log bundles, is there
a way to make dwr recognize these  bundles and make dwr use it as its
dependencies? 

thanks again









--
View this message in context: http://servicemix.396122.n5.nabble.com/Servlet-Class-is-not-found-by-servicemix-in-WEB-INF-lib-package-tp5713940p5714001.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Servlet Class is not found by servicemix in WEB-INF/lib package

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

If you don't wanna import-package com.google.inject in your customer bundle, you should have something like
<Import-Package> !com.google.inject,... </Import-Package>

If your customer bundle do need import package com.google.inject, you need firstly install a bundle which export-package com.google.inject anyway.

Freeman 

-------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042

On 2012-7-24, at 下午10:32, wagner wrote:

> Hi Freeman, 
> 
> I have been investigate what could be wrong with my bundle and I will
> describe what I found. I think that its can be worthy anyway.
> 
> 
> *STEP 1*
> My firts actions was to activate the my war bundle and it result in a log
> below:
> 
> karaf@root> ERROR: Bundle ops4j_pax_war_archetype_fzlbpms_template [238]
> Error starting
> file:/run/media/wagner/fzlbpms_env/PROGSATIVOS/fzlbpms/integrated/apache-servicemix-4.4.1-fuse-07-11/deploy/ops4j_pax_war_archetype_fzlbpms_template.war
> (org.osgi.framework.BundleException: Unresolved constraint in bundle
> ops4j_pax_war_archetype_fzlbpms_template [238]: Unable to resolve 238.0:
> *missing requirement [238.0] package; (package=android.app))*
> org.osgi.framework.BundleException: Unresolved constraint in bundle
> ops4j_pax_war_archetype_fzlbpms_template [238]: Unable to resolve 238.0:
> missing requirement [238.0] package; (package=android.app)
> 	at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3466)
> 	at org.apache.felix.framework.Felix.startBundle(Felix.java:1739)
> 	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1168)
> 	at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
> 	at java.lang.Thread.run(Thread.java:662)
> 
> 
> 
> To fix this missing I comment the selenium dependencies of my pom, 
> 
> *STEP2 (trying 1)*
> but trying to iniciate my war bundle again result in:
> 
> 
> 09:19:48,844 | WARN  | qtp26915030-142  | /                                |
> ?                                   ? | 116 - org.eclipse.jetty.util -
> 7.4.5.fuse20111017 | %bundles.pluginTitle: Cannot start
> org.osgi.framework.BundleException: Unresolved constraint in bundle
> ops4j_pax_war_archetype_fzlbpms_template [239]: *Unable to resolve 239.0:
> missing requirement [239.0] package; (package=com.google.inject)*
> 	at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3466)
> 	at org.apache.felix.framework.Felix.startBundle(Felix.java:1739)
> 	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:927)
> 	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:914)
> 	at
> org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:298)[233:org.apache.karaf.webconsole.console:2.2.2.fuse-07-11]
> 
> Dealing with this missing, I discover that dwr provide support for guice,
> but I am not use this dwr feature and so I exclude this dependencies as
> folow, but it not solve the problem
> 		
> 		<dependency>
> 			<groupId>org.directwebremoting</groupId>
> 			<artifactId>dwr</artifactId>
> 			<version>${dwr.version}</version>
> 			<exclusions>
>        		<exclusion> 
> 					<groupId>javax.servlet</groupId>
> 					<artifactId>servlet-api</artifactId>				        
> 				</exclusion>
>        		<exclusion> 
> 					<groupId>com.google.code.guice</groupId>
> 					<artifactId>guice</artifactId>				        
> 				</exclusion>				
> 			</exclusions>
> 		</dependency>
> 
> *
> STEP2 (trying 2)*
> The trying was exclude from Import-Package guice like this:
> <Import-Package> com.google.inject, javax.servlet, javax.servlet.http,
> !javax.jws, * </Import-Package>
> and like this:
> <Import-Package> com.google.inject, javax.servlet, javax.servlet.http,
> !javax.jws, * </Import-Package>
> 
> But the problem persist...
> 11:16:38,229 | WARN  | qtp26915030-254  | /                                |
> ?                                   ? | 116 - org.eclipse.jetty.util -
> 7.4.5.fuse20111017 | %bundles.pluginTitle: Cannot start
> org.osgi.framework.BundleException: Unresolved constraint in bundle
> ops4j_pax_war_archetype_fzlbpms_template [243]: Unable to resolve 243.0:
> *missing requirement [243.0] package; (package=com.google.inject)*
> 	at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3466)
> 
> 
> 
> *STEP2 (trying 3)*
> I tryed to provide the bundle by myself to get the guice avaivle to my war
> bundle folowing this ur:
> http://team.ops4j.org/wiki/display/ops4j/Guice-OSGi
> But when I was including ops4j-repository and ops4j-laboratory in my nexus I
> realized that this both repositories are empty.
> 
> So could you give me some more advices to fix  *missing requirement [243.0]
> package,; (package=com.google.inject)*, please?
> 
> 
> thanks
> 
> 
> 
> 
> 
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/Servlet-Class-is-not-found-by-servicemix-in-WEB-INF-lib-package-tp5713940p5713970.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Servlet Class is not found by servicemix in WEB-INF/lib package

Posted by wagner <wa...@gmail.com>.
Hi Freeman, 

I have been investigate what could be wrong with my bundle and I will
describe what I found. I think that its can be worthy anyway.


*STEP 1*
My firts actions was to activate the my war bundle and it result in a log
below:

karaf@root> ERROR: Bundle ops4j_pax_war_archetype_fzlbpms_template [238]
Error starting
file:/run/media/wagner/fzlbpms_env/PROGSATIVOS/fzlbpms/integrated/apache-servicemix-4.4.1-fuse-07-11/deploy/ops4j_pax_war_archetype_fzlbpms_template.war
(org.osgi.framework.BundleException: Unresolved constraint in bundle
ops4j_pax_war_archetype_fzlbpms_template [238]: Unable to resolve 238.0:
*missing requirement [238.0] package; (package=android.app))*
org.osgi.framework.BundleException: Unresolved constraint in bundle
ops4j_pax_war_archetype_fzlbpms_template [238]: Unable to resolve 238.0:
missing requirement [238.0] package; (package=android.app)
	at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3466)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:1739)
	at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1168)
	at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
	at java.lang.Thread.run(Thread.java:662)



To fix this missing I comment the selenium dependencies of my pom, 

*STEP2 (trying 1)*
but trying to iniciate my war bundle again result in:


09:19:48,844 | WARN  | qtp26915030-142  | /                                |
?                                   ? | 116 - org.eclipse.jetty.util -
7.4.5.fuse20111017 | %bundles.pluginTitle: Cannot start
org.osgi.framework.BundleException: Unresolved constraint in bundle
ops4j_pax_war_archetype_fzlbpms_template [239]: *Unable to resolve 239.0:
missing requirement [239.0] package; (package=com.google.inject)*
	at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3466)
	at org.apache.felix.framework.Felix.startBundle(Felix.java:1739)
	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:927)
	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:914)
	at
org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:298)[233:org.apache.karaf.webconsole.console:2.2.2.fuse-07-11]

Dealing with this missing, I discover that dwr provide support for guice,
but I am not use this dwr feature and so I exclude this dependencies as
folow, but it not solve the problem
		
		<dependency>
			<groupId>org.directwebremoting</groupId>
			<artifactId>dwr</artifactId>
			<version>${dwr.version}</version>
			<exclusions>
        		<exclusion> 
					<groupId>javax.servlet</groupId>
					<artifactId>servlet-api</artifactId>				        
				</exclusion>
        		<exclusion> 
					<groupId>com.google.code.guice</groupId>
					<artifactId>guice</artifactId>				        
				</exclusion>				
			</exclusions>
		</dependency>

*
STEP2 (trying 2)*
The trying was exclude from Import-Package guice like this:
 <Import-Package> com.google.inject, javax.servlet, javax.servlet.http,
!javax.jws, * </Import-Package>
and like this:
 <Import-Package> com.google.inject, javax.servlet, javax.servlet.http,
!javax.jws, * </Import-Package>

But the problem persist...
11:16:38,229 | WARN  | qtp26915030-254  | /                                |
?                                   ? | 116 - org.eclipse.jetty.util -
7.4.5.fuse20111017 | %bundles.pluginTitle: Cannot start
org.osgi.framework.BundleException: Unresolved constraint in bundle
ops4j_pax_war_archetype_fzlbpms_template [243]: Unable to resolve 243.0:
*missing requirement [243.0] package; (package=com.google.inject)*
	at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3466)



*STEP2 (trying 3)*
I tryed to provide the bundle by myself to get the guice avaivle to my war
bundle folowing this ur:
http://team.ops4j.org/wiki/display/ops4j/Guice-OSGi
But when I was including ops4j-repository and ops4j-laboratory in my nexus I
realized that this both repositories are empty.

So could you give me some more advices to fix  *missing requirement [243.0]
package,; (package=com.google.inject)*, please?


thanks





--
View this message in context: http://servicemix.396122.n5.nabble.com/Servlet-Class-is-not-found-by-servicemix-in-WEB-INF-lib-package-tp5713940p5713970.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Servlet Class is not found by servicemix in WEB-INF/lib package

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

A quick note, your war bundle status is "Installed", 
[ 238] [Installed  ] [            ] [       ] [   60]
ops4j_pax_war_archetype_fzlbpms_template (1.0.0.SNAPSHOT)

The expected status should be "Active", this indicates there's still some thing wrong in your war bundle.

Freeman
-------------
Freeman Fang

FuseSource
Email:ffang@fusesource.com
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042

On 2012-7-24, at 上午10:04, wagner wrote:

> Thanks Gert, my apologies for some dumb words, I am begginer with servicemix.
> 
> I put configuration below in the project pom
> 
>                                <Export-Package>*</Export-Package>
> 
> <Private-Package>javax.jws.*</Private-Package>
>                                <DynamicImport-Package>javax.*,
> org.*</DynamicImport-Package>
>                                <Bundle-ClassPath>.,
> WEB-INF/classes</Bundle-ClassPath>
> 
> <Embed-Directory>WEB-INF/lib</Embed-Directory>
> 
> <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
>                                <Embed-Transitive>true</Embed-Transitive>
>                                <Import-Package>javax.servlet,
> javax.servlet.http, !javax.jws, * </ImportPackage>
> 
> and the servicemix seems to be recognized the web/lib package to load dwr
> dependencies. 
> 
> 
> But, I'm guessing the war bundle was still not deploy correctly because any
> line of log was printed in the servimix.log and the webapp is not present at
> http://localhost:8181/ops4j_pax_war_archetype_fzlbpms_template. How could I
> check properly if the deploy was ok?
> 
> 
> 
> 
> 
> My servicemix installation is a default one and have this configuration. I
> think there are all features to run war bundle.
> 
> karaf@root> features:list | grep -i pax
> [uninstalled] [2.8.0-fuse-06-11    ] camel-paxlogging                    
> camel-2.8.0-fuse-06-11            
> 
> karaf@root> list | grep -i pax
> [ 163] [Active     ] [            ] [       ] [   60] OPS4J Pax Web - API
> (1.0.3)
> [ 164] [Active     ] [            ] [       ] [   60] OPS4J Pax Web -
> Runtime (1.0.3)
> [ 165] [Active     ] [            ] [       ] [   60] OPS4J Pax Web -
> Service SPI (1.0.3)
> [ 166] [Active     ] [            ] [       ] [   60] OPS4J Pax Web - Jetty
> (1.0.3)
> [ 167] [Active     ] [            ] [       ] [   60] OPS4J Pax Web -
> Extender - Whiteboard (1.0.3)
> [ 168] [Active     ] [            ] [       ] [   60] OPS4J Pax Url - war
> (1.2.6.fuse-01)
> [ 170] [Active     ] [            ] [       ] [   60] OPS4J Pax Web -
> Extender - WAR (1.0.3)
> [ 171] [Active     ] [            ] [       ] [   60] OPS4J Pax Web - Jsp
> Support (1.0.3)
> [ 172] [Active     ] [            ] [       ] [   60] OPS4J Pax Web -
> FileInstall Deployer (1.0.3)
> [ 238] [Installed  ] [            ] [       ] [   60]
> ops4j_pax_war_archetype_fzlbpms_template (1.0.0.SNAPSHOT)
> karaf@root> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/Servlet-Class-is-not-found-by-servicemix-in-WEB-INF-lib-package-tp5713940p5713949.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: Servlet Class is not found by servicemix in WEB-INF/lib package

Posted by wagner <wa...@gmail.com>.
Thanks Gert, my apologies for some dumb words, I am begginer with servicemix.

I put configuration below in the project pom

                                <Export-Package>*</Export-Package>
                               
<Private-Package>javax.jws.*</Private-Package>
                                <DynamicImport-Package>javax.*,
org.*</DynamicImport-Package>
                                <Bundle-ClassPath>.,
WEB-INF/classes</Bundle-ClassPath>
                               
<Embed-Directory>WEB-INF/lib</Embed-Directory>
                               
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
                                <Embed-Transitive>true</Embed-Transitive>
                                <Import-Package>javax.servlet,
javax.servlet.http, !javax.jws, * </ImportPackage>

and the servicemix seems to be recognized the web/lib package to load dwr
dependencies. 


But, I'm guessing the war bundle was still not deploy correctly because any
line of log was printed in the servimix.log and the webapp is not present at
http://localhost:8181/ops4j_pax_war_archetype_fzlbpms_template. How could I
check properly if the deploy was ok?





My servicemix installation is a default one and have this configuration. I
think there are all features to run war bundle.
 
karaf@root> features:list | grep -i pax
[uninstalled] [2.8.0-fuse-06-11    ] camel-paxlogging                    
camel-2.8.0-fuse-06-11            

karaf@root> list | grep -i pax
[ 163] [Active     ] [            ] [       ] [   60] OPS4J Pax Web - API
(1.0.3)
[ 164] [Active     ] [            ] [       ] [   60] OPS4J Pax Web -
Runtime (1.0.3)
[ 165] [Active     ] [            ] [       ] [   60] OPS4J Pax Web -
Service SPI (1.0.3)
[ 166] [Active     ] [            ] [       ] [   60] OPS4J Pax Web - Jetty
(1.0.3)
[ 167] [Active     ] [            ] [       ] [   60] OPS4J Pax Web -
Extender - Whiteboard (1.0.3)
[ 168] [Active     ] [            ] [       ] [   60] OPS4J Pax Url - war
(1.2.6.fuse-01)
[ 170] [Active     ] [            ] [       ] [   60] OPS4J Pax Web -
Extender - WAR (1.0.3)
[ 171] [Active     ] [            ] [       ] [   60] OPS4J Pax Web - Jsp
Support (1.0.3)
[ 172] [Active     ] [            ] [       ] [   60] OPS4J Pax Web -
FileInstall Deployer (1.0.3)
[ 238] [Installed  ] [            ] [       ] [   60]
ops4j_pax_war_archetype_fzlbpms_template (1.0.0.SNAPSHOT)
karaf@root> 



 







--
View this message in context: http://servicemix.396122.n5.nabble.com/Servlet-Class-is-not-found-by-servicemix-in-WEB-INF-lib-package-tp5713940p5713949.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Servlet Class is not found by servicemix in WEB-INF/lib package

Posted by Gert Vanthienen <ge...@gmail.com>.
L.S.,


In order for this class to be found, its package either has to be
imported (using e.g. an Import-Package header) or the JAR file has to
be embedded in the WEB-INF/lib folder and the Bundle-ClassPath header
has to be set.

On http://team.ops4j.org/wiki/display/ops4j/Getting+the+benefits+of+maven-bundle-plugin+in+other+project+types
you'll find a bit more information about how to use the
maven-bundle-plugin to correctly configure the WAR for OSGi
deployment.  If you want some additional pointers for your specific
use case, please provide us with the output of osgi:headers <your war
bundle id>.


Regards,

Gert Vanthienen
------------------------
FuseSource
Web: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/


On Mon, Jul 23, 2012 at 9:10 PM, wagner <wa...@gmail.com> wrote:
> Hi,
> I'm working on in a archetypeArtifactId=war-archetype based
> project.(https://github.com/wagnermarques/ops4j_pax_war_archetype_fzlbpms_template/blob/master/README.md)
>
> This project are using dwr framework that works ok with jetty maven plugin,
> but deploying the war package on servicemix results in a exception below.
>
> I'm seeing that the servicemix container could not get the dwrservlet from
> apropriate jar in the WEB-INF/lib and are saying it, but how could I
> configure servicemix to find dwr?
>
> Best Regards!
>
>
> 15:50:44,221 | INFO  | use-07-11/deploy | WebXmlObserver                   |
> 170 - org.ops4j.pax.web.pax-web-extender-war - 1.0.3 | Using
> [ops4j_pax_war_archetype_fzlbpms_template] as web application context name
>
> 15:50:44,221 | INFO  | use-07-11/deploy | WebXmlObserver                   |
> 170 - org.ops4j.pax.web.pax-web-extender-war - 1.0.3 | Using [] as web
> application root path
>
> 15:50:44,224 | INFO  | use-07-11/deploy | HttpServiceFactoryImpl           |
> 164 - org.ops4j.pax.web.pax-web-runtime - 1.0.3 | Binding bundle:
> [ops4j_pax_war_archetype_fzlbpms_template [228]] to http service
>
> 15:50:44,225 | INFO  | use-07-11/deploy | log                              |
> 116 - org.eclipse.jetty.util - 7.4.5.fuse20111017 | started
> HttpServiceContext{httpContext=org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext@5541bd}
>
>
>
> 15:50:44,225 | WARN  | use-07-11/deploy | JettyServerWrapper               |
> 166 - org.ops4j.pax.web.pax-web-jetty - 1.0.3 | *osgi.web.contextpath
> couldn't be set, it's not configured
>
> *
> 15:50:44,276 | ERROR | use-07-11/deploy | RegisterWebAppVisitorWC          |
> 170 - org.ops4j.pax.web.pax-web-extender-war - 1.0.3 | Registration
> exception. Skipping.
> *java.lang.ClassNotFoundException: org.directwebremoting.servlet.DwrServlet
> not found by *ops4j_pax_war_archetype_fzlbpms_template [228]
>         at
> org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:852)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
>         at
> org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:74)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
>         at
> org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1846)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:247)[:1.6.0_30]
>         at
> org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:710)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
>         at
> org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1624)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
>         at
> org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:909)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
>         at
> org.ops4j.pax.swissbox.core.BundleClassLoader.findClass(BundleClassLoader.java:176)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:194)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:247)[:1.6.0_30]
>         at
> org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorHS.newInstance(RegisterWebAppVisitorHS.java:221)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.visit(RegisterWebAppVisitorWC.java:200)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:583)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.register(WebAppPublisher.java:170)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.serviceChanged(WebAppPublisher.java:155)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.web.extender.war.internal.WebAppPublisher$HttpServiceListener.serviceChanged(WebAppPublisher.java:119)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.swissbox.tracker.ReplaceableService.setService(ReplaceableService.java:114)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.swissbox.tracker.ReplaceableService.access$100(ReplaceableService.java:28)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.swissbox.tracker.ReplaceableService$CollectionListener.serviceAdded(ReplaceableService.java:183)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.swissbox.tracker.ServiceCollection$Tracker.addingService(ServiceCollection.java:181)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:896)[karaf.jar:2.2.2-fuse-07-11]
>         at
> org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)[karaf.jar:2.2.2-fuse-07-11]
>         at
> org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:184)[karaf.jar:2.2.2-fuse-07-11]
>         at
> org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:339)[karaf.jar:2.2.2-fuse-07-11]
>         at
> org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:273)[karaf.jar:2.2.2-fuse-07-11]
>         at
> org.ops4j.pax.swissbox.tracker.ServiceCollection.onStart(ServiceCollection.java:139)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle$Stopped.start(AbstractLifecycle.java:121)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle.start(AbstractLifecycle.java:49)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.swissbox.tracker.ReplaceableService.onStart(ReplaceableService.java:146)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle$Stopped.start(AbstractLifecycle.java:121)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.swissbox.lifecycle.AbstractLifecycle.start(AbstractLifecycle.java:49)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.web.extender.war.internal.WebAppPublisher.publish(WebAppPublisher.java:81)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.web.extender.war.internal.WebXmlObserver.doPublish(WebXmlObserver.java:304)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.web.extender.war.internal.WebXmlObserver.addingEntries(WebXmlObserver.java:153)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.swissbox.extender.BundleWatcher.register(BundleWatcher.java:186)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.swissbox.extender.BundleWatcher.access$000(BundleWatcher.java:45)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.ops4j.pax.swissbox.extender.BundleWatcher$1.bundleChanged(BundleWatcher.java:127)[170:org.ops4j.pax.web.pax-web-extender-war:1.0.3]
>         at
> org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:795)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
>         at
> org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:717)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
>         at
> org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:597)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
>         at
> org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3781)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
>         at
> org.apache.felix.framework.Felix.startBundle(Felix.java:1792)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
>         at
> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:927)[org.apache.felix.framework-3.0.9-fuse-08-11.jar:]
>         at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1183)[7:org.apache.felix.fileinstall:3.3.1.fuse-07-11]
>         at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:1161)[7:org.apache.felix.fileinstall:3.3.1.fuse-07-11]
>         at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:466)[7:org.apache.felix.fileinstall:3.3.1.fuse-07-11]
>         at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:271)[7:org.apache.felix.fileinstall:3.3.1.fuse-07-11]
>
>
>
>
>
>
> --
> View this message in context: http://servicemix.396122.n5.nabble.com/Servlet-Class-is-not-found-by-servicemix-in-WEB-INF-lib-package-tp5713940.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.