Tomcat 8, axis2 webservices aar, spring jndi not bound in context

后端 未结 1 840
甜味超标
甜味超标 2021-01-07 03:08

I have been working on an issue where JNDI name is not found in the context an axis2 webservice is running. This issue is only in Tomcat 8 when I use spring. Some details:

相关标签:
1条回答
  • 2021-01-07 03:49

    @bplso I had the same issue when I upgrade tomcat7 to tomcat8.5 on a axis2 project, try the steps given in image. It may be solve your issue. !

    Step 1: Specify the connection resource in server.xml inside <GlobalNamingResources> like 
    <Resource name="jdbc/name" 
    global="jdbc/name" 
    factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" 
    auth="Container" 
    type="javax.sql.DataSource" 
    username="xxx" 
    password="YYY" 
    driverClassName="net.sourceforge.jtds.jdbc.Driver" 
    url="jdbc:jtds:sqlserver://host:port/dbname" 
    maxTotal="10" 
    maxIdle="10" 
    maxWaitMillis="10000" /> 
    
    
    Step 2: Specify the resource reference in web.xml inside the <web-app> like 
    
    <resource-ref> 
    <description> This is a reference to the global Resource for SQL database connetion. </description> 
    <res-ref-name>jdbc/name</res-ref-name> 
    <res-type>javax.sql.DataSource</res-type> 
    <res-auth>Container</res-auth> 
    </resource-ref> 
    
    
    Step 3: Create a context.xml file and paste it in your project/META-INF/ path as below 
    
    <?xml version=.1.0 encoding="UTF-8.?> 
    <Context> 
    <ResourceLink name="jdbc/name" global="jdbc/name" type="javax.sgl.DataSource" 
    </Context>
    
    0 讨论(0)
提交回复
热议问题