java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V Exception in Mybatis + Spring + Junit Test

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V Exception in Mybatis + Spring + Junit Test

oopsoopskeke
I use 3.2.3 spring frame work, 3.1.0 mybatis, 1.1.0 mybatis-spring.
Using Eclipse, Running on server is no problem.
But when i test my service logic, i got error.
The structure of my project is like this.
src/main/java
    --- com.aaa.service
          UserService.java
          UserServiceImple.java
          FriendService.java
          FriendServiceImpl.java
    --- com.aaa.dao
          UserDao.java
          FriendDao.java

src/main/resrouces
     --- dao/mapper
         user.xml
         friend.xml

src/test/java
     --- com.aaa.test
          FriendServiceTest.java

src/test/resources
     --- test-root-context.xml
             

friend.xml mapper file is like this.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
       
<mapper namespace="com.aaa.dao.FriendDao">
        <delete id="deleteFriend" parameterType="int">
                DELETE FROM friend_table
                        WHERE userSeq1 = #{userSeq1}
        </delete>
</maaper>





And My test-context.xml is below.

<?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:context="http://www.springframework.org/schema/context"
        xmlns:tx="http://www.springframework.org/schema/tx" 
        xmlns:aop="http://www.springframework.org/schema/aop"
        xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
                http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
                http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd">
       
       
       
        <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
       
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <property name="url" value="jdbc:mysql://localhost:3306/aaa"/>
        <property name="username" value="aaa"/>
        <property name="password" value="aaa"/> 
        <property name="maxActive" value="20"/>
        <property name="maxIdle" value="10"/>
        <property name="validationQuery" value="select 1"/>

    </bean>

    <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="mapperLocations" value="classpath:dao/mapper/**/*.xml" />
    </bean>       
       
    <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
        <constructor-arg index="0" ref="sqlSessionFactory"/>
    </bean>

   
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>

    <tx:annotation-driven transaction-manager="transactionManager"/>

       
   
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="insert*"/>
            <tx:method name="start*"/>
            <tx:method name="add*"/>
            <tx:method name="update*"/>
            <tx:method name="delete*"/>
            <tx:method name="select*" read-only="true"/>
            <tx:method name="find*" read-only="true"/>
            <tx:method name="get*" read-only="true"/>
            <tx:method name="register*"/>
            <tx:method name="create*"/>
            <tx:method name="submit*"/>
            <tx:method name="request*"/>
            <tx:method name="join*"/>
        </tx:attributes>
    </tx:advice>
   
    <aop:config>
        <aop:advisor pointcut="execution(* *..*Service.*(..))" advice-ref="txAdvice"/>
    </aop:config>
   
    <bean id="userService" class="com.aaa.service.UserServiceImpl">
                <property name="sqlSession" ref="sqlSession" />
        </bean>
        <bean id="friendService" class="com.aaa.service.FriendServiceImpl">
                <property name="sqlSession" ref="sqlSession" />
        </bean>               
</beans>


/*   FriendServiceTest.java   */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath*:test-root-context.xml"})
public class FriendServiceTest {
        @Autowired
        private ApplicationContext context;
        @Autowired
        private FriendService friendService;
       
        private SqlSession sqlSession;
       
        private static final Logger logger = LoggerFactory.getLogger(FriendServiceTest.class);
       
        @Test
        public void mockTest() {}
}

When i run junit test case, I can see this error.
--------------------- error log ------------------------------------------------------------
ERROR: org.springframework.test.context.TestContextManager - Caught exception while allowing TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener@67de007d] to prepare test instance [com.laonbud.lovngo.test.service.FriendServiceTest@1ff243d1]
java.lang.IllegalStateException: Failed to load ApplicationContext
        at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99)
        at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:122)
        at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:105)
        at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:74)
        at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:312)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:284)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
        at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in URL [file:/F:/Git/aaa/aaa/target/test-classes/test-root-context.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:608)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
        at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:120)
        at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
        at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)
        at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:248)
        at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64)
        at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91)
        ... 25 more
