Re: MySQL resource in Tomee 1.5.2

2013-11-06 Thread asif.tmcp
Just read your blog - you can ignore my previous post here. But my problem remains. Does the file naming convention has something to do with it? Does the file has to be named openejb.xml or resource.xml ??? -- View this message in context:

Re: MySQL resource in Tomee 1.5.2

2013-11-06 Thread asif.tmcp
I tried that - I still get the error. I noticed one line in the Tomee startup logs INFO: Configuring Service(id=Default JDBC Database, type=Resource, provider-id=Default JDBC Database) -- does this mean, it is loading the default Database?? -- View this message in context:

Re: MySQL resource in Tomee 1.5.2

2013-11-06 Thread asif.tmcp
I believe this is the same bug reported in https://issues.apache.org/jira/browse/TOMEE-924 I will try in 1.6.0 snapshot and check. -- View this message in context: http://openejb.979440.n4.nabble.com/MySQL-resource-in-Tomee-1-5-2-tp4665872p4666006.html Sent from the OpenEJB User mailing

Re: MySQL resource in Tomee 1.5.2

2013-11-05 Thread asif.tmcp
So if I understand you correctly the resource id should be same as the war name Are you suggesting this ? Resource id=quot;jdbc/lt;lt;bWAR-NAME* type=javax.sql.DataSource JdbcDriver com.mysql.jdbc.Driver JdbcUrl jdbc:mysql://localhost:3306/localdb

Re: MySQL resource in Tomee 1.5.2

2013-11-05 Thread Romain Manni-Bucau
if you war is called foo.war and your resource id is bar the jndi name was openejb:Resource/foo/bar IIRC Romain Manni-Bucau Twitter: @rmannibucau Blog: http://rmannibucau.wordpress.com/ LinkedIn: http://fr.linkedin.com/in/rmannibucau Github: https://github.com/rmannibucau 2013/11/5 asif.tmcp

Re: MySQL resource in Tomee 1.5.2

2013-11-03 Thread asif.tmcp
Just so that I am understanding this correctly, would it be possible for you to provide a resources.xml sample, the web.xml snippet and a small code for datasource from initialcontext lookup - ?? Mine are here :- Resources.xml ( in WEB-INF folder of deployed war) Resource id=jdbc/localDB

Re: MySQL resource in Tomee 1.5.2

2013-11-03 Thread asif.tmcp
Hi Romain, If I understand you correctly, you are saying that id and resource name do not match Here :- Resource id=quot;lt;bjdbc/localDB* type=javax.sql.DataSource JdbcDriver com.mysql.jdbc.Driver JdbcUrl jdbc:mysql://localhost:3306/localdb MaxActive 100

Re: MySQL resource in Tomee 1.5.2

2013-11-03 Thread Romain Manni-Bucau
Hi It was the app id (war name by default). In all cases it is written in the logs when the resource is created Le 3 nov. 2013 13:04, asif.tmcp asif.t...@gmail.com a écrit : Hi Romain, If I understand you correctly, you are saying that id and resource name do not match Here :- Resource

MySQL resource in Tomee 1.5.2

2013-11-02 Thread asif.tmcp
I am putting resources.xml in the WEB-INF Folder, with a resource configuration. Resource id=jdbc/localDB type=javax.sql.DataSource JdbcDriver com.mysql.jdbc.Driver JdbcUrl jdbc:mysql://localhost:3306/localdb MaxActive 100 MaxIdle 30

Re: MySQL resource in Tomee 1.5.2

2013-11-02 Thread Romain Manni-Bucau
Hi The error is linked to the binding of the resource: either an injection or a datasource name in persistence.xml Le 2 nov. 2013 08:50, asif.tmcp asif.t...@gmail.com a écrit : I am putting resources.xml in the WEB-INF Folder, with a resource configuration. Resource id=jdbc/localDB

Re: MySQL resource in Tomee 1.5.2

2013-11-02 Thread asif.tmcp
Hi Romain, Thanks for taking a look. But I am Not sure what you meant .. could you please elaborate. I have the resource configuration in tomee.xml and the following in web.xml. resource-ref descriptionMySQL Connection/description

Re: MySQL resource in Tomee 1.5.2

2013-11-02 Thread asif.tmcp
Sorry the code got messed up. The java code is as follows:- InitialContext ic = new InitialContext(); Context envCtx = (Context) ic.lookup(java:comp/env); DataSource ds = (DataSource)envCtx.lookup(jdbc/SentinelDB); -- View this message in context:

Re: MySQL resource in Tomee 1.5.2

2013-11-02 Thread Romain Manni-Bucau
Do you have logs saying a resource is adjusted? Le 2 nov. 2013 17:16, asif.tmcp asif.t...@gmail.com a écrit : Sorry the code got messed up. The java code is as follows:- InitialContext ic = new InitialContext(); Context envCtx = (Context) ic.lookup(java:comp/env);

Re: MySQL resource in Tomee 1.5.2

2013-11-02 Thread asif.tmcp
Nope, it just mentions creating a default database, although resources.xml exists:- Nov 02, 2013 3:27:08 PM org.apache.tomee.catalina.TomEEClassLoaderEnricher validateJarFile WARNING: jar 'D:\dev_wksd\eclipse-wksd\devel\Sentinel\war\WEB-INF\lib\hibernate-jpa-2.0-api-1.0.1.Final.jar' contains

Re: MySQL resource in Tomee 1.5.2

2013-11-02 Thread Romain Manni-Bucau
Cause id and resource name are different Le 2 nov. 2013 20:34, asif.tmcp asif.t...@gmail.com a écrit : Nope, it just mentions creating a default database, although resources.xml exists:- Nov 02, 2013 3:27:08 PM org.apache.tomee.catalina.TomEEClassLoaderEnricher validateJarFile WARNING: jar

Re: MySQL resource in Tomee 1.5.2

2013-11-02 Thread Romain Manni-Bucau
Ps: in 1.5.2 lookup of resource in resources.xml needed to add a prefix. Thats ok on trunk Le 2 nov. 2013 20:40, Romain Manni-Bucau rmannibu...@gmail.com a écrit : Cause id and resource name are different Le 2 nov. 2013 20:34, asif.tmcp asif.t...@gmail.com a écrit : Nope, it just mentions