Hi, I don't know if it is appreciated the cross posting, but I
posted a question on Stackoverflow. Then I realised that
another similar question was posted before. So I searched how to get support and found this group.
Basically, I tried to configure a datasource using this configuration:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven3-plugin</artifactId>
<version>1.10.4</version>
<configuration>
<container>
<containerId>tomcat7x</containerId>
<zipUrlInstaller>
<url>https://repo.maven.apache.org/maven2/org/apache/tomcat/tomcat/7.0.55/tomcat-7.0.55.zip</url>
</zipUrlInstaller>
<timeout>600000</timeout>
<output>${project.build.directory}/tomcat7x/container.log</output>
<append>false</append>
<log>${project.build.directory}/tomcat7x/cargo.log</log>
<dependencies>
[...] some dependencies like mysql, etc...
</dependencies>
</container>
<configuration>
<type>standalone</type>
<home>${project.build.directory}/tomcat7x/catalina-base</home>
<properties>
<cargo.jvmargs>-Xmx4096m</cargo.jvmargs>
<cargo.datasource.datasource.mysql>
cargo.datasource.driver=com.mysql.jdbc.Driver|
cargo.datasource.url=jdbc:mysql://server:3306/app|
cargo.datasource.jndi=jdbc/app|
cargo.datasource.username=ignore|
cargo.datasource.password=ignore
</cargo.datasource.datasource.mysql>
</properties>
<configfiles>
<configfile>
<file>${project.basedir}/src/test/resources/tomcat7/tomcat-users.xml</file>
<todir>conf</todir>
</configfile>
<configfile>
<file>${project.basedir}/src/test/resources/tomcat7/context.xml</file>
<todir>conf</todir>
</configfile>
</configfiles>
</configuration>
</configuration>
</plugin>
but when I run cargo I obtained a:
SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mosesEntityManagerFactory' defined in class path resource [app-logic.xml]: Cannot resolve reference to bean 'appDataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'appDataSource' defined in class path resource [logic-datasource.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name [jdbc/app] is not bound in this Context. Unable to find [jdbc].
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:334)
...
The content of that file logic-datasource.xml mentioned in the exception is:
So the problem seems to be that the datasource is not added to the jndi OR that I am not referring to it in the right way. Unfortunately I am unable to understand what's happening.
Do you know what I am doing wrong or something I can do in cargo to debug what's happening?
Thanks
Regards
R
P.S. the reason I am using such older versions is because I am inherited a very legacy project that didn't even compile anymore since yesterday