Caused by: java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V
        at org.apache.xpath.jaxp.XPathImpl.eval(XPathImpl.java:207)
        at org.apache.xpath.jaxp.XPathImpl.evaluate(XPathImpl.java:281)
        at org.apache.ibatis.parsing.XPathParser.evaluate(XPathParser.java:204)
        at org.apache.ibatis.parsing.XPathParser.evalNode(XPathParser.java:195)
        at org.apache.ibatis.parsing.XPathParser.evalNode(XPathParser.java:191)
        at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:75)
        at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:259)
        at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:182)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)
        ... 40 more





I checked build path, and i also ckecked output directories: aaa/target/classes, aaa/target/test-classses.
There are resource files, classes.
I searched by Google, Bind, etc. But I have no idea.
I guessed the mapper file is some thing wrong.
But it is weird that this program is working well on local server.
Only when i test using junit framework, I can see this error.
Please someone help me!!!!!
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V Exception in Mybatis + Spring + Junit Test

Eduardo Macarron
Seems it is not a problem with your XML files but with your XPath implementation.

Caused by: java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V

The apache xalan you are using may be too old.


2014-02-18 6:59 GMT+01:00 oopsoopskeke <[hidden email]>:
I use 3.2.3 spring frame work, 3.1.0 mybatis, 1.1.0 mybatis-spring.
Using Eclipse, Running on server is no problem.
But when i test my service logic, i got error.
The structure of my project is like this.
src/main/java
    --- com.aaa.service
          UserService.java
          UserServiceImple.java
          FriendService.java
          FriendServiceImpl.java
    --- com.aaa.dao
          UserDao.java
          FriendDao.java

src/main/resrouces
     --- dao/mapper
         user.xml
         friend.xml

src/test/java
     --- com.aaa.test
          FriendServiceTest.java

src/test/resources
     --- test-root-context.xml


friend.xml mapper file is like this.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
        &quot;http://mybatis.org/dtd/mybatis-3-mapper.dtd&quot;>

<mapper namespace="com.aaa.dao.FriendDao">
        <delete id="deleteFriend" parameterType="int">
                DELETE FROM friend_table
                        WHERE userSeq1 = #{userSeq1}
        </delete>
</maaper>





And My test-context.xml is below.

<?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:context="http://www.springframework.org/schema/context"
        xmlns:tx="http://www.springframework.org/schema/tx"
        xmlns:aop="http://www.springframework.org/schema/aop"
        xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
                http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
                http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.2.xsd
                http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.2.xsd">



        <bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">

        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <property name="url" value="jdbc:mysql://localhost:3306/aaa"/>
        <property name="username" value="aaa"/>
        <property name="password" value="aaa"/>
        <property name="maxActive"      value="20"/>
        <property name="maxIdle"        value="10"/>
        <property name="validationQuery" value="select 1"/>

    </bean>

    <bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="mapperLocations"
value="classpath:dao/mapper/**/*.xml" />
    </bean>

    <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
        <constructor-arg index="0" ref="sqlSessionFactory"/>
    </bean>


    <bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>

    <tx:annotation-driven transaction-manager="transactionManager"/>



    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="insert*"/>
            <tx:method name="start*"/>
            <tx:method name="add*"/>
            <tx:method name="update*"/>
            <tx:method name="delete*"/>
            <tx:method name="select*" read-only="true"/>
            <tx:method name="find*" read-only="true"/>
            <tx:method name="get*" read-only="true"/>
            <tx:method name="register*"/>
            <tx:method name="create*"/>
            <tx:method name="submit*"/>
            <tx:method name="request*"/>
            <tx:method name="join*"/>
        </tx:attributes>
    </tx:advice>

    <aop:config>
        <aop:advisor pointcut="execution(* *..*Service.*(..))"
advice-ref="txAdvice"/>
    </aop:config>

    <bean id="userService" class="com.aaa.service.UserServiceImpl">
                <property name="sqlSession" ref="sqlSession" />
        </bean>
        <bean id="friendService" class="com.aaa.service.FriendServiceImpl">
                <property name="sqlSession" ref="sqlSession" />
        </bean>
</beans>


/*   FriendServiceTest.java   */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath*:test-root-context.xml"})
public class FriendServiceTest {
        @Autowired
        private ApplicationContext context;
        @Autowired
        private FriendService friendService;

        private SqlSession sqlSession;

