This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection to Derby failed

 
Ngai Chee Weng
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm following this tutorial. At step 3 d, when I click "Test Connection", I got an error message as attached.

Can someone provide me some clue of this error message?
untitled.JPG
[Thumbnail for untitled.JPG]
 
Jan Cumps
Bartender
Posts: 2608
14
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Ngai Chee Weng.
 
mahesh shinde
Ranch Hand
Posts: 69
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
test connection step is 4-> J not 3d Ngai
please confirm it and study tutorial carefully
 
mahesh shinde
Ranch Hand
Posts: 69
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Befor testing connection make sure derby is running
If you want to check derby is running
perform all steps of B(title is Create your first JPA POJO) .2

 
Ngai Chee Weng
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Jan Cumps: thanks for the welcome.
@mahesh shinde: actually, it is Step 3 d but it is in section B...thanks for pointing that out because i miss the section A...i will try it out tomorrow.
 
Ngai Chee Weng
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya, I think I miss out some step at section A, step 4. After I follow all the steps, when I click "Test Connection", I got this error message,

Messages
The test connection operation failed for data source Order DS on server server1 at node xxxx with the following exception: java.lang.IllegalArgumentException: undefined variable: DERBY_JDBC_DRIVER_PATH. View JVM logs for further details.

Anyone can explain this error message?
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ngai Chee Weng wrote:Ya, I think I miss out some step at section A, step 4. After I follow all the steps, when I click "Test Connection", I got this error message,

Messages
The test connection operation failed for data source Order DS on server server1 at node xxxx with the following exception: java.lang.IllegalArgumentException: undefined variable: DERBY_JDBC_DRIVER_PATH. View JVM logs for further details.

Anyone can explain this error message?

You need to add DERBY_JDBC_DRIVER_PATH pointing at your derby client jar in "Environment -> WebSphere Variables" - you can see that it is been used i h (fig 22)
 
Ngai Chee Weng
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Rene Larsen: Thanks. I went to "Environment -> WebSphere Variables" and I have environment WebSphere variable "DERBY_JDBC_DRIVER_PATH" and the value is ${WAS_INSTALL_ROOT}/derby/lib

and my derbyclient.jar is located at C:\Program Files\IBM\WebSphere\AppServer1\derby\lib\

I also tried to replace ${WAS_INSTALL_ROOT}/derby/lib with C:\Program Files\IBM\WebSphere\AppServer1\derby\lib\

but I still got the same error.
 
Ngai Chee Weng
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I created new data source at the wrong scope. After I created it at the right scope, following the tutorial, when I click "Test Connection", I got this error message:

The test connection operation failed for data source Order DS on server server1 at node xxxxxx with the following exception: java.sql.SQLException: java.net.ConnectException : Error opening socket to server localhost on port 1527 with message : Connection refused: connectDSRA0010E: SQL State = null, Error Code = -4,499. View JVM logs for further details.

Trying to check on this by google's help.
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The database is running ?? and on port 1527 ??

Port 1527 is allowed to pass through your firewall (I think the windows firewall ??)
 
Ngai Chee Weng
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rene.

After I run startNetworkServer.bat, the previous error message is not more. But now is another error message,

The test connection operation failed for data source Order DS on server server1 at node xxxxxxx with the following exception: java.sql.SQLException: The application server rejected establishment of the connection. An attempt was made to access a database, JPATEST, which was not found.DSRA0010E: SQL State = 08004, Error Code = -4,499. View JVM logs for further details.
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you type the correct DB name when you created your datasource (see tutorial, step 4.g) ??
 
Ngai Chee Weng
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I put in the correct database name.
untitled.JPG
[Thumbnail for untitled.JPG]
 
Ngai Chee Weng
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I open up IBM WebSphere Application Server Toolkit and open up Database Explorer. At "Derby Sample Connection [Derby 10.1], I saw only SAMPLE database and didn't see JPATEST database there. Is this JPATEST database a default database or I need to download to load this database seperately?
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just need to test it my self - and Yes, the JPATEST database is missing

I have now created it with the ij command (found in ...\IBM\WebSphere\AppServer\derby\bin\networkServer) like this:

now you can test your database connection

Maybe this link can have your interest: http://www-01.ibm.com/support/docview.wss?rs=3044&context=SSRUWN&context=SSUMNA&dc=DB600&uid=swg21321121&loc=en_US&cs=UTF-8&lang=en
 
Ngai Chee Weng
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you got it! After I run CONNECT 'JPATEST;create=true'; I can now test the connection without any error. Thanks a lot
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic