Danielle, 



We had similar issues with spring xml files, and you're correct, you cannot 
access spring.xml files between bundles. To be clear though, are you referring 
to the xml files in META-INF/spring or are you referring to the .xsd files 
spring uses in its namespaces? 



v/r, 



Mike Van 


----- Original Message ----- 
From: "Daniele Dellafiore" <dani...@dellafiore.net> 
To: users@felix.apache.org 
Sent: Tuesday, May 10, 2011 7:12:48 AM 
Subject: Re: A better life: quick webapp deploy 

On Fri, May 6, 2011 at 4:47 PM, Peter Kriens <peter.kri...@aqute.biz> wrote: 

> I am not sure I understand where you're going .... 
> 
> The -wab/-wablib facility is ONLY for people that want to make a WAR that 
> also runs on OSGi. Your use case seems to be standard vanilla OSGi. Just 
> make it a WAB, i.e. set the Web-ContextPath header and you're done with any 
> compliant OSGi Web container. The -wab option is just a convenience that 
> moves the classes from the root to WEB-INF/classes. So start from zero and 
> just create a bundle. I have NO idea what will happen when you try to build 
> a JAR with all these different packagers in maven. 
> 
> Did you try to make a simple "hello world" servlet? 
> 

Yes I tried that way and I finally succeded. The misunderstanding was I 
thought that "WAB" means "war without dependencies, with a context and with 
classpath in WEB-INF/classes", and that bnd/maven-bundle build that 
accordingly. It's not the case, a WAB is a WAR with a couple of special 
instructions for OSGI in the manifest and there's to use maven-war to 
exclude dependencies. 
Fine 

I succeded in starting a simple servlet project, a wicket webapp and also a 
wicket webapp with spring using OsgiBundleXmlWebApplicationContext from the 
org.springframework.osgi.web project. 

There's still a thing I can't understand how to achieve, that involves osgi 
and spring (not wicket or webapps) 
In the OSGI context, I can only load spring xml files that are in the 
bundle, not the ones in  imported bundles. 

Anyway thanks to everyone for the help. 



> 
> Kind regards, 
> 
>        Peter Kriens 
> 
> 
> 
> 
> On 21 apr 2011, at 10:48, Daniele Dellafiore wrote: 
> 
> > I thank you all for the information. I need to make it run from the 
> > maven-bundle-plugin 2.2.0. 
> > With the configuration (pasted in the end of the email) and instructing 
> the 
> > maven-war-plugin to where the MANIFEST file is, the module with packaging 
> = 
> > war has the osgi info but still has the /lib folder with all the jars and 
> > the MANIFEST file is not even populated with the OSGI info (while for all 
> > the other jar it is) 
> > 
> > I think I still need to add something like 
> > 
> >   <Bundle-ClassPath>.,WEB-INF/classes</Bundle-ClassPath> 
> > 
> > Just for the war project. 
> > 
> > I'm confused about two things now: 
> > 1. how do I instruct the maven plugin NOT to copy dependency? Is this 
> enough 
> > for the bundle to look for dependency in the container rather than in 
> it's 
> > own /lib folder? 
> > 2. How do I instruct the container to run the bundle as a webapp? So to 
> make 
> > the jetty that's active on Karaf to read the web.xml of my bundle? 
> > 
> > Or maybe I can skip the web.xml at all, in this way I've to figure out 
> how 
> > to run a Wicket application without it... 
> > 
> >> 
> >>        <plugin> 
> >          <groupId>org.apache.felix</groupId> 
> >          <artifactId>maven-bundle-plugin</artifactId> 
> >          <version>2.2.0</version> 
> >          <extensions>true</extensions> 
> >          <executions> 
> >            <execution> 
> >              <id>bundle-manifest</id> 
> >              <phase>process-classes</phase> 
> >              <goals> 
> >                <goal>manifest</goal> 
> >              </goals> 
> >            </execution> 
> >          </executions> 
> >          <configuration> 
> >            <supportedProjectTypes> 
> >              <supportedProjectType>jar</supportedProjectType> 
> >              <supportedProjectType>bundle</supportedProjectType> 
> >              <supportedProjectType>war</supportedProjectType> 
> >            </supportedProjectTypes> 
> >            <instructions> 
> > 
> > <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName> 
> >              <_versionpolicy>${osgi.version.policy}</_versionpolicy> 
> >              <Export-Package>${osgi.export.package}</Export-Package> 
> >              <Import-Package>${osgi.import.package}</Import-Package> 
> >              <_wab>src/main/webapp/</_wab> 
> >            </instructions> 
> >          </configuration> 
> >        </plugin> 
> 
> 
> --------------------------------------------------------------------- 
> To unsubscribe, e-mail: users-unsubscr...@felix.apache.org 
> For additional commands, e-mail: users-h...@felix.apache.org 
> 
> 

Reply via email to