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 112367 - Resource reference is added to the wrong file
Summary: Resource reference is added to the wrong file
Status: VERIFIED FIXED
Alias: None
Product: obsolete
Classification: Unclassified
Component: visualweb (show other bugs)
Version: 6.x
Hardware: PC All
: P2 blocker (vote)
Assignee: John Baker
URL:
Keywords:
Depends on:
Blocks: 101812
  Show dependency tree
 
Reported: 2007-08-09 00:34 UTC by John Baker
Modified: 2007-08-17 17:53 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
jboss-web.xml after manual modifications (433 bytes, text/xml)
2007-08-09 00:35 UTC, John Baker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Baker 2007-08-09 00:34:01 UTC
"jmp.getConfigSupport().createDatasource(req.getResourceName(), req.getUrl(),
                        req.getUsername(), req.getPassword(), req.getDriverClassName());"

 creates a Resource Reference in jboss-ds.xml

As a result, a runtime error occurs:
java.lang.RuntimeException: mapped-name is required for jdbc/TRAVEL_ApacheDerby of deployment WebApplication374.war

Instead, the resource reference should be created in jboss-web.xml.
After manually adding the resource reference to jboss-web.xml, the exception doesn't occur.


Also, this information was provided by a user from the JBoss user group.
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4072247#4072247
Comment 1 John Baker 2007-08-09 00:35:31 UTC
Created attachment 46365 [details]
jboss-web.xml after manual modifications
Comment 2 John Baker 2007-08-09 00:53:55 UTC
There is manual workaround

Copy the resource reference section from setup/jboss-ds.xml to web/jboss-web.xml
Comment 3 Sherold Dev 2007-08-09 09:21:22 UTC
Closing as INVALID.

The ConfigSupport.createDatasource() method creates a data source, not a resource reference. The data source definition
belongs to jboss-ds.xml file.

In order to create a resource reference use ConfigSupport.bindDatasourceReference() method.

I've checked your jboss-web.xml file and it is not correct. Refer to JBoss documentation or use the 'Use database'
action, which will generate a correct resource reference for you.
Comment 4 John Baker 2007-08-09 18:38:09 UTC
For deploying to Glassfish, ConfigSupport.bindDatasourceReference() is not required.
Maybe because I update the web.xml another way.

ConfigSupport.bindDatasourceReference() is required for JBoss and other servers ?
Comment 5 Sherold Dev 2007-08-10 09:38:21 UTC
It is definitely required in case of J2EE 1.4 projects..
Comment 6 John Baker 2007-08-11 03:35:07 UTC
changing to visualweb
Comment 7 John Baker 2007-08-15 02:56:55 UTC
Fix available.  Need to use bindDatasourceReference
Comment 8 John Baker 2007-08-15 03:04:32 UTC
Fixed.
Update to use bindDatasourceReference

Checking in visualweb/project/jsf/src/org/netbeans/modules/visualweb/project/jsf/services/DesignTimeDataSourceService.java;
/cvs/visualweb/project/jsf/src/org/netbeans/modules/visualweb/project/jsf/services/DesignTimeDataSourceService.java,v 
<--  DesignTimeDataSourceServic
e.java
new revision: 1.3; previous revision: 1.2
done
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.9; previous revision: 1.8
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.4; previous revision: 1.3
done
Checking in
visualweb/dataconnectivity/src/org/netbeans/modules/visualweb/dataconnectivity/sql/DesignTimeDataSourceHelper.java;
/cvs/visualweb/dataconnectivity/src/org/netbeans/modules/visualweb/dataconnectivity/sql/DesignTimeDataSourceHelper.java,v
 <--  DesignTimeDataSourceHe
lper.java
new revision: 1.14; previous revision: 1.13
done
Comment 9 _ alexpetrov 2007-08-17 17:53:44 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