        private static final Logger logger =
LoggerFactory.getLogger(FriendServiceTest.class);

        @Test
        public void mockTest() {}
}

When i run junit test case, I can see this error.
--------------------- error log
------------------------------------------------------------
ERROR: org.springframework.test.context.TestContextManager - Caught
exception while allowing TestExecutionListener
[org.springframework.test.context.web.ServletTestExecutionListener@67de007d]
to prepare test instance
[com.laonbud.lovngo.test.service.FriendServiceTest@1ff243d1]
java.lang.IllegalStateException: Failed to load ApplicationContext
        at
org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99)
        at
org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:122)
        at
org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:105)
        at
org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:74)
        at
org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:312)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288)
        at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:284)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at
org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
        at
org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
        at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
        at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'sqlSessionFactory' defined in URL
[file:/F:/Git/aaa/aaa/target/test-classes/test-root-context.xml]: Invocation
of init method failed; nested exception is java.lang.NoSuchMethodError:
org.apache.xpath.XPathContext.<init>(Z)V
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
        at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
        at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:608)
        at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
        at
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:120)
        at
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
        at
org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)
        at
org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:248)
        at
org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64)
        at
org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91)
        ... 25 more
Caused by: java.lang.NoSuchMethodError:
org.apache.xpath.XPathContext.<init>(Z)V
        at org.apache.xpath.jaxp.XPathImpl.eval(XPathImpl.java:207)
        at org.apache.xpath.jaxp.XPathImpl.evaluate(XPathImpl.java:281)
        at
org.apache.ibatis.parsing.XPathParser.evaluate(XPathParser.java:204)
        at
org.apache.ibatis.parsing.XPathParser.evalNode(XPathParser.java:195)
        at
org.apache.ibatis.parsing.XPathParser.evalNode(XPathParser.java:191)
        at
org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:75)
        at
org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:259)
        at
org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:182)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)
        ... 40 more





I checked build path, and i also ckecked output directories:
aaa/target/classes, aaa/target/test-classses.
There are resource files, classes.
I searched by Google, Bind, etc. But I have no idea.
I guessed the mapper file is some thing wrong.
But it is weird that this program is working well on local server.
Only when i test using junit framework, I can see this error.
Please someone help me!!!!!



--
View this message in context: http://mybatis-user.963551.n3.nabble.com/java-lang-NoSuchMethodError-org-apache-xpath-XPathContext-init-Z-V-Exception-in-Mybatis-Spring-Junitt-tp4027758.html
Sent from the mybatis-user mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V Exception in Mybatis + Spring + Junit Test

Mukarram
In reply to this post by oopsoopskeke
Since it is running fine when on the server and only a problem when running the test cases, check the test classpath. As Eduardo pointed out the problem seems to be with xalan and you can check the dependency hierarchy for your project in the test scope to see which version of xalan is getting pulled in. 

On Tuesday, 18 February 2014 11:29:10 UTC+5:30, oopsoopskeke wrote:
I use 3.2.3 spring frame work, 3.1.0 mybatis, 1.1.0 mybatis-spring.
Using Eclipse, Running on server is no problem.
But when i test my service logic, i got error.
The structure of my project is like this.
src/main/java
    --- com.aaa.service
          UserService.java
          UserServiceImple.java
          FriendService.java
          FriendServiceImpl.java
    --- com.aaa.dao
          UserDao.java
          FriendDao.java

src/main/resrouces
     --- dao/mapper
         user.xml
         friend.xml

src/test/java
     --- com.aaa.test
          FriendServiceTest.java

src/test/resources
     --- test-root-context.xml
             

friend.xml mapper file is like this.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC &quot;-//<a href="http://mybatis.org//DTD" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fmybatis.org%2F%2FDTD\46sa\75D\46sntz\0751\46usg\75AFQjCNHjp-E8UL0TmmS7A0V54yMfbtfEkA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fmybatis.org%2F%2FDTD\46sa\75D\46sntz\0751\46usg\75AFQjCNHjp-E8UL0TmmS7A0V54yMfbtfEkA';return true;">mybatis.org//DTD Mapper 3.0//EN&quot;
        &quot;<a href="http://mybatis.org/dtd/mybatis-3-mapper.dtd&amp;quot" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fmybatis.org%2Fdtd%2Fmybatis-3-mapper.dtd%26quot\46sa\75D\46sntz\0751\46usg\75AFQjCNFwXSIO2EBp75J9bLVeNzeZhpraPQ';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fmybatis.org%2Fdtd%2Fmybatis-3-mapper.dtd%26quot\46sa\75D\46sntz\0751\46usg\75AFQjCNFwXSIO2EBp75J9bLVeNzeZhpraPQ';return true;">http://mybatis.org/dtd/mybatis-3-mapper.dtd&quot;>
       
