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 101812 - JBoss: NPE thrown on binding Customer database table to Table component
Summary: JBoss: NPE thrown on binding Customer database table to Table component
Status: VERIFIED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: John Baker
URL:
Keywords: RELNOTE
: 108377 (view as bug list)
Depends on: 112367 112372
Blocks:
  Show dependency tree
 
Reported: 2007-04-19 17:12 UTC by Dan Kolar
Modified: 2007-08-16 16:41 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages log (192.99 KB, text/plain)
2007-04-19 17:16 UTC, Dan Kolar
Details
Part of log with error (3.56 KB, text/plain)
2007-04-20 13:46 UTC, Dan Kolar
Details
JBoss 5 exception when creating datasource (3.91 KB, application/octet-stream)
2007-04-25 19:42 UTC, John Baker
Details
rowset bind error (3.65 KB, text/plain)
2007-04-27 08:01 UTC, John Baker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Kolar 2007-04-19 17:12:18 UTC
nbi build 070418 jdk1.5.0_10 JBoss 5 Beta 2

1) New Project -> Web -> Choose JBoss 5 -> Choose JavaEE5 -> Next
2) Choose Visual Web JSF framework -> Finish
3) Drag-n-drop Table component from Palette/Basic
4) Connect to sample database (app/app)
5) Drag-n-drop CUSTOMER table on Table in Page1.jsp (target header of Table, to
choose table, not just a row)

