Discussion:
After update tomee version ,getting error "jdbc/mydb is not bound in this Context"
ishwar
2018-03-04 14:37:46 UTC
Permalink
After updating the tomee version from apache-tomee-jaxrs-1.5.2 To
apache-tomee-jaxrs-1.7.4, Getting following exception on thread but there
are other code is executing without thread its working fine.

Name [jdbc/mydb] is not bound in this Context. Unable to find [jdbc].
com.test.test1.PolicyManager-:getUserPreferences: java.sql.SQLException:
PooledConnection has already been closed.


apache-tomee-jaxrs-1.5.2 ->tomee.xml file.


<Resource id="jdbc/mydb1" type="DataSource">
JdbcDriver com.mysql.jdbc.jdbc2.optional.MysqlDataSource
JdbcUrl jdbc:mysql://localhost:3306/demmo
UserName root
Password root
JtaManaged false
InitialSize 50
MaxActive 100
MaxIdle 3
LogAbandoned true
</Resource>

apache-tomee-jaxrs-1.7.4-> tomee.xml file.

<Resource id="jdbc/mydb" type="javax.sql.DataSource">
JdbcDriver com.mysql.jdbc.Driver
JdbcUrl jdbc:mysql://localhost:3306/demo
UserName root
Password root
JtaManaged false
InitialSize 50
MaxActive 100
MaxIdle 3
LogAbandoned true
</Resource>

Web.xml is same. Likes following.
<resource-ref>
<description>MySQL Datasource example</description>
<res-ref-name>jdbc/mydb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
</resource-ref>

The error is coming when the web Applicaiton creating the new thread for
sending the notificaiton.

The same code is working on older version of apache tomee but on new version
it is not working.

any suggestion?




--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
Romain Manni-Bucau
2018-03-04 14:41:34 UTC
Permalink
Hi

did you ensure you have the right contextclassloader in the threads you
create - the webapp one? If not it can not work deterministicly.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> | Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>
Post by ishwar
After updating the tomee version from apache-tomee-jaxrs-1.5.2 To
apache-tomee-jaxrs-1.7.4, Getting following exception on thread but there
are other code is executing without thread its working fine.
Name [jdbc/mydb] is not bound in this Context. Unable to find [jdbc].
PooledConnection has already been closed.
apache-tomee-jaxrs-1.5.2 ->tomee.xml file.
<Resource id="jdbc/mydb1" type="DataSource">
JdbcDriver com.mysql.jdbc.jdbc2.optional.MysqlDataSource
JdbcUrl jdbc:mysql://localhost:3306/demmo
UserName root
Password root
JtaManaged false
InitialSize 50
MaxActive 100
MaxIdle 3
LogAbandoned true
</Resource>
apache-tomee-jaxrs-1.7.4-> tomee.xml file.
<Resource id="jdbc/mydb" type="javax.sql.DataSource">
JdbcDriver com.mysql.jdbc.Driver
JdbcUrl jdbc:mysql://localhost:3306/demo
UserName root
Password root
JtaManaged false
InitialSize 50
MaxActive 100
MaxIdle 3
LogAbandoned true
</Resource>
Web.xml is same. Likes following.
<resource-ref>
<description>MySQL Datasource example</description>
<res-ref-name>jdbc/mydb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
</resource-ref>
The error is coming when the web Applicaiton creating the new thread for
sending the notificaiton.
The same code is working on older version of apache tomee but on new version
it is not working.
any suggestion?
--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-
f979441.html
ishwar
2018-03-04 13:43:52 UTC
Permalink
After updating the tomee version from apache-tomee-jaxrs-1.5.2 To
apache-tomee-jaxrs-1.7.4, Getting following exception on thread but there
are other code is executing without thread its working fine.Name [jdbc/mydb]
is not bound in this Context. Unable to find
[jdbc].com.test.test1.PolicyManager-:getUserPreferences:
java.sql.SQLException: PooledConnection has already been
closed.apache-tomee-jaxrs-1.5.2 ->tomee.xml file. JdbcDriver
com.mysql.jdbc.jdbc2.optional.MysqlDataSource JdbcUrl
jdbc:mysql://localhost:3306/demo UserName root Password root JtaManaged
false InitialSize 50 MaxActive 100 MaxIdle 3 LogAbandoned
trueapache-tomee-jaxrs-1.7.4-> tomee.xml file. JdbcDriver
com.mysql.jdbc.Driver JdbcUrl jdbc:mysql://localhost:3306/demo
UserName root Password root JtaManaged false InitialSize 50
MaxActive 100 MaxIdle 3 LogAbandoned trueWeb.xml is same. Likes following.
MySQL Datasource example jdbc/mydb javax.sql.DataSourceThe error is coming
when the web Applicaiton creating the new thread for sending the
notificaiton.The same code is working on older version of apache tomee but
on new version, it is not working.any suggestion?