<mapper namespace="com.aaa.dao.FriendDao">
        <delete id="deleteFriend" parameterType="int">
                DELETE FROM friend_table
                        WHERE userSeq1 = #{userSeq1}
        </delete>
</maaper>





And My test-context.xml is below.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="<a href="http://www.springframework.org/schema/beans" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Fbeans\46sa\75D\46sntz\0751\46usg\75AFQjCNEba2DqAxzvjuMQudSkZ6aRkHfcQA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Fbeans\46sa\75D\46sntz\0751\46usg\75AFQjCNEba2DqAxzvjuMQudSkZ6aRkHfcQA';return true;">http://www.springframework.org/schema/beans"
        xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance\46sa\75D\46sntz\0751\46usg\75AFQjCNFERp6A_kcvqihMCKJ7EHX8O14vIA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema-instance\46sa\75D\46sntz\0751\46usg\75AFQjCNFERp6A_kcvqihMCKJ7EHX8O14vIA';return true;">http://www.w3.org/2001/XMLSchema-instance"
        xmlns:context="<a href="http://www.springframework.org/schema/context" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Fcontext\46sa\75D\46sntz\0751\46usg\75AFQjCNF05s5cRcjRQUYYRxtBfmdMiXtgBg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Fcontext\46sa\75D\46sntz\0751\46usg\75AFQjCNF05s5cRcjRQUYYRxtBfmdMiXtgBg';return true;">http://www.springframework.org/schema/context"
        xmlns:tx="<a href="http://www.springframework.org/schema/tx" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Ftx\46sa\75D\46sntz\0751\46usg\75AFQjCNEKdXNn8ievSfOJvlcsAm__IyI78Q';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Ftx\46sa\75D\46sntz\0751\46usg\75AFQjCNEKdXNn8ievSfOJvlcsAm__IyI78Q';return true;">http://www.springframework.org/schema/tx"  
        xmlns:aop="<a href="http://www.springframework.org/schema/aop" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Faop\46sa\75D\46sntz\0751\46usg\75AFQjCNFIGF7bzs1x0DdYY_ELFHYjfaV59A';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Faop\46sa\75D\46sntz\0751\46usg\75AFQjCNFIGF7bzs1x0DdYY_ELFHYjfaV59A';return true;">http://www.springframework.org/schema/aop"
        xsi:schemaLocation="<a href="http://www.springframework.org/schema/beans" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Fbeans\46sa\75D\46sntz\0751\46usg\75AFQjCNEba2DqAxzvjuMQudSkZ6aRkHfcQA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Fbeans\46sa\75D\46sntz\0751\46usg\75AFQjCNEba2DqAxzvjuMQudSkZ6aRkHfcQA';return true;">http://www.springframework.org/schema/beans
<a href="http://www.springframework.org/schema/beans/spring-beans-3.2.xsd" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Fbeans%2Fspring-beans-3.2.xsd\46sa\75D\46sntz\0751\46usg\75AFQjCNHahW-AzIlnEK0N2jDOxMJv3iQhYQ';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Fbeans%2Fspring-beans-3.2.xsd\46sa\75D\46sntz\0751\46usg\75AFQjCNHahW-AzIlnEK0N2jDOxMJv3iQhYQ';return true;">http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
                <a href="http://www.springframework.org/schema/tx" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Ftx\46sa\75D\46sntz\0751\46usg\75AFQjCNEKdXNn8ievSfOJvlcsAm__IyI78Q';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Ftx\46sa\75D\46sntz\0751\46usg\75AFQjCNEKdXNn8ievSfOJvlcsAm__IyI78Q';return true;">http://www.springframework.org/schema/tx
