This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 221076 - Can't create entities from database
Summary: Can't create entities from database
Status: RESOLVED DUPLICATE of bug 217432
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 7.2
Hardware: PC Windows 7
: P1 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-30 11:05 UTC by bjornstenfeldt
Modified: 2012-10-31 10:16 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
When the dialog is just opened (44.61 KB, image/png)
2012-10-31 07:48 UTC, bjornstenfeldt
Details
The dialog after I click jdbc/Portal in the Data Source list (33.38 KB, image/png)
2012-10-31 07:50 UTC, bjornstenfeldt
Details
I enter the correct information, but with an incorrect password. The connection test fails. (36.06 KB, image/png)
2012-10-31 07:51 UTC, bjornstenfeldt
Details
I correct the password and the connection test is a success. (34.75 KB, image/png)
2012-10-31 07:52 UTC, bjornstenfeldt
Details
I click next. Nothing to do here, so I click finish. (28.04 KB, image/png)
2012-10-31 07:52 UTC, bjornstenfeldt
Details
I'm now presented with this dialog. (14.32 KB, image/png)
2012-10-31 07:53 UTC, bjornstenfeldt
Details
After I close the previous dialog, I'm back on the initial wizard dialog. Now, jdbc/Portal is selected, but nothing is listed in Available Tables. (44.26 KB, image/png)
2012-10-31 07:54 UTC, bjornstenfeldt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bjornstenfeldt 2012-10-30 11:05:52 UTC
We've had to suspend use of entities due to this error. There are too many entities and it's simply too much work to do it by hand. The problem is this:

1) Open the "New Entity Classes From Database". The list with "Available Tables" is empty. No "Data Source" is selected.

2) We select a Data Source.

3) The window "New Connection Wizard" pops up.

4) We enter all data in the "New Connection Wizard" and click "Test Connection". It works!

5) We finish with the "New Connection Wizard".

6) Now we get the message "Unable to add connection. Connection already exists.".

7) We then go to "Services" > "Databases" and delete the connection.

8) Then we open the "New Entity Classes From Database" again. The list with "Available Tables" is empty. No "Data Source" is selected.

9) We once again select a "Data Source".

10) Again, the "New Connection Wizard" pops up.

11) We enter all data in the "New Connection Wizard" and click "Test Connection". It works!

12) We finish with the "New Connection Wizard".

13) In the "New Entity Classes From Database", a "Data Source" is selected, but "Available Tables" is still empty.

14) Nothing to do but close the "New Entity Classes From Database" window.

15) Go to step 1.

The "Data Source" list seems to be populated with connections from the GlassFish server. We don't understand why I can't just use the connection that we have and that works, but keeps popping up a dialog. And no matter what we do, "Available Tables" is always empty. This worked fine in the version of NetBeans we used before upgrading to 7.2. Downgrading is not possible.



Product Version = NetBeans IDE 7.2 (Build 201207171143)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.6.0_35
Runtime = Java HotSpot(TM) 64-Bit Server VM 20.10-b01
Comment 1 Sergey Petrov 2012-10-30 18:47:36 UTC
do you have connection url populated in new connection wizard?
you can try latest 7.3 dev to see if it's fixed as in 7.2 (and likely before) it was populated with some default url instead of one used in datasource and it may cause attempt to create new connection with default url instead of required one and as it's likely default one is already registred may case 'already registred' message or it it's not registed datasource still remains unrecogized.

please provide connection url for your datasource and screenshot for new connection wizard for further evaluation.
Comment 2 Sergey Petrov 2012-10-30 18:48:33 UTC
and please reopen with provided information
Comment 3 Sergey Petrov 2012-10-30 18:49:51 UTC
just a note, 'test connection' only test if connection is valid itself, it may not be a valid connection for datasource anyway.
Comment 4 bjornstenfeldt 2012-10-31 07:48:56 UTC
Created attachment 126818 [details]
When the dialog is just opened
Comment 5 bjornstenfeldt 2012-10-31 07:50:05 UTC
Created attachment 126819 [details]
The dialog after I click jdbc/Portal in the Data Source list
Comment 6 bjornstenfeldt 2012-10-31 07:51:21 UTC
Created attachment 126820 [details]
I enter the correct information, but with an incorrect password. The connection test fails.
Comment 7 bjornstenfeldt 2012-10-31 07:52:02 UTC
Created attachment 126821 [details]
I correct the password and the connection test is a success.
Comment 8 bjornstenfeldt 2012-10-31 07:52:41 UTC
Created attachment 126822 [details]
I click next. Nothing to do here, so I click finish.
Comment 9 bjornstenfeldt 2012-10-31 07:53:10 UTC
Created attachment 126823 [details]
I'm now presented with this dialog.
Comment 10 bjornstenfeldt 2012-10-31 07:54:38 UTC
Created attachment 126824 [details]
After I close the previous dialog, I'm back on the initial wizard dialog. Now, jdbc/Portal is selected, but nothing is listed in Available Tables.
Comment 11 Sergey Petrov 2012-10-31 09:49:16 UTC
yes, jdbc/Portal is selected is a minor issue here after it fail to be resolved after attempt to be resolved with new connection dialog.
I suppose your jdbc/Portal don't have any parameters in connection url and you attempt to add a connection with a parameters and this connection was created before. you just need to add a connection the same as in jdbc/Portal, not similar one as parameters may affect type conversions.
in 7.2 default paraeters for mysq was added and it's likely you have old datasource. it's easy to correct it in new connection dialog, and in 7.3 it's already use url from datasource instead of default one, if my assumption is right it's already foxed in 7.3 and definitely not a P1 in 7.2.
please reopen if you datasource use connection as shown on http://bugzilla-attachments-221076.netbeans.org/bugzilla/attachment.cgi?id=126820 as it may be another issue.

*** This bug has been marked as a duplicate of bug 217432 ***
Comment 12 bjornstenfeldt 2012-10-31 10:16:05 UTC
Removing ?zeroDateTimeBehavior=convertToNull from the connection url, as suggested, fixed the problem.