To rename a data source and JNDI name. The Data Source created in Visual Web Pack (VWP) corresponds to
the JNDI setting on the application server:
Tomcat workaround
Glassfish workaround
Tomcat workaround
(Workaround provided by a Customer, much appreciated)
How to rename a datasource to Ciyela.
1. Define the connection in Runtime > database > New Connection.
2. Stop IDE.
3. Edit context.xml, change
from:
<object name="dataSource" class="com.sun.rave.sql.DesignTimeDataSource">
To:
<object name="Ciyela" class="com.sun.rave.sql.DesignTimeDataSource">
4. Restart IDE and add the reference to the project.
At this point I can add RowSets and providers but VWP don't deploy
connection, just adds the resource reference. The steps to run the
application on bundled Tomcat are:
1. Stop Tomcat.
2. Edit the "ide" user password in $USER_HOME/.netbeans/5.5/apache-tomcat-5.5.17_base/conf/tomcat-users.xml
3. Edit the password used by IDE to connect to Tomcat: Runtime > Servers > Bundled Tomcat > Properties > Connection > Password.
4. Copy database's jar (Firebird in my case) to $NET_BEANS_HOME/enterprise3/apache-tomcat-5.5.17/common/lib
5. Start Tomcat.
6. Open admin console: Runtime > Servers > Bundled Tomcat > View Admin Console.
7. Define the data source.
8. Run the application.
Glassfish workaround
1) Switch to the Runtime tab, expand the Servers and delete the JDBC Resources and Connection pools.
(Steps 2-5 below apply to a single project and must be done for each project
that is to use a new JNDI name)
2) In the project's directory, edit SessionBean1.java and rename the data source name in the _init() method
e.g. edit
tripRowSet.setDataSourceName("java:comp/env/jdbc/cpsDataSource");
3) Open the
setup/jdbc_dataSource.sun-resourcefile and change the JNDI setting
4) Edit
web/WEB-INF/web.xmland change the
5) Edit
web/WEB-INF/sun-web.xmland change the
6) Choose Help->About - Detail to find the User Dir setting
7) In a text editor, open context.xml (located in the User Dir) and change the name set in the
object name ...setting
8) In a text editor, open var/attributes.xml (located in the User Dir) and change the
attr name="datasource-names" stringvalue= ... setting
9) Start IDE, then for the project (set as the Main project) choose Build->Clean and Build Main Project
10) Redeploy the application

Posted by gomygo on March 27, 2007 at 12:14 AM PDT #
Posted by uyin on March 28, 2007 at 03:48 PM PDT #