Results 1 to 4 of 4

Thread: Spring Blazeds Integration + OSGI (Virgo) : CGLIB problem

  1. #1

    Default Spring Blazeds Integration + OSGI (Virgo) : CGLIB problem

    Hi all,

    We've encountered a problem using Spring Blazeds with Virgo Environment.
    You can find a summary of config files below.
    Thanks a lot for your help.
    Vince


    Web.xml:
    Code:
    <web-app>
    	<display-name>Kplus UI</display-name>
    	<context-param>
    		<param-name>contextClass</param-name>
    		<param-value>org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext
    		</param-value>
    	</context-param>
    
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener
    		</listener-class>
    	</listener>
        <servlet>
            <servlet-name>SpringBlazeds</servlet-name>
            <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
            <load-on-startup>1</load-on-startup>
        </servlet>
        <!-- map all the /messagebroker requests to the DispatcherServlet.-->
        <servlet-mapping>
            <servlet-name>SpringBlazeds</servlet-name>
            <url-pattern>/messagebroker/*</url-pattern>
        </servlet-mapping>
    </web-app>
    applicationContext.xml:

    Code:
    <?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.xsd
    		http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd
            http://www.springframework.org/schema/flex http://www.springframework.org/schema/flex/spring-flex-1.5.xsd"
    	xmlns:osgi="http://www.springframework.org/schema/osgi">
    	
        <osgi:reference id="loginService" interface="user.ILoginService"/>
    	
        <flex:message-broker>
            <flex:message-service default-channels="main-amf" />
        </flex:message-broker>
    	
        <flex:remoting-destination ref="loginService"/>
    </beans>
    pom.xml:

    Code:
    (...)
    <dependency>
    	<groupId>org.springframework</groupId>
    	<artifactId>org.springframework.spring-library</artifactId>
    	<type>libd</type>
    </dependency>
    <dependency>
             <groupId>org.springframework.flex</groupId>
             <artifactId>spring-flex-core</artifactId>
    </dependency>
    Virgo ext directory:

    The bundle cglib has been added: com.springsource.net.sf.cglib-2.1.3.jar

    Error:

    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name '_messageBroker': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanInitializati onException: MessageBroker initialization failed; nested exception is org.springframework.aop.framework.AopConfigExcepti on: Could not generate CGLIB subclass of class [class flex.messaging.endpoints.AMFEndpoint]: Common causes of this problem include using a final class or a non-visible class; nested exception is java.lang.IllegalArgumentException: class flex.messaging.endpoints.AMFEndpoint$$EnhancerByCG LIB$$8d1825bb is not an enhanced class


    Full Stack
    You can find the full stack in attachment
    Attached Files Attached Files

  2. #2
    Join Date
    Jun 2010
    Posts
    6

    Default

    Can you provide to us, MANIFEST.MF or template.mf (if you using bundlor)?

    For your dependencies why you not use:

    Code:
    <dependency>
        <groupId>org.springframework.flex</groupId>
        <artifactId>org.springframework.flex</artifactId>
    </dependency>

  3. #3

    Default

    Hi, Thanks for your reply.
    Actually, I had already replaced the dependency:

    Code:
    <dependency>
             <groupId>org.springframework.flex</groupId>
             <artifactId>spring-flex-core</artifactId>
    </dependency>
    by

    Code:
    <dependency>
             <groupId>org.springframework.flex</groupId>
             <artifactId>org.springframework.flex</artifactId>
     </dependency>
    Here are the MANIFEST.MF and template.mf contents:

    template.mf

    Code:
    Bundle-ManifestVersion: 2
    Bundle-SymbolicName: ui-war
    Web-ContextPath: ${web.context.path}
    Bundle-Version: ${project.version}
    Excluded-Imports: flex.messaging.*
    Excluded-Exports: flex.messaging.*,org.junit.*
    Import-Library: org.springframework.spring;version="3.0.5.RELEASE"
    Import-Template: org.springframework.*;version="[3.0, 3.1)"
    Import-Package: org.eclipse.virgo.web.dm;version="[2.0.0, 3.0.0)"

    MANIFEST.MF

    Code:
    Manifest-Version: 1.0
    Bundle-Version: 1.0.0.M2-SNAPSHOT
    Tool: Bundlor 1.0.0.RELEASE
    Import-Library: org.springframework.spring;version="3.0.5.RELEASE"
    Bundle-ManifestVersion: 2
    Web-ContextPath: ui
    Import-Package: javax.servlet,javax.servlet.http,org.eclipse.virgo.web.dm;version="[2.0.0, 3.0.0)",org.slf4j,
     org.springframework.web.context;version="[3.0, 3.1)",org.springframew
     ork.web.context.support;version="[3.0, 3.1)"
    Bundle-SymbolicName: ui-war

    Thanks again,

    Vince

  4. #4
    Join Date
    Jun 2010
    Posts
    6

    Default

    OK, if you use bundlor to create MANIFEST.MF from your template.mf

    can you try with:

    template.mf

    Code:
    Bundle-ManifestVersion: 2
    Bundle-SymbolicName: ui-war
    Web-ContextPath: ${web.context.path}
    Bundle-Version: ${project.version}
    Import-Template: org.springframework.*;version="[3.0, 3.1)"
    Import-Package: 
     javax.servlet.jsp.jstl.core;version="[1.1.2,1.2.0)",
     org.eclipse.virgo.web.dm;version="[2.0.0, 3.0.0)"
    Import-Bundle: 
     com.springsource.org.apache.taglibs.standard;version="[1.1.2,1.3)",
     org.springframework.flex;version="[1.0.3.RELEASE,1.0.3.RELEASE]",
     com.springsource.flex.messaging.common;version="[3.2.0.3978,3.2.0.3978]",
     com.springsource.flex.messaging;version="[3.2.0.3978,3.2.0.3978]",
     com.springsource.flex.messaging.services.remoting;version="[3.2.0.3978,3.2.0.3978]",
     com.springsource.net.sf.cglib;version="[2.1.3,2.1.3]"
    Import-Library: 
     org.springframework.spring;version="[3.0, 3.1)"
    I attach one example in this example flex + spring + osgi is successfully integrated jmax.zip

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •