Unable to load bytecode

fayhong's picture

I got some problem in my WSF/Spring

I followed tutorial and setted my applicationContext

But I got a "Unable to load bytecode for class" exception

 

who can tell me how to fix it?

 

Exception is:

org.apache.axis2.deployment.DeploymentException:
The following error occurred during schema generation:
Unable to load bytecode for class
    com.softleader.wstest.ws.EchoWS$$EnhancerByCGLIB$$c67cae4b
        at org.wso2.spring.ws.axis2.SpringWebServiceBuilder.populateService(SpringWebServiceBuilder.java:194)
        at org.wso2.spring.ws.servlet.SpringAxis2Servlet.init(SpringAxis2Servlet.java:85)
       .....

 

And my applicationContext setting is:

    <!-- Import WSO2 config -->
    <import resource="classpath:axis2Config.xml"/>

    <!-- Import DAO Configuration -->
    <import resource="classpath:daoContext.xml"/>

    <!-- WSO2 WebService Bean Configuration -->
    <bean id="services" class="org.wso2.spring.ws.WebServices">
        <property name="services">
            <list>
                <bean id="echoService" class="org.wso2.spring.ws.SpringWebService">
                    <property name="serviceBean" ref="echoWS"></property>
                    <property name="serviceName" value="EchoService"></property>
                </bean>
                <bean id="userService" class="org.wso2.spring.ws.SpringWebService">
                    <property name="serviceBean" ref="userWS"></property>
                    <property name="serviceName" value="UserService"></property>
                </bean>
            </list>
        </property>
    </bean>

    <!-- Endpoint Definition -->
    <bean id="echoWS" class="com.softleader.wstest.ws.EchoWS">
        <property name="service" ref="echoBO" />
    </bean>

    <bean id="userWS" class="com.softleader.wstest.ws.UserWS">
        <property name="service" ref="userBO" />
    </bean>

    <!-- Service Definition -->
    <bean id="echoBO" class="com.softleader.wstest.service.impl.EchoServiceImpl" />

    <bean id="userBO" class="com.softleader.wstest.service.impl.UserServiceImpl">
        <property name="dao" ref="userDAO" />
    </bean>

 

web.xml setting:

    <!-- Spring Context Settings -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/classes/applicationContext.xml</param-value>
    </context-param>
   
    <display-name>Apache-Axis2</display-name>

    <servlet>
        <servlet-name>axis2</servlet-name>
        <servlet-class>
            org.wso2.spring.ws.servlet.SpringAxis2Servlet
        </servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>axis2</servlet-name>
        <url-pattern>/axis2/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>axis2</servlet-name>
        <url-pattern>/services/*</url-pattern>
    </servlet-mapping>
mccloud35's picture

It seems that the problem is

It seems that the problem is the class your trying to expose, EchoWS. It should be a Spring bean. Can you directly expose EchoBO if you give ti as the parameter to serviceBean (in echoService)? You have currently given echoWS as the parameter. Regards, Tharindu
fayhong's picture

Solution

Thank mccloud35. At last, I found the problem is I lost the tomcat-weaver.
shihan.iqbal.gmail.com's picture

Same Error upon using the Spring AOP

Hi Mattews , Only new thing im doing is that, including spring Around aspect to the Applicationcontext.xml and using that proxied bean id from the Aspect to the service bean of the Axis SrpingWS class. Upon deplyoing im getting the following Error . Would highly appreciate is you could please help me out with a solution. Regards, Shihan Error im getting while deploying is , ------------------------------------- - Deploying module: rampart-1.4 - file:/C:/TomCat/apache-tomcat-6.0.29/webapps/WSFSpringHelloWorld/WEB-INF/lib/rampart-1.4.mar org.apache.axis2.deployment.DeploymentException: The following error occurred during schema generation: Unable to load bytecode for class $Proxy28 at org.wso2.spring.ws.axis2.SpringWebServiceBuilder.populateService(SpringWebServiceBuilder.java:343) at org.wso2.spring.ws.servlet.SpringAxis2Servlet.init(SpringAxis2Servlet.java:95) at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993) applicationContext.xml, ------------------------- <?xml version="1.0" encoding="UTF-8"?> pointcut.advisor1 ----------------------------------------------------------------------------------- Web.xml is same as above.
shihan.iqbal.gmail.com's picture

ApplicationContext is attached of the Spring AOP

applicationContext.xml, ------------------------- pointcut.advisor1
library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
Different groups within an organization need to monitor different Key Performance Indicators (KPIs) - An operations team will be interested in the response times of business services and loads of each service,..
Thursday, February 9th 2012, 09.00 AM (PST)

Thursday, February 9th 2012, 10.00 AM (GMT)