Announcement Announcement Module
Collapse
No announcement yet.
STS 2.8.1 with tc-server - java.lang.ClassNotFoundException Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • STS 2.8.1 with tc-server - java.lang.ClassNotFoundException

    Hi all,

    I have STS 2.8.1 running to develop and test a Web application. The app uses MySQL as the database, and the application works fine running on a Tomcat Server using either STS 2.8.1 or Eclipse.

    However, when I try to start the same application on the integrated tc-server 2.6, I get the following error:

    Code:
    Caused by: javax.naming.NamingException: com.mysql.jdbc.Driver
    	at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
    	at org.apache.naming.NamingContext.lookup(NamingContext.java:145)
    	at org.apache.naming.NamingContext.lookup(NamingContext.java:814)
    	at org.apache.naming.NamingContext.lookup(NamingContext.java:145)
    	at org.apache.naming.NamingContext.lookup(NamingContext.java:814)
    	at org.apache.naming.NamingContext.lookup(NamingContext.java:145)
    	at org.apache.naming.NamingContext.lookup(NamingContext.java:814)
    	at org.apache.naming.NamingContext.lookup(NamingContext.java:159)
    	at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158)
    	at javax.naming.InitialContext.lookup(InitialContext.java:392)
    	at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:154)
    	at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:87)
    	at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:152)
    	at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
    	at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
    	at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
    	at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:201)
    	at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:187)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
    	... 20 more
    The MySQL J/Connector is published and available on the server and I have no idea what the issue here is.
    Thanks for any help!!

    Paul

  • #2
    Hello, and tried to install the mysql driver.

    Comment


    • #3
      Thanks, but the Driver is properly packaged in the "mysql-connector-java-5.1.18.jar" which is also published in the WEB-INF/lib folder of the Web application.

      As said the same application runs fine on Tomcat. The Driver class is loaded there properly, but not on the tc server.

      Comment


      • #4
        if you want to look up the pool using jndi the the jar file has to be in the lib directory, not in web-inf/lib
        that's how tomcat works. it. it could be that the eclipse/tomcat plugin masks this or you do have the jar in both places. but standalone tomcat, all jndi resources are loaded from tomcats libraries

        Comment

        Working...
        X