The Bundle-ClassPath has all my compile, runtime dependencies so I wonder why Karaf cares about Import-Package'. Perhaps, Virgo works out of the box since It does not look at 'Import-Package'
Here is subset of my MANIFEST, the weird thing is 'Import Package' has some other package that I would think i need ( ie Bsh, caucho, etc ), but no javax.faces.* org.springframework.context.* do I have proper maven-bundle-plugin's configuration? Manifest-Version: 1.0 Embed-Directory: WEB-INF/lib Bundle-ClassPath: .,WEB-INF/classes,WEB-INF/lib/hibernate-jpa-2.0-api- 1.0.0.Final.jar,WEB-INF/lib/shiro-core-1.1.0.jar,WEB-INF/lib/commons- beanutils-1.8.3.jar,WEB-INF/lib/spring-jdbc-3.0.5.RELEASE.jar,WEB-INF /lib/log4j-1.2.14.jar,WEB-INF/lib/spring-tx-3.0.5.RELEASE.jar,WEB-INF /lib/commons-digester-2.1.jar,WEB-INF/lib/aspectjtools-1.5.4.jar,WEB- INF/lib/spring-expression-3.0.5.RELEASE.jar,WEB-INF/lib/commons-loggi ng-1.1.1.jar,WEB-INF/lib/commons-dbcp-1.4.jar,WEB-INF/lib/mc-user-1.0 .0.CI-SNAPSHOT.jar,WEB-INF/lib/spring-context-3.0.5.RELEASE.jar,WEB-I NF/lib/mc-mgmt-1.0.0.CI-SNAPSHOT.jar,WEB-INF/lib/aspectjrt-1.5.4.jar, WEB-INF/lib/mc-dbsetup-1.0.0.CI-SNAPSHOT.jar,WEB-INF/lib/bluesky-1.0. 0.jar,WEB-INF/lib/myfaces-bundle-2.0.4.jar,WEB-INF/lib/javassist-3.12 .0.GA.jar,WEB-INF/lib/primefaces-2.2.1.jar,WEB-INF/lib/commons-lang-2 .5.jar,WEB-INF/lib/hibernate-entitymanager-3.6.1.Final.jar,WEB-INF/li b/plexus-utils-2.0.5.jar,WEB-INF/lib/aopalliance-1.0.jar,WEB-INF/lib/ jcommon-1.0.16.jar,WEB-INF/lib/mc-config-1.0.0.CI-SNAPSHOT.jar,WEB-IN F/lib/shiro-spring-1.1.0.jar,WEB-INF/lib/jta-1.1.jar,WEB-INF/lib/jcl- over-slf4j-1.6.1.jar,WEB-INF/lib/spring-asm-3.0.5.RELEASE.jar,WEB-INF /lib/spring-web-3.0.5.RELEASE.jar,WEB-INF/lib/hibernate-commons-annot ations-3.2.0.Final.jar,WEB-INF/lib/derby-10.6.2.1.jar,WEB-INF/lib/com mons-io-1.4.jar,WEB-INF/lib/antlr-2.7.6.jar,WEB-INF/lib/cglib-2.2.jar ,WEB-INF/lib/shiro-web-1.1.0.jar,WEB-INF/lib/cglib-nodep-2.2.jar,WEB- INF/lib/jfreechart-1.0.13.jar,WEB-INF/lib/commons-collections-3.2.jar ,WEB-INF/lib/commons-codec-1.4.jar,WEB-INF/lib/h2-1.2.147.jar,WEB-INF /lib/jstl-api-1.2.jar,WEB-INF/lib/slf4j-api-1.6.1.jar,WEB-INF/lib/dom 4j-1.6.1.jar,WEB-INF/lib/spring-beans-3.0.5.RELEASE.jar,WEB-INF/lib/s lf4j-log4j12-1.6.1.jar,WEB-INF/lib/spring-aop-3.0.5.RELEASE.jar,WEB-I NF/lib/commons-pool-1.5.4.jar,WEB-INF/lib/spring-core-3.0.5.RELEASE.j ar,WEB-INF/lib/jstl-impl-1.2.jar,WEB-INF/lib/asm-3.1.jar,WEB-INF/lib/ mc-common-1.0.0.CI-SNAPSHOT.jar,WEB-INF/lib/commons-fileupload-1.2.2. jar,WEB-INF/lib/mc-theme-1.0.0.CI-SNAPSHOT.jar,WEB-INF/lib/spring-orm -3.0.5.RELEASE.jar,WEB-INF/lib/hibernate-core-3.6.1.Final.jar Built-By: dan.tran Tool: Bnd-1.15.0 Bundle-Name: My- WebApp Created-By: Apache Maven Bundle Plugin Web-ContextPath: mc Bundle-Vendor: My Company Build-Jdk: 1.6.0_22 Bundle-Version: 1.0.0.CI-SNAPSHOT Bnd-LastModified: 1299278178006 Embed-Transitive: true Bundle-ManifestVersion: 2 Bundle-Description: My WebApp Embed-Dependency: *;scope=compile|runtime Import-Package: bsh;resolution:=optional,com.caucho.burlap.client;reso lution:=optional,com.caucho.burlap.io;resolution:=optional,com.caucho .burlap.server;resolution:=optional,com.caucho.hessian;resolution:=op tional,com.caucho.hessian.client;resolution:=optional,com.caucho.hess ian.io;resolution:=optional,com.caucho.hessian.server;resolution:=opt ional,com.google.inject;resolution:=optional,com.ibatis.common.xml;re solution:=optional,com.ibatis.sqlmap.client;resolution:=optional,com. ibatis.sqlmap.client.event;resolution:=optional,com.ibatis.sqlmap.eng Thanks -Dan On Fri, Mar 4, 2011 at 3:28 PM, David Jencks <[email protected]> wrote: > I think your embed instructions will result in your jsf implementation and > probably spring dependencies being embedded in your war?? If so they > wouldn't need to also be imported. > > Maybe not all the required spring dependencies are included? > > david jencks > > On Mar 4, 2011, at 2:46 PM, Dan Tran wrote: > >> Base on suggestion from this forum, i now have 2 choice >> >> 1. Generate manifest using maven-bundle-plugin >> >> 2. Debug it >> >> >> I start with 1 any way to get a deep understanding of OSGI MANIFEST >> file. However the the generated file's Import-Package does not have >> the import ant javax.faces.* and org.springframework. >> This may explain why it bails on me at start up >> >> java.lang.IllegalAccessError: tried to access class >> org.springframework.beans.factory.config.PropertyPlaceholderConfigurer$PlaceholderResolvingStringValueResolver >> from class >> org.springframework.beans.factory.config.PropertyPlaceholderConfigurer >> at >> org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:274) >> at >> org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75) >> at >> org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:663) >> at >> org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:638) >> at >> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:407) >> at >> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) >> at >> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) >> >> and my maven-bundle-plugin's instructions is >> >> <instructions> >> <Web-ContextPath>${project.build.finalName}</Web-ContextPath> >> >> <Bundle-SymbolicName>${project.groupId}.web</Bundle-SymbolicName> >> <Bundle-Version>${project.version}</Bundle-Version> >> <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>*;resolution:=optional</Import-Package> >> <Export-Package></Export-Package> >> </instructions> >> >> >> Big thanks ahead for all the helps >> >> -Da >> >> On Thu, Mar 3, 2011 at 1:10 AM, Achim Nierbeck <[email protected]> >> wrote: >>> Hi Dan, >>> >>> this might be an issue with pax-web right now. >>> Depending on the version of Karaf you are using JSF isn't supported at all. >>> If you are using Karaf 2.1.x JSF isn't supported by Pax-Web (0.8.x) >>> If you are using Karaf 2.2.x JSF should work (Pax-web 1.0.1), but I'm >>> not quite sure that everything is properly working yet, haven't had >>> the time to check this in detail. >>> Concerning your startup class, are you already creating a Manifest >>> for your war? >>> If not, the servlet class is not interpreted yet. There is a issue for >>> pax-url I was working on >>> but haven't tested yet if this works for all use cases. >>> (http://issues.ops4j.org/browse/PAXURL-107) >>> >>> This is the current state. >>> My suggestion is to create a manifest for your war, the >>> maven-bundle-plugin in version 2.3.4 does support wars. >>> >>> Greetings Achim >>> >>> 2011/3/3 Dan Tran <[email protected]>: >>>> I am using mojarra 2.1.0-b11 and 2.0.4-b09, switching to myfaces 2.0.4 >>>> gives me further error like this >>>> >>>> java.lang.IllegalStateException: No Factories configured for this >>>> Application. This happens if the faces-initialization does not work at >>>> all - make sure that you properly include all configuration settings >>>> necessary for a basic faces applic >>>> ck the logging output of your web application and your container for >>>> any exceptions! >>>> If you did that and find nothing, the mistake might be due to the fact >>>> that you use some special web-containers which do not support >>>> registering context-listeners via TLD files and a context listener is >>>> not setup in your web.xml. >>>> A typical config looks like this; >>>> <listener> >>>> <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class> >>>> </listener> >>>> >>>> at >>>> javax.faces.FactoryFinder.getFactory(FactoryFinder.java:196)[219:mc:0.0.0] >>>> >>>> -D >>>> >>>> >>>> On Thu, Mar 3, 2011 at 12:52 AM, Charles Moulliard <[email protected]> >>>> wrote: >>>>> Hi, >>>>> >>>>> This is an issue that I experienced some weeks ago with a JSF project >>>>> based on PrimeFaces. Can you tell me if the JSF (spec) and >>>>> implementation lib are embedded into your bundle or deployed >>>>> separately ? >>>>> >>>>> Regards, >>>>> >>>>> Charles Moulliard >>>>> Apache Committer >>>>> >>>>> Blog : http://cmoulliard.blogspot.com >>>>> Twitter : http://twitter.com/cmoulliard >>>>> Linkedin : http://www.linkedin.com/in/charlesmoulliard >>>>> Skype: cmoulliard >>>>> >>>>> >>>>> >>>>> On Thu, Mar 3, 2011 at 9:32 AM, Dan Tran <[email protected]> wrote: >>>>>> ouch, I will need to temporary add simple onelines bean definitions >>>>>> for all the annotated beans. But that is ok >>>>>> >>>>>> NowI run into >>>>>> >>>>>> java.lang.IllegalStateException: Application was not properly >>>>>> initialized at startup, could not find Factory: >>>>>> javax.faces.context.FacesContextFactory >>>>>> at >>>>>> javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:815)[211:mc:0.0.0] >>>>>> at >>>>>> javax.faces.FactoryFinder.getFactory(FactoryFinder.java:317)[211:mc:0.0.0] >>>>>> at >>>>>> javax.faces.webapp.FacesServlet.init(FacesServlet.java:253)[211:mc:0.0.0] >>>>>> at >>>>>> org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:432)[199:org.eclipse.jetty.servlet:7.2.2.v20101205] >>>>>> at >>>>>> org.eclipse.jetty.servlet.ServletHolder.doStart(ServletHolder.java:260)[199:org.eclipse.jetty.servlet:7.2.2.v20101205] >>>>>> at >>>>>> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)[193:org.eclipse.jetty.util:7.2.2.v20101205] >>>>>> at >>>>>> org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:762)[199:org.eclipse.jetty.servlet:7.2.2.v20101205] >>>>>> >>>>>> Big Thanks >>>>>> >>>>>> -Dan >>>>>> >>>>>> On Wed, Mar 2, 2011 at 11:52 PM, Charles Moulliard >>>>>> <[email protected]> wrote: >>>>>>> Hi Dan, >>>>>>> >>>>>>> Can you make a test using <context:annotation-config/> instead of >>>>>>> <context:component-scan> (see here for more info - >>>>>>> http://wiki.ops4j.org/display/ops4j/Pax+Web+Extender+-+War+-+Examples) >>>>>>> to see if the error is still there ? >>>>>>> >>>>>>> Regards, >>>>>>> >>>>>>> Charles >>>>>>> >>>>>>> >>>>>>> On Thu, Mar 3, 2011 at 8:33 AM, Dan Tran <[email protected]> wrote: >>>>>>>> Hi Charles , thank you for looking into this issue: >>>>>>>> >>>>>>>> Here is the stack trace >>>>>>>> >>>>>>>> Problem accessing /mc/index.jsp. Reason: >>>>>>>> >>>>>>>> Error creating bean with name 'shiroFilter' defined in >>>>>>>> ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot >>>>>>>> resolve reference to bean 'securityManager' while setting bean >>>>>>>> property 'securityManager'; nested exception is >>>>>>>> org.springframework.beans.factory.BeanCreationException: Error >>>>>>>> creating bean with name 'securityManager' defined in ServletContext >>>>>>>> resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference >>>>>>>> to bean 'localRealm' while setting bean property 'realm'; nested >>>>>>>> exception is >>>>>>>> org.springframework.beans.factory.NoSuchBeanDefinitionException: >>>>>>>> No bean named 'localRealm' is defined >>>>>>>> at >>>>>>>> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)[93:mc:0.0.0] >>>>>>>> at >>>>>>>> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)[93:mc:0.0.0] >>>>>>>> >>>>>>>> >>>>>>>> This means my 'shiroBean' is defined in applicationContext.xml which >>>>>>>> needs to reference 'securityContext' , also defined in the same Spring >>>>>>>> xml file, which then requires 'localRealm' bean which is annotated via >>>>>>>> Spring @Component. >>>>>>>> >>>>>>>> If I manually add my 'localRealm' to the Spring XML, then same issue >>>>>>>> happens on other annotated bean. >>>>>>>> >>>>>>>> It sound like ' <context:component-scan ...' got muted ( no problem >>>>>>>> under Virgo ) >>>>>>>> >>>>>>>> I you see no hints from this log, i will try to scale down the project >>>>>>>> and post it >>>>>>>> >>>>>>>> Thanks >>>>>>>> >>>>>>>> -D >>>>>>>> >>>>>>>> >>>>>>>> On Wed, Mar 2, 2011 at 10:44 PM, Charles Moulliard >>>>>>>> <[email protected]> wrote: >>>>>>>>> Hi Dan, >>>>>>>>> >>>>>>>>> Can you provide us the exception generated in the stack trace of Karaf >>>>>>>>> (using command log:display -n 10) and maybe a test case or the war >>>>>>>>> used to reproduce the error and check what happens ? >>>>>>>>> >>>>>>>>> Regards, >>>>>>>>> >>>>>>>>> Charles Moulliard >>>>>>>>> >>>>>>>>> Sr. Principal Solution Architect - FuseSource >>>>>>>>> Apache Committer >>>>>>>>> >>>>>>>>> Blog : http://cmoulliard.blogspot.com >>>>>>>>> Twitter : http://twitter.com/cmoulliard >>>>>>>>> Linkedin : http://www.linkedin.com/in/charlesmoulliard >>>>>>>>> Skype: cmoulliard >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Thu, Mar 3, 2011 at 3:53 AM, Dan Tran <[email protected]> wrote: >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I have a JSF 2.0 + Spring + JPA 2.0 standalone webapp loading fine on >>>>>>>>>> Eclipse Virgo 2.1[1], but not with Karaf. It seems like no Spring >>>>>>>>>> annotated beans can be created. No problem creating beans via XML >>>>>>>>>> configuration thou. >>>>>>>>>> >>>>>>>>>> Any advice for me to trouble this issue? or Have any one >>>>>>>>>> successfully >>>>>>>>>> get this combination working? >>>>>>>>>> >>>>>>>>>> Big thanks ahead >>>>>>>>>> >>>>>>>>>> -Dan >>>>>>>>>> >>>>>>>>>> PS: I see the same issue with Karaf 2.1.4 >>>>>>>>>> >>>>>>>>>> [1] >>>>>>>>>> http://www.eclipse.org/forums/index.php?t=msg&goto=657502&S=b35e653a8e2ccc6da8734a1cfb0eed16 >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> > >
