I am trying to do connection pooling on remote server(not database server) using JNDI, tomcat, Maven and etc. In details, I have two maven projects 1)Web application 2)Java Application in non maven Project and try to access the methods of Java Application from the Web Application. Here is the POM of two projects:
POM for Java Application
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.13</version>
</dependency>
</dependencies>
POM for WebApp
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.hello.simpleJavaApp</groupId>
<artifactId>SimpleJavaApp</artifactId>
<version>1.0-SNAPSHOT</version>
<!-- <scope>compile</scope> -->
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.13</version>
</dependency>
</dependencies>
<build>
<finalName>CPWebApp</finalName>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1-alpha-2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
web.xml of Web App:
<resource-env-ref>
<description>
Connection pooling on HSM.
</description>
<resource-env-ref-name>bean/CXIResourceLocator</resource-env-ref-name>
<resource-env-ref-type>
de.hello.CPWebApp.CXIBean
</resource-env-ref-type>
</resource-env-ref>
Now the problem is that I am not able to access the methods of Java Application(java.lang.ClassNotFoundException), since I have added the dependency in the web application's POM file. I am not getting any errors while compiling the both projects.
Waiting for your answer.