0

i have apps developed with netbeans using spring + spring security + hibernate and run in tomcat. i trying to move this project to Google App Engine so i decided to move it to eclipse cause i think it easier considering eclipse have plugins for GAE.

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory' defined in ServletContext resource [/WEB-INF/dispatcher-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
    Caused by: java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V

and this is my dispatcher servlet

    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:p="http://www.springframework.org/schema/p"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

        <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" />

        <bean id="myDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >
            <property name="driverClassName" value="org.springframework.jdbc.datasource.DriverManagerDataSource"/>
            <property name="url" value="jdbc:google:rdbms://instancename/databasename"/>

        </bean>



        <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
            <property name="dataSource" ref="myDataSource" />
            <property name="annotatedClasses">
                <list>
                    <value>com.pulsa.bean.User</value>
                    <value>com.pulsa.bean.Customer</value>
                    <value>com.pulsa.bean.TableID</value>
                    <value>com.pulsa.bean.Balance</value>
                    <value>com.pulsa.bean.Capital</value>
                    <value>com.pulsa.bean.Contact</value>
                    <value>com.pulsa.bean.Product</value>
                    <value>com.pulsa.bean.Provider</value>
                    <value>com.pulsa.bean.Supplier</value>
                    <value>com.pulsa.bean.Transactions</value>
                </list>
            </property> 
            <property name="hibernateProperties">
                <props>
                    <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
                    <prop key="hibernate.show_sql">true</prop>
                    <prop key="hibernate.hbm2ddl.auto">create</prop>
                </props>
            </property>  
        </bean>

        <bean id="myUserDAO" class="com.dao.UserDAOImpl">
            <property name="sessionFactory" ref="mySessionFactory"/>
        </bean>

        <bean id="myTableIDDAO" class="com.dao.TableIDDAOImpl">
            <property name="sessionFactory" ref="mySessionFactory"/>
        </bean>


        <bean class="com.util.SessionHelper" >
            <property name="userDAO" ref="myUserDAO" />
        </bean>

        <bean id="myBalanceDAO" class="com.dao.BalanceDAOImpl">
            <property name="sessionFactory" ref="mySessionFactory"/>
        </bean>

        <bean id="myCapitalDAO" class="com.dao.CapitalDAOImpl">
            <property name="sessionFactory" ref="mySessionFactory"/>
            <property name="balanceDAO" ref="myBalanceDAO" />
        </bean>

        <bean id="myContactDAO" class="com.dao.ContactDAOImpl">
            <property name="sessionFactory" ref="mySessionFactory"/>
        </bean>

        <bean id="myProductDAO" class="com.dao.ProductDAOImpl">
            <property name="sessionFactory" ref="mySessionFactory"/>
        </bean>

        <bean id="myProviderDAO" class="com.dao.ProviderDAOImpl">
            <property name="sessionFactory" ref="mySessionFactory"/>
        </bean>

        <bean id="mySupplierDAO" class="com.dao.SupplierDAOImpl">
            <property name="sessionFactory" ref="mySessionFactory"/>
        </bean>

        <bean id="myTransactionDAO" class="com.dao.TransactionDAOImpl">
            <property name="sessionFactory" ref="mySessionFactory"/>
        </bean>

        <bean id="myCustomerDAO" class="com.dao.CustomerDAOImpl">
            <property name="sessionFactory" ref="mySessionFactory"/>
        </bean>

        <bean id="pageMaster" class="com.pulsa.bean.Page"></bean>

        <bean id="pageTransaction" class="com.pulsa.bean.TransactionPage"></bean>

        <bean name="/user/*.htm" class="com.controller.UserController" >
            <property name="userDAO" ref="myUserDAO" />
            <property name="page">
                <ref local="pageMaster"/>
            </property>
        </bean>

        <bean name="/supplier/*.htm" class="com.controller.SupplierController" >
            <property name="supplierDAO" ref="mySupplierDAO" />
            <property name="page">
                <ref local="pageMaster"/>
            </property>
        </bean>

        <bean name="/common/*.htm" class="com.controller.LoginController" >
            <property name="userDAO" ref="myUserDAO" />
        </bean>

        <bean name="/customer/*.htm" class="com.controller.CustomerController" >
            <property name="customerDAO" ref="myCustomerDAO" />
            <property name="userDAO" ref="myUserDAO" />
            <property name="contactDAO" ref="myContactDAO" />
            <property name="providerDAO" ref="myProviderDAO" />
            <property name="page">
                <ref local="pageMaster"/>
            </property>
        </bean>

        <bean name="/transaction/*.htm" class="com.controller.TransactionController" >
            <property name="transactionDAO" ref="myTransactionDAO" />
            <property name="productDAO" ref="myProductDAO" />
            <property name="customerDAO" ref="myCustomerDAO" />
            <property name="contactDAO" ref="myContactDAO" />
            <property name="tableIDDAO" ref="myTableIDDAO" />
            <property name="balanceDAO" ref="myBalanceDAO" />
            <property name="page">
                <ref local="pageTransaction"/>
            </property>
        </bean>

        <bean name="/product/*.htm" class="com.controller.ProductController" >
            <property name="productDAO" ref="myProductDAO" />
            <property name="userDAO" ref="myUserDAO" />
            <property name="supplierDAO" ref="mySupplierDAO" />
            <property name="providerDAO" ref="myProviderDAO" />
            <property name="page">
                <ref local="pageMaster"/>
            </property>
        </bean>

        <bean name="/balance/*.htm" class="com.controller.BalanceController" >
            <property name="balanceDAO" ref="myBalanceDAO" />
            <property name="capitalDAO" ref="myCapitalDAO" />
            <property name="transactionDAO" ref="myTransactionDAO" />
            <property name="userDAO" ref="myUserDAO" />
            <property name="supplierDAO" ref="mySupplierDAO" />
            <property name="page">
                <ref local="pageMaster"/>
            </property>
        </bean>

        <bean name="/capital/*.htm" class="com.controller.CapitalController" >
            <property name="balanceDAO" ref="myBalanceDAO" />
            <property name="capitalDAO" ref="myCapitalDAO" />
            <property name="transactionDAO" ref="myTransactionDAO" />
            <property name="userDAO" ref="myUserDAO" />
            <property name="supplierDAO" ref="mySupplierDAO" />
            <property name="tableIDDAO" ref="myTableIDDAO" />
            <property name="page">
                <ref local="pageMaster"/>
            </property>
        </bean>

        <bean name="/json/*.htm" class="com.controller.JSONController" >
            <property name="customerDAO" ref="myCustomerDAO" />
            <property name="productDAO" ref="myProductDAO" />
        </bean>

    </beans>