--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
ishwar
2018-03-04 13:43:03 UTC
Permalink
After updating the tomee version from apache-tomee-jaxrs-1.5.2 To
apache-tomee-jaxrs-1.7.4, Getting following exception on thread but there
are other code is executing without thread its working fine.

Name [jdbc/mydb] is not bound in this Context. Unable to find [jdbc].
com.test.test1.PolicyManager-:getUserPreferences: java.sql.SQLException:
PooledConnection has already been closed.


apache-tomee-jaxrs-1.5.2 ->tomee.xml file.


<Resource id="jdbc/mydb1" type="DataSource">
JdbcDriver com.mysql.jdbc.jdbc2.optional.MysqlDataSource
JdbcUrl jdbc:mysql://localhost:3306/demo
UserName root
Password root
JtaManaged false
InitialSize 50
MaxActive 100
MaxIdle 3
LogAbandoned true
</Resource>

apache-tomee-jaxrs-1.7.4-> tomee.xml file.

<Resource id="jdbc/mydb" type="javax.sql.DataSource">
JdbcDriver com.mysql.jdbc.Driver
JdbcUrl jdbc:mysql://localhost:3306/demo
UserName root
Password root
JtaManaged false
InitialSize 50
MaxActive 100
MaxIdle 3
LogAbandoned true
</Resource>

Web.xml is same. Likes following.
<resource-ref>
<description>MySQL Datasource example</description>
<res-ref-name>jdbc/mydb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
</resource-ref>

The error is coming when the web Applicaiton creating the new thread for
sending the notificaiton.

The same code is working on older version of apache tomee but on new
version, it is not working.

any suggestion?




--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
ishwar
2018-03-04 13:25:06 UTC
Permalink
After updating the tomee version from apache-tomee-jaxrs-1.5.2 To
apache-tomee-jaxrs-1.7.4, Getting following exception on thread but there
are other code is executing without thread its working fine.

Name [jdbc/mydb] is not bound in this Context. Unable to find [jdbc].
com.test.test1.PolicyManager-:getUserPreferences: java.sql.SQLException:
PooledConnection has already been closed.


apache-tomee-jaxrs-1.5.2 ->tomee.xml file.


<Resource id="jdbc/mydb1" type="DataSource">
JdbcDriver com.mysql.jdbc.jdbc2.optional.MysqlDataSource
JdbcUrl jdbc:mysql://localhost:3306/demmo
UserName root
Password root
JtaManaged false
InitialSize 50
MaxActive 100
MaxIdle 3
LogAbandoned true
</Resource>

apache-tomee-jaxrs-1.7.4-> tomee.xml file.

<Resource id="jdbc/mydb" type="javax.sql.DataSource">
JdbcDriver com.mysql.jdbc.Driver
JdbcUrl jdbc:mysql://localhost:3306/demo
UserName root
Password root
JtaManaged false
InitialSize 50
MaxActive 100
MaxIdle 3
LogAbandoned true
</Resource>

Web.xml is same. Likes following.
<resource-ref>
<description>MySQL Datasource example</description>
<res-ref-name>jdbc/mydb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
</resource-ref>

The error is coming when the web Applicaiton creating the new thread for
sending the notificaiton.

The same code is working on older version of apache tomee but on new
version, it is not working.

any suggestion?




--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
Loading...