<a href="http://www.springframework.org/schema/tx/spring-tx-3.2.xsd" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Ftx%2Fspring-tx-3.2.xsd\46sa\75D\46sntz\0751\46usg\75AFQjCNEQxPCzv-e556IG_nEiaqKnVGm6Gw';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Ftx%2Fspring-tx-3.2.xsd\46sa\75D\46sntz\0751\46usg\75AFQjCNEQxPCzv-e556IG_nEiaqKnVGm6Gw';return true;">http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
                <a href="http://www.springframework.org/schema/context" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Fcontext\46sa\75D\46sntz\0751\46usg\75AFQjCNF05s5cRcjRQUYYRxtBfmdMiXtgBg';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Fcontext\46sa\75D\46sntz\0751\46usg\75AFQjCNF05s5cRcjRQUYYRxtBfmdMiXtgBg';return true;">http://www.springframework.org/schema/context
<a href="http://www.springframework.org/schema/context/spring-context-3.2.xsd" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Fcontext%2Fspring-context-3.2.xsd\46sa\75D\46sntz\0751\46usg\75AFQjCNGIsnK1Ene-tbdB2LQ8Crm9WNgG6w';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Fcontext%2Fspring-context-3.2.xsd\46sa\75D\46sntz\0751\46usg\75AFQjCNGIsnK1Ene-tbdB2LQ8Crm9WNgG6w';return true;">http://www.springframework.org/schema/context/spring-context-3.2.xsd
                <a href="http://www.springframework.org/schema/aop" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Faop\46sa\75D\46sntz\0751\46usg\75AFQjCNFIGF7bzs1x0DdYY_ELFHYjfaV59A';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Faop\46sa\75D\46sntz\0751\46usg\75AFQjCNFIGF7bzs1x0DdYY_ELFHYjfaV59A';return true;">http://www.springframework.org/schema/aop
<a href="http://www.springframework.org/schema/aop/spring-aop-3.2.xsd" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Faop%2Fspring-aop-3.2.xsd\46sa\75D\46sntz\0751\46usg\75AFQjCNEh73P7aZRQhtn4PpbVpEabm0m_gw';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.springframework.org%2Fschema%2Faop%2Fspring-aop-3.2.xsd\46sa\75D\46sntz\0751\46usg\75AFQjCNEh73P7aZRQhtn4PpbVpEabm0m_gw';return true;">http://www.springframework.org/schema/aop/spring-aop-3.2.xsd">
       
       
       
        <bean id="dataSource"
class="org.apache.commons.dbcp.BasicDataSource">
       
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <property name="url" value="jdbc:mysql://localhost:3306/aaa"/>
        <property name="username" value="aaa"/>
        <property name="password" value="aaa"/>  
        <property name="maxActive"        value="20"/>
        <property name="maxIdle"        value="10"/>
        <property name="validationQuery" value="select 1"/>

    </bean>

    <bean id="sqlSessionFactory"
class="org.mybatis.spring.SqlSessionFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="mapperLocations"
value="classpath:dao/mapper/**/*.xml" />
    </bean>        
       
    <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
        <constructor-arg index="0" ref="sqlSessionFactory"/>
    </bean>

   
    <bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>

    <tx:annotation-driven transaction-manager="transactionManager"/>

       
   
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="insert*"/>
            <tx:method name="start*"/>
            <tx:method name="add*"/>
            <tx:method name="update*"/>
            <tx:method name="delete*"/>
            <tx:method name="select*" read-only="true"/>
            <tx:method name="find*" read-only="true"/>
            <tx:method name="get*" read-only="true"/>
            <tx:method name="register*"/>
            <tx:method name="create*"/>
            <tx:method name="submit*"/>
            <tx:method name="request*"/>
            <tx:method name="join*"/>
        </tx:attributes>
    </tx:advice>
   
    <aop:config>
        <aop:advisor pointcut="execution(* *..*Service.*(..))"
advice-ref="txAdvice"/>
    </aop:config>
   
    <bean id="userService" class="com.aaa.service.UserServiceImpl">
                <property name="sqlSession" ref="sqlSession" />
        </bean>
        <bean id="friendService" class="com.aaa.service.FriendServiceImpl">
                <property name="sqlSession" ref="sqlSession" />
        </bean>                