and this is my class path

    /webpulsa/war/WEB-INF/lib/aopalliance-1.0.jar
    /webpulsa/war/WEB-INF/lib/commons-logging-1.1.1.jar
    /webpulsa/war/WEB-INF/lib/spring-aop-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/spring-asm-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/spring-beans-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/spring-context-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/spring-context-support-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/spring-core-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/spring-expression-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/spring-webmvc-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/antlr-2.7.6.jar
    /webpulsa/war/WEB-INF/lib/commons-collections-2.1.1.jar
    /webpulsa/war/WEB-INF/lib/dom4j-1.6.1.jar
    /webpulsa/war/WEB-INF/lib/ehcache-1.2.3.jar
    /webpulsa/war/WEB-INF/lib/hibernate-annotations.jar
    /webpulsa/war/WEB-INF/lib/hibernate-entitymanager.jar
    /webpulsa/war/WEB-INF/lib/hibernate-tools.jar
    /webpulsa/war/WEB-INF/lib/hibernate3.jar
    /webpulsa/war/WEB-INF/lib/jdbc2_0-stdext.jar
    /webpulsa/war/WEB-INF/lib/jackson-annotations-2.0.1.jar
    /webpulsa/war/WEB-INF/lib/jackson-core-2.0.1.jar
    /webpulsa/war/WEB-INF/lib/jackson-databind-2.0.1.jar
    /webpulsa/war/WEB-INF/lib/json-lib-2.2.2-jdk15.jar
    /webpulsa/war/WEB-INF/lib/spring-security-acl-3.1.0.RC2-sources.jar
    /webpulsa/war/WEB-INF/lib/spring-security-acl-3.1.0.RC2.jar
    /webpulsa/war/WEB-INF/lib/spring-security-aspects-3.1.0.RC2-sources.jar
    /webpulsa/war/WEB-INF/lib/spring-security-aspects-3.1.0.RC2.jar
    /webpulsa/war/WEB-INF/lib/spring-security-cas-3.1.0.RC2-sources.jar
    /webpulsa/war/WEB-INF/lib/spring-security-cas-3.1.0.RC2.jar
    /webpulsa/war/WEB-INF/lib/spring-security-config-3.1.0.RC2-sources.jar
    /webpulsa/war/WEB-INF/lib/spring-security-config-3.1.0.RC2.jar
    /webpulsa/war/WEB-INF/lib/spring-security-core-3.1.0.RC2-sources.jar
    /webpulsa/war/WEB-INF/lib/spring-security-core-3.1.0.RC2.jar
    /webpulsa/war/WEB-INF/lib/spring-security-ldap-3.1.0.RC2-sources.jar
    /webpulsa/war/WEB-INF/lib/spring-security-ldap-3.1.0.RC2.jar
    /webpulsa/war/WEB-INF/lib/spring-security-openid-3.1.0.RC2-sources.jar
    /webpulsa/war/WEB-INF/lib/spring-security-openid-3.1.0.RC2.jar
    /webpulsa/war/WEB-INF/lib/spring-security-taglibs-3.1.0.RC2-sources.jar
    /webpulsa/war/WEB-INF/lib/spring-security-taglibs-3.1.0.RC2.jar
    /webpulsa/war/WEB-INF/lib/spring-security-web-3.1.0.RC2-sources.jar
    /webpulsa/war/WEB-INF/lib/spring-security-web-3.1.0.RC2.jar
    /webpulsa/war/WEB-INF/lib/spring-orm-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/spring-aspects-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/spring-jdbc-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/spring-jms-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/spring-oxm-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/spring-struts-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/spring-test-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/spring-tx-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/spring-webmvc-portlet-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/mysql-connector-java-5.1.17-bin.jar
    /webpulsa/war/WEB-INF/lib/spring-web-3.1.1.RELEASE.jar
    /webpulsa/war/WEB-INF/lib/hibernate-commons-annotations.jar
    /webpulsa/war/WEB-INF/lib/javassist.jar
    /webpulsa/war/WEB-INF/lib/cglib-2.2.jar
    /webpulsa/war/WEB-INF/lib/asm-attrs.jar
    /webpulsa/war/WEB-INF/lib/asm.jar

is there something wrong in my project? i also put that lib in my App Engine lib/impl and not working also...

ps: may be its related to Error : java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(I)V but i still not fix my project.. Please help.. thanks in advance.

1 Answer 1

1

A java.lang.NoSuchMethodError (in your case (java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V)) mean that the class (ClassWriter) exists, but the method (in your case: constructor with boolean argument) not.

This kind of error often occurs if there are incompatible libaries: One lib requires version x of lib B, but you have version y of lib B. And this two versions are not compatible.

If your project was running with Netbeans, but not with Eclipse then I guess you have modified the libs while moving the projects from one IDE to the other.

In your case the Class DebuggingClassWriter from cgilib-2.2.jar invoke in its constructor the constructor (with one boolean parameter) of its superclass ClassWriter from asm.jar (unfortunately you have not specified the version of the asm.jar you use). But I can tell you that for example asm-3.1.jar contains the constructor you need.

BTW: I use cglib-nodep-2.2.jar together with asm-3.1.jar, and it works

Sign up to request clarification or add additional context in comments.

1 Comment

Hey i try to replace asm library with asm-3.1.jar and cglib with cglib-nodep-2.2.jar and it works like a charm.. thank you so much :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.