【发布时间】:2011-04-16 22:14:11
【问题描述】:
我们已经将 Fuse 的 Apache ServiceMix 版本 4.2.0-fuse-02-00 用于标准 OSGi 应用程序已有一段时间了,并且相当成功。我们还一直在利用 CXF 提供网络服务。
现在我们想将我们的 web 应用程序部署到 servicemix4 并利用 OSGi 层来实现依赖项和服务。然而,PAX Web 中的打包似乎不支持我们大量使用的标记库:Richfaces、facelets 等。 似乎允许此处概述的工作标记库的 springDM 解决方案:http://static.springsource.org/osgi/docs/current/reference/html/web.html 应该可以工作,但是我很难启动网络服务器,我目前收到此错误。
Exception in thread "WebExtender-Init" java.lang.NoClassDefFoundError: org/apache/catalina/Loader
at org.springframework.osgi.web.extender.internal.activator.WarListenerConfiguration.createDefaultWarDeployer(WarListenerConfiguration.java:194)
at org.springframework.osgi.web.extender.internal.activator.WarListenerConfiguration.<init>(WarListenerConfiguration.java:105)
at org.springframework.osgi.web.extender.internal.activator.WarLoaderListener$1.run(WarLoaderListener.java:366)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.apache.catalina.Loader
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:494)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:398)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 4 more
按照 Spring 文档的建议,我创建了 2 个片段。但它们不会解决,它们保持已安装状态
1) 网络服务器配置片段 定义了以下片段主机:
<Fragment-Host>org.springframework.osgi.web.extender</Fragment-Host>
并且有一个文件 META-INF/spring/extender/tomcat-deployer.xml 包含
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="warDeployer"
class="org.springframework.osgi.web.deployer.tomcat.TomcatWarDeployer" />
</beans>
2) 和 Catalina Config 片段 与以下主机:
<Fragment-Host>org.springframework.osgi.catalina.start.osgi</Fragment-Host>
和定义的 conf/server.xml 主要是 tomcat 6 server.xml 文件的通用 Windows 安装的副本。
这几天我也一直在搞乱依赖关系,这很困难。但这是我一直在搞砸的功能。我也一直在安装 fuse-servicemix 默认的“jpa-hibernate”功能。
<feature name="spring-dependencies" version="1.0.0">
<bundle>mvn:org.osgi/org.osgi.compendium/4.1.0</bundle>
<bundle>mvn:javax.el/com.springsource.javax.el/1.0.0</bundle>
<bundle>mvn:javax.xml.ws/com.springsource.javax.xml.ws/2.1.1</bundle>
<bundle>mvn:javax.xml.stream/com.springsource.javax.xml.stream/1.0.1</bundle>
<bundle>mvn:javax.xml.rpc/com.springsource.javax.xml.rpc/1.1.0</bundle>
<bundle>mvn:javax.xml.soap/com.springsource.javax.xml.soap/1.3.0</bundle>
<bundle>mvn:javax.persistence/com.springsource.javax.persistence/1.99.0</bundle>
<bundle>mvn:org.aspectj/com.springsource.org.aspectj.tools/1.6.8.RELEASE</bundle>
<bundle>mvn:org.apache.commons/com.springsource.org.apache.commons.logging/1.1.1</bundle>
<bundle>mvn:org.apache.commons/com.springsource.org.apache.commons.lang/2.4.0</bundle>
<bundle>mvn:org.apache.xmlcommons/com.springsource.org.apache.xmlcommons/1.3.4</bundle>
<bundle>mvn:org.jboss.el/com.springsource.org.jboss.el/2.0.0.GA</bundle>
<bundle>mvn:org.jboss.javassist/com.springsource.javassist/3.9.0.GA</bundle>
<bundle>mvn:org.aopalliance/com.springsource.org.aopalliance/1.0.0</bundle>
</feature>
<feature name="spring" version="1.0.0">
<!--feature version="1.0.0">spring-dependencies</feature-->
<!--bundle>mvn:org.springframework.osgi/org.springframework.osgi.core/1.2.1</bundle--> <!-- there is 1.2.1, but servicemix plays the 1.2.0 game -->
<!--bundle>mvn:org.springframework.osgi/org.springframework.osgi.io/1.2.1</bundle--> <!-- there is 1.2.1, but servicemix plays the 1.2.0 game -->
<!--bundle>mvn:org.springframework.osgi/org.springframework.osgi.extender/1.2.1</bundle--> <!-- there is 1.2.1, but servicemix plays the 1.2.0 game -->
<!--bundle>mvn:org.springframework.osgi/org.springframework.osgi.extensions.annotation/1.2.1</bundle--> <!-- there is 1.2.1, but servicemix plays the 1.2.0 game -->
<!-- commenting the 3.0.4 release to see if i can get by with the prepacked version in servicmeix bundle>mvn:org.springframework/org.springframework.aop/3.0.4.RELEASE</bundle>
<bundle>mvn:org.springframework/org.springframework.asm/3.0.4.RELEASE</bundle>
<bundle>mvn:org.springframework/org.springframework.aspects/3.0.4.RELEASE</bundle>
<bundle>mvn:org.springframework/org.springframework.beans/3.0.4.RELEASE</bundle>
<bundle>mvn:org.springframework/org.springframework.context/3.0.4.RELEASE</bundle>
<bundle>mvn:org.springframework/org.springframework.context.support/3.0.4.RELEASE</bundle>
<bundle>mvn:org.springframework/org.springframework.core/3.0.4.RELEASE</bundle>
<bundle>mvn:org.springframework/org.springframework.expression/3.0.4.RELEASE</bundle>
<bundle>mvn:org.springframework/org.springframework.jms/3.0.4.RELEASE</bundle>
<bundle>mvn:org.springframework/org.springframework.jdbc/3.0.4.RELEASE</bundle>
<bundle>mvn:org.springframework/org.springframework.transaction/3.0.4.RELEASE</bundle>
<bundle>mvn:org.springframework/org.springframework.orm/3.0.4.RELEASE</bundle>
<bundle>mvn:org.springframework.security/org.springframework.security.core/3.0.3.RELEASE</bundle-->
<bundle>mvn:org.springframework.osgi/org.springframework.osgi.web/1.2.0</bundle> <!-- there is 1.2.1, but servicemix plays the 1.2.0 game -->
<bundle>mvn:org.springframework.osgi/org.springframework.osgi.web.extender/1.2.0</bundle> <!-- there is 1.2.1, but servicemix plays the 1.2.0 game -->
</feature>
<feature name="tomcat" version="1.0.0">
<!--feature version="1.0.0">spring</feature-->
<bundle>mvn:javax.ejb/com.springsource.javax.ejb/3.0.0</bundle>
<bundle>mvn:javax.activation/com.springsource.javax.activation/1.1.1</bundle>
<bundle>mvn:javax.mail/com.springsource.javax.mail/1.4.1</bundle>
<bundle>mvn:org.apache.coyote/com.springsource.org.apache.coyote/6.0.18</bundle>
<bundle>mvn:org.apache.juli/com.springsource.org.apache.juli.extras/6.0.18</bundle>
<bundle>mvn:org.apache.catalina/com.springsource.org.apache.catalina/6.0.18</bundle>
<bundle>mvn:org.springframework/org.springframework.instrument.tomcat/3.0.4.RELEASE</bundle>
</feature>
<feature name="web-dependencies" version="1.0.0">
<!--feature version="1.0.0">spring-dependencies</feature-->
<!--feature version="1.0.0">tomcat-dependencies</feature-->
<bundle>mvn:javax.servlet/com.springsource.javax.servlet/2.5.0</bundle>
<!--bundle>mvn:javax.servlet/com.springsource.javax.servlet.jsp/2.1.0</bundle--> <!--we want this but PAX Web -JSP Support claims tooffer the same thing -->
<!--bundle>mvn:javax.servlet/com.springsource.javax.servlet.jsp.jstl/1.2.0</bundle--> <!--bundle is causing conflict issues on javax.servlet.jsp 2.1.0 in fuse, omitting for now -->
<!-- I have been having problems getting the following to work because of conflicts with the javax.servlet.jsp package 1.2.0 presented by Pax Web seems to not be able to be found -->
<bundle>mvn:javax.faces/com.springsource.javax.faces/1.2.0.09</bundle>
<bundle>mvn:javax.portlet/com.springsource.javax.portlet/2.0.0</bundle>>
<bundle>mvn:org.springframework/org.springframework.web/3.0.4.RELEASE</bundle>
<bundle>mvn:org.springframework/org.springframework.web.servlet/3.0.4.RELEASE</bundle>
<bundle>mvn:org.springframework/org.springframework.web.portlet/3.0.4.RELEASE</bundle>
<bundle>mvn:org.springframework.webflow/org.springframework.binding/2.0.9.RELEASE</bundle>
<bundle>mvn:org.springframework.webflow/org.springframework.js/2.0.9.RELEASE</bundle>
<bundle>mvn:org.springframework.webflow/org.springframework.webflow/2.0.9.RELEASE</bundle>
<bundle>mvn:org.springframework.webflow/org.springframework.faces/2.0.9.RELEASE</bundle> <!--2.1.0 and up rely on Java Server Faces API 2.0 Pre-Release right now, so we must stop at 2.0.9 -->
<bundle>mvn:com.sun.facelets/com.springsource.com.sun.facelets/1.1.14</bundle>
</feature>
我曾考虑切换到 SpringDM,但似乎该项目已移至目前仅在孵化器中的 Virgo。此外,我们对 Sericemix 非常满意,包括它的 maven 安装功能。
任何见解或资源将不胜感激, 谢谢, 杰里米
【问题讨论】:
标签: spring tomcat6 jbossfuse fuseesb apache-servicemix