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.
Summary: | Cannot deploy PetCatalog on GlassFish 3.1.2: "WebappClassLoader unable to load resource" | ||
---|---|---|---|
Product: | javaee | Reporter: | Vladimir Riha <vriha> |
Component: | Samples | Assignee: | Martin Janicek <mjanicek> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | marfous, mjanicek, mmirilovic, pjiricka, sj-nb, TomasKraus, vkraemer, vriha |
Priority: | P1 | Keywords: | REGRESSION |
Version: | 7.1.1 | ||
Hardware: | PC | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
server log
full log |
Maybe related to issue #198022 Is this a stopper for 7.1.1 ? I'm not sure. If it is similar to the #198022 then it's a bit old and it could probably wait to 7.2 Lada, are you able to reproduce it in 7.1 ? If not, it's a stopper. I can reproduce it in 7.1 but it depends on version of GlassFish. So reproduced on: - NB 7.1 + GF 3.1.2 (b23) - NB 7.1.1RC1 + GF 3.1.2 (b23) GlassFish 3.1.1 (the one bundled with 7.1) works fine with both RC1 and 7.1 (and as mentioned GF 3.0.1 and RC1 also works). Java: 1.7.0_03; Java HotSpot(TM) Client VM 22.1-b02 System: Linux version 2.6.38-13-generic running on i386; UTF-8; en_US (nb) So it's regression while working with newly bundled version of Glassfish - stopper for 7.1.1 CCing also to Martin and Sergey. From the server log it seems that it might be Ejb/Persistence related issue. Guys, any ideas what could be the problem? At the quick look it doesn't look to me like ejb (even if NetBeans) troubles - create some paginator -> get count of items -> execute query for getting that information from database. Anyway I'm afraid that the exception is not known to me at all. Martin, you can probably try to take a look on issue #198022, looks to be related to similar troubles. Ok, thanks for a quick response Martin. Regarding issue 198022 comment 10, I believe that this is rather Glassfish problem --> reassigning to Vince for evaluation. As it differ from gf version, it's unlikely something with persistence support, especially if once created application works on gf 3.1 and doesn't work on gf3.1.2. Tomas... please look into this. Please attach the full server log... that includes starting the server and deploying the app as well as the run-time exception if available. is this really on 'all' OSes? What OS were you using when you encountered this issue? Created attachment 116087 [details]
full log
I reproduced it on WinXP (32b) and Ubuntu 11.04 (64b), both systems are running the same jdk. All logs here are from ubuntu and
Java: 1.7.0_03; Java HotSpot(TM) Client VM 22.1-b02
I am trying to reproduce with Mac OS X, and I must say I am hitting a different issue - the JDBC driver is not deployed. Any ideas? BTW, Vlado, why are you using mysql-connector-java-5.1.18? The IDE includes 5.1.13, why don't you just use that? (In reply to comment #11) > Tomas... please look into this. Couple things to check... 1. can this issue be reproduced if the server is started from the command line before deployment? 2. can this issue be reproduced if the app is deployed using asadmin deploy XYZ.jar 3. can this issue be reproduced if the app is directory deployed with asadmin? Petr: Yes, I had the same problem. I thought that you have to add the connector to your classpath to make it work so instead of that I added it manually to the project. I didn't know that NetBeans have some connector included... After copying the driver manually to domain1/lib, I must say I am not able to reproduce, works fine for me on Mac OS X.
> I thought that you have to add the connector to your classpath to make it work so instead of that
> I added it manually to the project.
That explains it, when I do this, I also get the same error. Can you please try to remove it from the project and put it to domains/domain1/lib instead? (You need to also restart the server after that.)
Yes, after that it works for me too. Ok, I am closing this bug as invalid. I created a new bug 208830 for the JDBC driver deployment problem. (In reply to comment #20) > Ok, I am closing this bug as invalid. > > I created a new bug 208830 for the JDBC driver deployment problem. Hmm, so why is this working in 3.1.1 ? Vlada says it works in 3.0.1, not 3.1.1. Either way, adding JDBC drivers to the application archive is not supported in general, so if that approach works, then that's an added bonus, but not a requirement. The important question is whether the supported usecase (driver jar inside domain lib directory) works consistently. Just correction, it does work with 3.1.1 (comment #5) (In reply to comment #23) > Just correction, it does work with 3.1.1 (comment #5) Was the 3.1.1 a clean install of 3.1.1 or was it a domain that you had been using in the past... that might have the driver jar in the lib directory already? It was cleaned (I've just retested it). I added manually mysql connector to the project and it works. Also the driver is not in domains/domain1/lib dir after running/deploying the application I tested the same scenario with GF 4 (trunk) while I was waiting for 3.1.2 to build and there is the same problem like in 3.1.2. Also adding driver manually into domain1/lib resolved the problem. Please fix following things in PetCatalog sample: 1) Rename sun-resources.xml to glassfish-resources.xml 2) Add information about jdbc:mysql://127.0.0.1:3306/petcatalog database connection that is required for MySQL JDBC driver deployment into setup/SETUP_INSTRUCTIONS.html Assigning to Petr to pass it to owner of PetCatalog sample. Martin is the owner of the samples. PetCatalog changes implemented in: web-main #c476129fdf7e verified Product Version: NetBeans IDE Dev (Build 201204021038) Martin, can we add this into Patch2 ? Is it risky ? Well I can only say that changes on sample side aren't risky at all. But they are more or less cosmetic changes without any significant impact on behavior. The real fix has been done as a fix for issue 208830, so it's up to Tomas if he think the same about glassfish changes. Bug# 208830 fix is already in release71_fixes branch. Patch transplanted in: releases #a5bb29cda5bd Specification number increased and long description changed in: releases #c218f56a3fd4 Integrated into 'releases', will be available in build *201204042205* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/a5bb29cda5bd User: Martin Janicek <mjanicek@netbeans.org> Log: #208747 - Cannot deploy PetCatalog on GlassFish 3.1.2: "WebappClassLoader unable to load resource" (transplanted from c476129fdf7e9b15f2642fef43c40d939b58947c) 7.1.2 verified NetBeans IDE 7.1.2 (Build 201204042205) |
Created attachment 116023 [details] server log When trying to run PetCatalog sample on GF 3.1.2, it results in WARNING: java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [com.mysql.jdbc.EscapeProcessor], because it has not yet been started, or was already stopped at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1401) at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359) at com.mysql.jdbc.ConnectionImpl.nativeSQL(ConnectionImpl.java:3962) (see server attached server log) It works on GF 3.0.1. I've done nothing special, only create project, add mysql connector library, configure database and run the project. Product Version: NetBeans IDE 7.1.1 RC1 (Build 201202141941) Java: 1.7.0_03; Java HotSpot(TM) Client VM 22.1-b02 System: Linux version 2.6.38-13-generic running on i386; UTF-8; en_US (nb) mysql-connector-java-5.1.18