| Summary: | Do not deploy dependencies to WEB-INF/lib for OSGi web bundles | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [RT] Virgo | Reporter: | Jean-Pierre Bergamin <james> | ||||
| Component: | tooling | Assignee: | Chris Frost <eclipse> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | eclipse, glyn.normington, mlippert | ||||
| Version: | 3.0.0.M03 | ||||||
| Target Milestone: | 1.0.1.RELEASE | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 368785 | ||||||
| Attachments: |
|
||||||
Someone can close this bug report in the springsource jira: https://issuetracker.springsource.com/browse/STS-1882 Created attachment 200503 [details]
Howto prevent the deployment of the /WEB-INF/lib folder
The deployment of the /WEB-INF/lib folder can be suppressed by removing the entry "Public/export dependency: /WEB-INF/lib" in the Java Build Path settings as shown in the attached screenshot. This bug can be closed, since eclipse offers a reasonable "workaround".
Let's keep this bug open either to improve the usability of the tooling in this area or to document the workaround. This is not a problem with the Virgo IDE tooling, it is working as designed. There has also been lots of improvement with the m2e plugin for Eclipse and this is the desired way of working with Maven built projects that need to deploy on to Virgo. Looking at how the current level of m2e works I don't believe this to be a problem any more and the work around not required. Note, Virgo doesn't support PDE plugins. |
Build Identifier: When deploying our OSGi web bundle to virgo from within STS, the libs in WEB-INF/lib must not be copied into the stage directory to avoid having those libs loaded - somehow. We use camel in our webbundle and get tons of these errors when starting it: 8<------------------------------------------ [2011-06-24 10:15:43.464] ERROR Thread-93 System.err INFO: Initializing Spring root WebApplicationContext [2011-06-24 10:15:43.465] INFO Thread-93 org.springframework.web.context.ContextLoader Root WebApplicationContext: initialization started [2011-06-24 10:15:43.465] INFO Thread-93 o.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext Refreshing ServerOsgiBundleXmlWebApplicationContext(bundle=net.junisphere.eranger.ui.web, config=/WEB-INF/appl icationContext.xml): startup date [Fri Jun 24 10:15:43 CEST 2011]; root of context hierarchy [2011-06-24 10:15:43.465] INFO Thread-93 o.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext Application Context service already unpublished [2011-06-24 10:15:43.473] INFO Thread-93 org.springframework.beans.factory.xml.XmlBeanDefinitionReader Loading XML bean definitions from ServletContext resource [/WEB-INF/spring/camel-context.xml] [2011-06-24 10:15:43.666] INFO Thread-93 org.apache.camel.spring.handler.CamelNamespaceHandler OSGi environment not detected. [2011-06-24 10:15:43.942] ERROR Thread-93 org.springframework.web.context.ContextLoader Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: Failed to create the JAXB binder; nested exception is com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 61 counts of IllegalAnnotationExceptions Two classes have the same XML type name "{http://camel.apache.org/schema/spring}identifiedType". Use @XmlType.name and @XmlType.namespace to assign different names to them. this problem is related to the following location: at org.apache.camel.model.IdentifiedType at org.apache.camel.model.DataFormatDefinition this problem is related to the following location: at org.apache.camel.model.IdentifiedType at org.apache.camel.core.xml.AbstractCamelFactoryBean at org.apache.camel.core.xml.AbstractCamelConsumerTemplateFactoryBean at org.apache.camel.spring.CamelConsumerTemplateFactoryBean 8<------------------------------------------ It seems as if camel has been loaded twice, once from the WEB-INF/lib dir. An indication for this could also be camel's info message "OSGi environment not detected". When I manually delete the WEB-INF/lib dir from the web project in the stage directory, the webapp can be started again (i.e. by right clicking on the project in the "Servers" view and choose "Redeploy" or by restarting virgo). The libs in the WEB-INF folder are not needed anyway, since all dependencies are provided in the repository/usr repo. Reproducible: Always