users@glassfish.java.net

Project made in Netbeans+GlassFish to GlassFish

From: <glassfish_at_javadesktop.org>
Date: Sat, 26 Apr 2008 18:19:55 PDT

Hi all,
  I had 2 issues when going from the Netbeans IDE 6.0.1 to the glassfish alone.
  The first issue is the one I'm trying to solve and I'm afraid I'm returning back in time
there must be a way to do it correctly, in a consistent way.
  The second is also an issue but now I'm not so worried about it.
1- The first is that I used the "drag and drop" feature of DB tables into jsf table (those in the palette).
  My problem now is that it created two objects, the "dataprovider" and the "rowset".
  When I deploy the application just using glassfish it can't connect to the DB with the
Apache Derby running. Therefore the tables don't appear.

  Moreover I used the "edit sql statement" where I built several queries using "?" as parameter, for instance: "getSessionBean1().getMenuRowSet().setObject(1, restaurantChosenId);"
  I realized that in the "ini()" in the Sessionbean there was the rowset initialization:

-restaurantsRowSet.setDataSourceName("java:comp/env/jdbc/REQUESTDISTRIBUTOR_DATABASE_ApacheDerby");
-restaurantsRowSet.setCommand("SELECT * FROM REQUESTDISTRIBUTOR_DATABASE.RESTAURANTS");
-restaurantsRowSet.setTableName("RESTAURANTS");

 and also:
public CachedRowSetXImpl getRestaurantsRowSet() {
//establish Connection c = DriverManager.getConnection(<DB url>).. the tradicional //way
// restaurantsRowSet.populate(rs);

  return restaurantsRowSet;
}
  I added the commented lines "//" and I got some results.

  So, The method "setDataSourceName" might be the issue for the glassfish. So,
how can I overcome this problem? Using the "getRestaurantsRowSet()" was a
solution but then I have issues with the "table dataprovider". I feel I'm going
backwards,
  Anyone knows a method to get what was done using Netbeans+glassfish to
just glassfish?

2- The second issue is that I configured the glassfish server to handle the replication.
I made a new installation and then using the "Add server" button I added it to the
Netbeans. I added it to the default domain folder .
  But when I make "run" the netbeans launches the glassfish just on the 8080 port and I get the following error:
"
Deployment error:
Project is currently archive deployed. Undeploy this project and redeploy it to take advantage of directory deployment.
See the server log for details.
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:163)
        at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:104)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:277)
        at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:460)
        at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
Caused by: java.lang.IllegalStateException: Project is currently archive deployed. Undeploy this project and redeploy it to take advantage of directory deployment.
        at org.netbeans.modules.j2ee.sun.bridge.DirectoryDeployment.getDirectoryForModule(DirectoryDeployment.java:138)
        at org.netbeans.modules.j2ee.sun.ide.j2ee.incrdeploy.DirectoryDeploymentFacade.getDirectoryForModule(DirectoryDeploymentFacade.java:162)
        at org.netbeans.modules.j2ee.deployment.impl.ServerFileDistributor.distribute(ServerFileDistributor.java:161)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.distributeChanges(TargetServer.java:163)
        at org.netbeans.modules.j2ee.deployment.impl.TargetServer.deploy(TargetServer.java:526)
        at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:148)
        ... 16 more
BUILD FAILED (total time: 26 seconds)
"

  For this one I couldn't find a good way to overcome it. Does anyone know?

Thanks in advance
[Message sent by forum member 'junkeira' (junkeira)]

http://forums.java.net/jive/thread.jspa?messageID=271672