Durden
Apr 30th, 2009, 04:01 AM
Hi,
We are having problems with Jetty & BlazeDS Integration M2. Application works fine on Tomcat, but on Jetty (Maven plugin) it fails.
Error is this:
Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean
failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '_messageBroker': Invocation of init method failed;
java.lang.LinkageError: loader constraint violation: loader (instance of org/mortbay/jetty/webapp/WebAppClassLoader) previously initiated loading for a different type with name "javax/manage
ment/MBeanServer"
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/id=WebApp_ID "
version="2.5">
<!--======= INITIALIZATION PARAMETERS ======= -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:businessApplicationContext.xml
classpath:dataAccessContext.xml
/WEB-INF/securityContext.xml
</param-value>
</context-param>
<!--======= LISTENERS =======-->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListe ner
</listener-class>
</listener>
<listener>
<listener-class>flex.messaging.HttpFlexSession</listener-class>
</listener>
<!--======= SERVLETS =======-->
<!-- The front controller of this Spring Web application, responsible for handling all application requests -->
<servlet>
<servlet-name>Dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map all /messagbroker requests to the DispatcherServlet for handling -->
<servlet-mapping>
<servlet-name>Dispatcher</servlet-name>
<url-pattern>/messagebroker/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>
<!--======= FILTERS =======-->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterPro xy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
Dispacher-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:flex="http://www.springframework.org/schema/flex"
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-2.5.xsd
http://www.springframework.org/schema/flex
http://www.springframework.org/schema/flex/spring-flex-1.0.xsd">
<!-- import context definition resources. Should we import?
<import resource="classpath:businessApplicationContext.xml"/>
<import resource="classpath:dataAccessContext.xml"/> -->
<!-- 1) setup Spring managed message broker infrastructure -->
<flex:message-broker/>
<!-- 2) Expose the service beans for BlazeDS remoting -->
<flex:remote-service ref="myServiceFromBusinessAppContext"/> -->
</beans>
So we are loading application context`s with contextConfigLocation and flex-related context with DispacherServlet. It works fine on tomcat, but fails on Jetty...any thoughts?
We are having problems with Jetty & BlazeDS Integration M2. Application works fine on Tomcat, but on Jetty (Maven plugin) it fails.
Error is this:
Error creating bean with name '_messageBrokerDefaultHandlerMapping': Initialization of bean
failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '_messageBroker': Invocation of init method failed;
java.lang.LinkageError: loader constraint violation: loader (instance of org/mortbay/jetty/webapp/WebAppClassLoader) previously initiated loading for a different type with name "javax/manage
ment/MBeanServer"
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/id=WebApp_ID "
version="2.5">
<!--======= INITIALIZATION PARAMETERS ======= -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:businessApplicationContext.xml
classpath:dataAccessContext.xml
/WEB-INF/securityContext.xml
</param-value>
</context-param>
<!--======= LISTENERS =======-->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListe ner
</listener-class>
</listener>
<listener>
<listener-class>flex.messaging.HttpFlexSession</listener-class>
</listener>
<!--======= SERVLETS =======-->
<!-- The front controller of this Spring Web application, responsible for handling all application requests -->
<servlet>
<servlet-name>Dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map all /messagbroker requests to the DispatcherServlet for handling -->
<servlet-mapping>
<servlet-name>Dispatcher</servlet-name>
<url-pattern>/messagebroker/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>
<!--======= FILTERS =======-->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterPro xy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
Dispacher-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:flex="http://www.springframework.org/schema/flex"
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-2.5.xsd
http://www.springframework.org/schema/flex
http://www.springframework.org/schema/flex/spring-flex-1.0.xsd">
<!-- import context definition resources. Should we import?
<import resource="classpath:businessApplicationContext.xml"/>
<import resource="classpath:dataAccessContext.xml"/> -->
<!-- 1) setup Spring managed message broker infrastructure -->
<flex:message-broker/>
<!-- 2) Expose the service beans for BlazeDS remoting -->
<flex:remote-service ref="myServiceFromBusinessAppContext"/> -->
</beans>
So we are loading application context`s with contextConfigLocation and flex-related context with DispacherServlet. It works fine on tomcat, but fails on Jetty...any thoughts?