login button

Unable to load bytecode

Forums :

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>

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

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

Solution

Thank mccloud35.

At last, I found the problem is I lost the tomcat-weaver.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.