• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

SQLExcpetion

 
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I use the eclipse 3.4 together with the Glassfish v2 and I try to use the example from EJB in action. And here I get an exception :

java.sql.SQLException: This pool is not registered with the runtime environment : null

I realy don't know why ?

Thanks in advance,
M
 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mihai,

in Glassfish (like in any other J2EE server) you can define database pools which then can be used by enterprise applications running on this server because it's more efficient to let the server handle database management and reuse existing connections if possible.

Unfortunately I can't tell you in detail how this is done with Glassfish and what kind and name of pool your application expects. But I'm pretty sure the book describes the necessary steps to configure the server environment for the examples (although I personally don't know this book).

Marco
[ September 25, 2008: Message edited by: Marco Ehrentreich ]
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Marco,

Thanks for your answer, unfortunately the book does not provides information about this database pools, or I search on the wrong place.

All that I know is that I start the the database after I start the server, I start the database with teh asaadmin comand :


I do something wrong ?

Regards,
M
 
Ranch Hand
Posts: 329
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mihai Radulescu:
All that I know is that I start the the database after I start the server, I start the database with teh asaadmin comand :



Have you tried starting the database before the application server?
 
Marco Ehrentreich
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the problem is that you don't only have to start the database server but to create a database and configure a database pool for it in Glassfish. Glassfish provides the GUI for this task in its web interface. I've only tried this a few times but with an external database server like MySQL and PostgreSQL. For this I unfortunately don't know how you can manage the internal database server which you're obviously using.

Marco
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mihai

Couple of things-
1. EJB3 in action examples uses the Apache derby database by default.
2. Before running any example you need to start the database by Start > Programs > Sun Microsystems
> Application Server PE 9 > Start Java DB
3. It will start the database server on a new command prompt and you can press enter to run it in background.
4.Once you have started the server (Glassfish) and the database, you need to run the build file which is present at the top level folder of the source code i.e c:\ejb_3_in_action\code_examples.This will prepare data sources and JMS resources necessary for the database.
5. After doing this you can go to each chapter and run the specific build file.i.e cd chapter1 and ant.

I apologize if you have already followed these steps before posting the error.

Gaurav
 
Ranch Hand
Posts: 270
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Even I am using EJB 3 in Action examples.I am able to run these examples without any problem.I have NetBeans but i am not able to use the IDE for these examples.How do i make benefit of Netbeans for opening Ant projects(EJB 3 in Action)?

Regards
Sudhakar Karnati
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi people

Thanks for your interest. An other detail - I am a linux user.
To deploy the example I use the ant runner together with the ant srcpit which i have from the author site.

Marco, can you direct me to this GUI (used to create a database and configure a database pool for it in Glassfish).



Sergio, I try already both combinations :

and


with the same effect :


java.sql.SQLException: This pool is not registered with the runtime environment : null




Gaurav, As I mention before I am linux user - the install routine under linux (KDE) does not adds such kind of menu entries. If you are a windows user can you take a look what exactly do the start database menu entry ?


Karnati, can you provide more details, like which platform, from where you have the ant scripts, etc.




Regards,
M
 
Karnati Sudhakar
Ranch Hand
Posts: 270
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Karnati, can you provide more details, like which platform, from where you have the ant scripts, etc.



I am a windows user.You can run the examples downloaded from the Manning site,But you have to modify the SQL scripts that are shipped in with the examples.Those Sql scripts are in Oracle which derby does not support.

Regards
Sudhakar Karnati
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Karnati,

I don't hava any sql scripts, I get this exception when I try to deploy the example for the chapter 2. Here I ony add a single table (using JDBC).
Where are this scripts ? I don't have any of this kind.
From where you download you examples ?

Regards,
M
[ September 26, 2008: Message edited by: Mihai Radulescu ]
 
Karnati Sudhakar
Ranch Hand
Posts: 270
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Where are this scripts ? I don't have any of this kind.



In chapters 3,4 &5 you will have these scripts in a folder called 'sql'.

Thanks
Sudhakar
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Karnati

how about the chapter 2 example ?
 
Karnati Sudhakar
Ranch Hand
Posts: 270
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mihai,

For running chapter 2 you dont have to run additonally any sql scripts as you have to for Chapters3,4 and 5.After you navigated to the chapter2 folder in the command prompt when you just type this 'ant' it will create all the tables required for the chapter2.

I am not sure what problem you are facing but i can tell you one thing.Just start the glassfish from by using this command start-domain domain1 in the asadmin. to do so you have set environment variable to J2EE_HOME to the directory of the glassfish directory.and then run the start-database.

Just login into the Admins console of glassfish and check for the connection pools you have bfore running any ant command for the examples.The EJB 3 in Action examples uses the connection pool DerbyPool. Make sure that it is present under connection pools.

I hope this helps if you still have problem just reply i will try to clarify your doubt.

Regards,
Sudhakar
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Karnati,

can you describe your Admin console for database pool - where in the Admin GUI I can find it ?

Regards
M
 
Karnati Sudhakar
Ranch Hand
Posts: 270
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

where in the Admin GUI I can find it ?



In the admin console expand resources and then JDBC and then Connection pools there you will see one connection pool Derby which is used by the EJB 3 in Action examples.

Regards
Sudhakar Karnati
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Karnati,

I just start my database & server and I take a look on Resources->Connection Pools and here I have a DerbyPool, this gui has a ping function and this ping function works with my environment. but when I run the ant script for the chapter 2 I still get the
java.sql.SQLException: This pool is not registered with the runtime environment : null

Do I miss here something ?

Regards,
M
 
Karnati Sudhakar
Ranch Hand
Posts: 270
Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First run the ant scripts both at the directory level and chapter2 level and then log into the admin console of Glassfish and look for the JDBC resources created jdbc/ActionBazaarDS and jdbc/TurtleDS which should be created.and these resources should be mapped to the Derby Connection pool.

I am not sure if this solves your problem but it has to be the way i mentioned above.

Thanks
Sudhakar Karnati
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Karnati,

I get the exception on the deploy - I look on the domain log and here I have the the exception stack trace.

I don't know what I suppose to do - to try to bound other database pool - loke my SQL ?

Regards,
M
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi people,

I keep playing with my JPA application and I discover that the infamous :
java.sql.SQLException: This pool is not registered with the runtime environment : null
comes togheder with the following code snippet :



but I don't have any idea why.

My persistence.xml looks like :


any comments ??


Regards,
M
 
Sergio Tridente
Ranch Hand
Posts: 329
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you defined your data source, jdbc/ItemManager?

In order to avoid complications, when I was practising for the exam I used the "default" data source (which comes preconfigured). This is my persistence.xml:



I hope that helps.
[ September 29, 2008: Message edited by: Sergio Tridente ]
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Sergio

You was right (again) the key was the data source, or better the XML node :


for a few minutes I just find this by my self by reading some documentation about the data-source (and persistence.xml).
From this point of view the "EJB in action" is a little bit to superficial - it lets you to search a lot of complementary information without even to point you the right direction, of course this make a lot of fun but it cost you also a lot of time (resources).

Well it works (& I understand also why it works) and this is the most important.
What I don't unedrstand is how it works on the others without to define the data-set ?

Regards (and thanks once more),
M
 
permaculture is a more symbiotic relationship with nature so I can be even lazier. Read tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic