Hi Dan, how does your URL look like? With spring based web-app this can be a bit more tricky. For the following reason, when having a non OSGi Webapplication you need to install it a webbundle. The URL-Handler taking care of this will try to make the non-osgi war a web application bundle analyzing the dependencies and so forth based on the classfiles with the BND tool. As it uses BND it only works as good as the standalone BND tool can be. Therefore any dynamically loaded class that is contained in a string can not be found as a dependency. To get this working you need to give the webbundle URL handler some hints on how to improve the import-packages by adding those parameters to the install commando. Like:
install webbundle:mvn:groupid/artefactid/version?Import-Package=com.my.package;version=0.1.0,another.package&Web-ContextPath=testme some more details on what needs to be set in a WebApplicationBundle can be found at [1] regards, Achim [1] - http://team.ops4j.org/wiki/display/paxweb/OSGi-fy+your+WAR 2012/6/25 Dan Tran <[email protected]>: > May be this issue relates to this link > http://stackoverflow.com/questions/8118404/osgi-expose-an-classnotfoundexception-org-w3c-dom-error-when-release > ?? > > -D > > On Thu, Jun 21, 2012 at 8:50 PM, Dan Tran <[email protected]> wrote: >> Hi >> >> I am continuing my quest to get a vanila spring webapp war file to >> load on karaf >> >> The example is at >> https://src.springframework.org/svn/spring-samples/petcare/trunk. This >> example loads perfectly on my tomcat7.0.27 + jdk7 >> >> Under karaf, after features:install war >> >> karaf fails to load my petcare.war the first time with following >> errror. ( dont see this under karaf 2.2.7 ) >> >> >> 2012-06-21 20:36:09,256 | ERROR | -SNAPSHOT/deploy | fileinstall >> | 19 - org.apache.felix.fileinstall - 3.2.4 | Failed to >> install artifact: C:\Users\Dan.Tran\dev\karaf\apache-karaf >> -3.0.0-SNAPSHOT\deploy\petcare.war >> java.lang.IllegalStateException: Unknown protocol: webbundle >> at >> org.apache.felix.framework.URLHandlersStreamHandlerProxy.toExternalForm(URLHandlersStreamHandlerProxy.java:481)[org.apache.felix.framework-4.0.2.jar:] >> at >> org.apache.felix.framework.URLHandlersStreamHandlerProxy.toExternalForm(URLHandlersStreamHandlerProxy.java:474)[org.apache.felix.framework-4.0.2.jar:] >> at java.net.URL.toExternalForm(URL.java:919)[:1.7.0_03] >> at java.net.URL.toString(URL.java:905)[:1.7.0_03] >> at >> org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:937)[19:org.apache.felix.fileinstall:3.2.4] >> at >> org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:854)[19:org.apache.felix.fileinstall:3.2.4] >> at >> org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:483)[19:org.apache.felix.fileinstall:3.2.4] >> at >> org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)[19:org.apache.felix.fileinstall:3.2.4] >> >> >> After restarting my karaf >> >> here is the next error ( same for all version of karaf ) >> >> 2012-06-21 20:47:02,921 | ERROR | raf-2.2.7/deploy | >> RegisterWebAppVisitorWC | 77 - >> org.ops4j.pax.web.pax-web-extender-war - 1.0.9 | Registration >> exception. Skipping. >> java.lang.RuntimeException: >> org.springframework.beans.factory.BeanDefinitionStoreException: >> Unexpected exception parsing XML document from class path resource >> [META-INF/spring/root-context.xml]; neste >> d exception is java.lang.NoClassDefFoundError: org/w3c/dom/DOMError >> at >> org.eclipse.jetty.servlet.ServletHandler.updateMappings(ServletHandler.java:1225)[62:org.eclipse.jetty.servlet:7.5.4.v20111024] >> >> >> Thanks >> >> -D -- Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead OPS4J Pax for Vaadin <http://team.ops4j.org/wiki/display/PAXVAADIN/Home> Commiter & Project Lead blog <http://notizblog.nierbeck.de/>
