• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connection to Derby failed

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
Bartender
Posts: 2661
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Ngai Chee Weng.
 
Ranch Hand
Posts: 69
Eclipse IDE Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Wink, wink, nudge, nudge, say no more, it's a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic