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.
Build: NetBeans IDE 6.5 (Build 200812050001) VM: Java HotSpot(TM) 64-Bit Server VM, 10.0-b23, Java(TM) SE Runtime Environment, 1.6.0_07-b06 OS: Windows Server 2008, 6.0, amd64 User Comments: jkak: Creating EntityBeans from Database GUEST: I was creating entity clasess from a Postgres database GUEST: can't generate classes from database ! GUEST: Problem during generation Entity Classes from MS Access database (latest HXTT driver). With full recreation information GUEST: create entity classes with mssql2005 std ikhwanma@gmail.com: error during generating entity classes. using mssql2005 std database. Stacktrace: java.lang.IllegalArgumentException: aType == null at org.netbeans.modules.j2ee.persistence.entitygenerator.EntityMember.setMemberType(EntityMember.java:213) at org.netbeans.modules.j2ee.persistence.entitygenerator.DbSchemaEntityMember.setPrimaryKey(DbSchemaEntityMember.java:124) at org.netbeans.modules.j2ee.persistence.entitygenerator.DbSchemaEjbGenerator.generatePkField(DbSchemaEjbGenerator.java:399) at org.netbeans.modules.j2ee.persistence.entitygenerator.DbSchemaEjbGenerator.buildCMPSet(DbSchemaEjbGenerator.java:488) at org.netbeans.modules.j2ee.persistence.entitygenerator.DbSchemaEjbGenerator.<init>(DbSchemaEjbGenerator.java:86) at org.netbeans.modules.j2ee.persistence.wizard.fromdb.RelatedCMPHelper.buildBeans(RelatedCMPHelper.java:310)
Created attachment 76121 [details] stacktrace
I found the problem. In the tables of the database wich I use, had a bad identity's definitions. I hope wich this "tip", can help you.
The root problem is the jodbc driver of Microsoft SQL Server.
I had this problem in NB6.5.1 with PostgreSQL and I specifically tried NB6.7 - the problem remains. So - I reopen this case. It would be nice to get at least hint what has been done in NB to resolve this issue.
can you provide version for jdbc driver and sql used to create tables in your database or/and database schema?
Created attachment 96208 [details] Test database Test database. 12 tables with different primary key datatype. 8 tables with foreign key on nchar,nvarchar.
reopening, need to reevaluate with new information
I included my test database. According to org.netbeans.modules.j2ee.persistence.entitygenerator.EntityMember.setMemberType(EntityMember.java:213) I read the EntityMember.java and I think this bug might have something to do with sql datatype. I tested with both SQL Server 2005 Express v9.00.4053.00 and SQL Server 2008 Developer v10.0.2531.0 and I see that only tables with primary key are nchar or nvarchar data type can not be generated. (I am using jdk 1.6.0_07, sqljdbc4, NetBeans 6.5.1 Build 200811100001, windows 7) This is not true for my friends' PCs. Might be there are some problems with the unicode font?
anyway can't be fixed in 6.8, no sense to set 6.8 as target it may be hard to fit in 6.9 also as only a few weeks left. can't say anything yet, will try to look after issue I'm working on. do you mean you are able to generate enities with nchar on one pc and can't on another?
(In reply to comment #10) > anyway can't be fixed in 6.8, no sense to set 6.8 as target it may be hard to > fit in 6.9 also as only a few weeks left. > can't say anything yet, will try to look after issue I'm working on. > > do you mean you are able to generate enities with nchar on one pc and can't on > another? Yes, that's right.
Are there any differences in db server, java, nb version, os?
The issue may depend on different jdbc drivers usage.
(In reply to comment #13) > The issue may depend on different jdbc drivers usage. I have just asked 2 friends : 1PC window xp pro sp2, same NB, sql server 2005 express, jdk 1.6, sqljdbc.jar : no bug 1 laptop win7 , NB 6.5, sql server 2005, jdk 1.6, sqljdbc.jar : no bug. (me sqljdbc4)
do you know sqljdbc.jar version? Also do you use sqljdbc4? Can you try sqljdbc?
(In reply to comment #15) > do you know sqljdbc.jar version? > Also do you use sqljdbc4? Can you try sqljdbc? I try sqljdbc.jar (I dont know what version, but it's size is 247KB) and no more bug.
Created attachment 96236 [details] sqljdbc driver that do not generate this bug
Created attachment 96237 [details] I have bug when I using thi driver Thanks for your direction.
Now it looks more like jdbc driver compatibility either with nb or with db issue and if I got it right proper driver exists. The issue itself may be considered as valid but nor severe as it may be better to provider some message like "can't resolve primary key type" instead of throwing exception.
(In reply to comment #19) > Now it looks more > like jdbc driver compatibility either with nb or with db issue and if I got it > right proper driver exists. > The issue itself may be considered as valid but nor severe as it may be better > to provider some message like "can't resolve primary key type" instead of > throwing exception. I've posted 2 drivers, 1 no bug 1 buggy. Do you need anymore information ?
Thanks, no more information is needed, at least for now. Just in my opinion it may not be an issue except exception itself.
Hi poeple, I've discovered which this problem is visible when the table hasn't a entity key in his model design. Can you put your feedback about this issue? PD: (in the 6.8 version, I can't duplicate this)
yes, forget to ask to try some latest netbeans as the issue have no sense if it's reproducible in 6.5,6.7 only and may be also in 6.8 and is not reproducible in current 6.9 as it may be already fixed or default behavior is changed.
As I see the was changes in this code after 6.7, I'm not sure if the issue is valid even in term show message instead of exception. Please try some later nb with "bad" driver also, best would be some daily 6.9 build, but 6.8 may be good too. It will update/produce new stacktrace also with better match to current code.