NPE is thrown and binding is then halway done (some changes in project are made,
but database table isn't correctly binded)
Comment 1 Dan Kolar 2007-04-19 17:16:57 UTC
Created attachment 41273 [details]
messages log
Comment 2 John Baker 2007-04-20 01:59:41 UTC
Cannot reproduce using M9  visualweb

please try again using a newer build

Comment 3 Dan Kolar 2007-04-20 13:44:46 UTC
build 200704191800 vwp build 070419_10

It appears now randomly, but anyway when NPE doesn't pop up, it doesn't link
database table  with Table in jsp editor and IAE is thrown in log. So at the end
this functionaly doesn't work for JEE5 and JBoss 5 anyway.
Comment 4 Dan Kolar 2007-04-20 13:46:49 UTC
Created attachment 41341 [details]
Part of log with error
Comment 5 John Baker 2007-04-25 19:40:31 UTC
I'm seeing an object on null
I guess similar to an NPE, but different error from stack trace.
I'm using the 070422 build.

Attaching exception and will consult with J2EE team
Comment 6 John Baker 2007-04-25 19:42:14 UTC
Created attachment 41658 [details]
JBoss 5 exception when creating datasource
Comment 7 John Baker 2007-04-25 20:13:45 UTC
visualweb passes to J2eeModuleProvider :

jmp.createDatasource("jdbc/APP_ApacheDerby", "jdbc:derby://localhost:1527/sample",
                        "app", "app", "org.apache.derby.jdbc.ClientDriver");

should be valid parameters unless JBoss doesn't like the '_'
Comment 8 John Baker 2007-04-25 20:15:23 UTC
To clarify, maybe JBoss doesn't consider a  '_' as a valid character for the
resource name
Comment 9 John Baker 2007-04-25 20:31:12 UTC
Oh, I see that JBoss 5.0 Beta 2 is not fully Java EE 5 compliant.
This may be the reason for this error in creating a datasource.

Comment 10 John Baker 2007-04-25 20:35:04 UTC
I will mark as INCOMPLETE until JBoss comes out with  a Java EE 5 compliant app
server.

If there's a more appropriate way to tag this issue, please do so.
Comment 11 Petr Blaha 2007-04-25 20:55:39 UTC
Please, use INCOMPLETE only in case you need a feedback from reporter. This bug
should be marked as WONTFIX when the issue is on JBoss. BTW, are you sure that
JBoss isn't still JavaEE5 compliant? Can you explain what is the issue with
datasource and JavaEE5 spec? Maybe, report the big for Jboss.
Comment 12 John Baker 2007-04-25 21:27:53 UTC
Marking the issue as WONTFIX resolves the issue.
but I'm still not sure the cause.

A resource name with '_' is not the issue

Creating a datasource fails passing these parameters to J2eeModuleProvider

jmp.createDatasource("jdbc/APPApacheDerby", "jdbc:derby://localhost:1527/sample",
                        "app", "app", "org.apache.derby.jdbc.ClientDriver");




Comment 13 Libor Kotouc 2007-04-26 13:46:04 UTC
Fixed the NPE.

Checking in DatasourceSupport.java;
/cvs/serverplugins/jboss4/src/org/netbeans/modules/j2ee/jboss4/config/ds/DatasourceSupport.java,v
 <--  DatasourceSupport.java
new revision: 1.3; previous revision: 1.2
done
Comment 14 John Baker 2007-04-27 07:58:48 UTC
serverplugin side appears to be fixed but visualweb's rowset code is choking

attaching NPE
Comment 15 John Baker 2007-04-27 08:01:18 UTC
Created attachment 41799 [details]
rowset bind error
Comment 16 Yousuf Haider 2007-04-27 18:44:58 UTC
Issue is reproducible on Jboss4 as well.
Comment 17 Joseph Silber 2007-04-30 13:31:02 UTC
Release note added.
Comment 18 John Baker 2007-07-14 02:20:13 UTC
currently I'm blocked by 109710
Comment 19 John Baker 2007-07-14 07:04:52 UTC
Passing to j2ee for evaluation

When target container is JBoss, requestedResource.getResource() returns "java:/jdbc/APP_ApacheDerby" whereas when
Glassfish is the container, getResource() returns "jdbc/APP_ApacheDerby" for the resource name

I expect getResource to return "jdbc/APP_ApacheDerby"

visualweb has an extension of RequestedResource
org.netbeans.modules.visualweb.api.j2ee.common.RequestedJdbcResource.

RequestedJdbcResource doesn't override getResource() but neither does RequestedEjbResource





Comment 20 Sherold Dev 2007-08-02 16:48:08 UTC
The issue seems to be in visualweb and it is also reproducible with WebLogic as a target server, see issue 108377.

If you think this issue depends on some other issue, in some server plugin for example, you should file a separate issue
for that.
Comment 21 Sherold Dev 2007-08-02 16:49:17 UTC
*** Issue 108377 has been marked as a duplicate of this issue. ***
Comment 22 Sherold Dev 2007-08-02 16:50:33 UTC
Reproducible on all the platforms
Comment 23 Sherold Dev 2007-08-02 16:53:01 UTC
should be probably assigned to John
Comment 24 John Baker 2007-08-08 03:20:41 UTC
Fixed at design-time.  Resource reference looks correct, but having trouble verifying runtime.

Checking in
visualweb/project/jsf/src/org/netbeans/modules/visualweb/project/jsf/services/DesignTimeDataSourceServiceImpl.java;
/cvs/visualweb/project/jsf/src/org/netbeans/modules/visualweb/project/jsf/services/DesignTimeDataSourceServiceImpl.java,v
 <--  DesignTimeDataSourceSe
rviceImpl.java
new revision: 1.8; previous revision: 1.7
done
Checking in
visualweb/dataconnectivity/src/org/netbeans/modules/visualweb/dataconnectivity/model/ProjectDataSourceManager.java;
/cvs/visualweb/dataconnectivity/src/org/netbeans/modules/visualweb/dataconnectivity/model/ProjectDataSourceManager.java,v
 <--  ProjectDataSourceManag
er.java
new revision: 1.3; previous revision: 1.2
done
Checking in
visualweb/dataconnectivity/src/org/netbeans/modules/visualweb/dataconnectivity/project/datasource/ProjectDataSourceTracker.java;
/cvs/visualweb/dataconnectivity/src/org/netbeans/modules/visualweb/dataconnectivity/project/datasource/ProjectDataSourceTracker.java,v
 <--  ProjectDa
taSourceTracker.java
new revision: 1.11; previous revision: 1.10
done
Comment 25 John Baker 2007-08-09 01:03:55 UTC
Drag and drop has been fixed but the resource reference is created in the wrong file.
See issue 112367

The workaround is to copy the resource reference section from the setup/jboss-ds.xml to the web/jboss-web.xml

Also, another exception may occur.  See issue 112372
Comment 26 John Baker 2007-08-13 18:22:32 UTC
Not completely fixed.  
Data source is now available but getting a new exception

Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/jdbc/datasource1
        at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:822)
        at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:173)
        at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:337)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at com.sun.sql.rowset.internal.CachedRowSetXReader.connect(CachedRowSetXReader.java:344)
Comment 27 John Baker 2007-08-13 18:48:49 UTC
design-time works but runtime fails

see issue 112367
Comment 28 John Baker 2007-08-15 03:13:17 UTC
Runtime now works also
Comment 29 _ alexpetrov 2007-08-16 16:41:04 UTC
Verified on:

1). JBoss 5.0.0 Beta2
    JAVA: j2sdk 1.5.0_12-b04

2). Product Version: NetBeans IDE Dev (Build 200708160000) 
    Java: 1.5.0_12; Java HotSpot(TM) Client VM 1.5.0_12-b04 
    System: Windows XP version 5.1 running on x86