</beans>


/*   FriendServiceTest.java   */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({"classpath*:test-root-context.xml"})
public class FriendServiceTest {
        @Autowired
        private ApplicationContext context;
        @Autowired
        private FriendService friendService;
       
        private SqlSession sqlSession;
       
        private static final Logger logger =
LoggerFactory.getLogger(FriendServiceTest.class);
       
        @Test
        public void mockTest() {}
}

When i run junit test case, I can see this error.
--------------------- error log
------------------------------------------------------------
ERROR: org.springframework.test.context.TestContextManager - Caught
exception while allowing TestExecutionListener
[org.springframework.test.context.web.ServletTestExecutionListener@67de007d]
to prepare test instance
[com.laonbud.lovngo.test.service.FriendServiceTest@1ff243d1]
java.lang.IllegalStateException: Failed to load ApplicationContext
        at
org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99)
        at
org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:122)
        at
org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:105)
        at
org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:74)
        at
org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:312)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:211)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:288)
        at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:284)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
        at
org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
        at
org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
        at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
        at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
        at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'sqlSessionFactory' defined in URL
[file:/F:/Git/aaa/aaa/target/test-classes/test-root-context.xml]: Invocation
of init method failed; nested exception is java.lang.NoSuchMethodError:
org.apache.xpath.XPathContext.<init>(Z)V
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
        at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
        at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:608)
        at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
        at
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:120)
        at
org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
        at
org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:100)
        at
org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:248)
        at
org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContextInternal(CacheAwareContextLoaderDelegate.java:64)
        at
org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:91)
        ... 25 more
Caused by: java.lang.NoSuchMethodError:
org.apache.xpath.XPathContext.<init>(Z)V
        at org.apache.xpath.jaxp.XPathImpl.eval(XPathImpl.java:207)
        at org.apache.xpath.jaxp.XPathImpl.evaluate(XPathImpl.java:281)
        at
org.apache.ibatis.parsing.XPathParser.evaluate(XPathParser.java:204)
        at
org.apache.ibatis.parsing.XPathParser.evalNode(XPathParser.java:195)
        at
org.apache.ibatis.parsing.XPathParser.evalNode(XPathParser.java:191)
        at
org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:75)
        at
org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:259)
        at
org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:182)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1541)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)
        ... 40 more





I checked build path, and i also ckecked output directories:
aaa/target/classes, aaa/target/test-classses.
There are resource files, classes.
I searched by Google, Bind, etc. But I have no idea.
I guessed the mapper file is some thing wrong.
But it is weird that this program is working well on local server.
Only when i test using junit framework, I can see this error.
Please someone help me!!!!!



--
View this message in context: <a href="http://mybatis-user.963551.n3.nabble.com/java-lang-NoSuchMethodError-org-apache-xpath-XPathContext-init-Z-V-Exception-in-Mybatis-Spring-Junitt-tp4027758.html" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fmybatis-user.963551.n3.nabble.com%2Fjava-lang-NoSuchMethodError-org-apache-xpath-XPathContext-init-Z-V-Exception-in-Mybatis-Spring-Junitt-tp4027758.html\46sa\75D\46sntz\0751\46usg\75AFQjCNElJkBzpsPJsChoLpztFFYImR5G5Q';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fmybatis-user.963551.n3.nabble.com%2Fjava-lang-NoSuchMethodError-org-apache-xpath-XPathContext-init-Z-V-Exception-in-Mybatis-Spring-Junitt-tp4027758.html\46sa\75D\46sntz\0751\46usg\75AFQjCNElJkBzpsPJsChoLpztFFYImR5G5Q';return true;">http://mybatis-user.963551.n3.nabble.com/java-lang-NoSuchMethodError-org-apache-xpath-XPathContext-init-Z-V-Exception-in-Mybatis-Spring-Junitt-tp4027758.html
Sent from the mybatis-user mailing list archive at Nabble.com.

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V Exception in Mybatis + Spring + Junit Test

Rika
This post has NOT been accepted by the mailing list yet.
In reply to this post by Eduardo Macarron
Thank you so much Eduardo, replacing the latest xalan jar worked.