Issue Details (XML | Word | Printable)

Key: GLASSFISH-11516
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Bhavanishankar
Reporter: sirajg
Votes: 10
Watchers: 6
Operations

If you were logged in you would be able to see more operations.
glassfish

Embedded does not work in offline mode (without internet)

Created: 04/Feb/10 08:01 AM   Updated: 03/Mar/11 07:28 AM   Resolved: 21/Oct/10 08:17 AM
Component/s: embedded
Affects Version/s: V3
Fix Version/s: 3.1_ms06

Time Tracking:
Not Specified

File Attachments: 1. File 2010-08-03 01h23 GlassFixSchemaFix (sources and compiled jar).7z (854 kB) 02/Aug/10 10:36 PM - marciowb

Environment:

Operating System: All
Platform: Macintosh


Issuezilla Id: 11,516
Tags:
Participants: Alexis MP, Amy Roh, Bhavanishankar, johanvos, manuel_b, marciowb, rouche and sirajg


 Description  « Hide

The embedded jars consists of a number of tld files. Some of these containt tags
like this :

<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">

When an application containing a single tld is deployed, all these tlds are
parsed, which fails when there is no internet connection. In regular glassifsh
files like web-jsptaglibrary_1_1.dtd are in lib/dtds/. In embedded these are not
installed on the temporary filesystem that embedded uses.



sirajg added a comment - 04/Feb/10 08:02 AM

reassign


Alexis MP added a comment - 05/Feb/10 12:15 AM

cc


sirajg added a comment - 11/Feb/10 07:12 AM

To resolve this, dtds shouls be packaged in the embedded jar and an
entityresolver should looked these up from the jar


johanvos added a comment - 11/Feb/10 07:27 AM

add johan in cc


sirajg added a comment - 12/Feb/10 09:13 AM

Added dtds and schemas in the embedded.jar.


Amy Roh added a comment - 04/Mar/10 02:30 PM

cc


sirajg added a comment - 04/Mar/10 03:31 PM

If all the .xsd files are included in the classpath, by putting them in a jar,
get this error :

org.xml.sax.SAXParseException: sch-props-correct.2: A schema cannot contain two
global components with the same name; this schema contains two occurrences of
'http://java.sun.com/xml/ns/j2ee,descriptionGroup'.
at
com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:304)
at
com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:225)
at
com.sun.enterprise.deployment.archivist.Archivist.readStandardDeploymentDescriptor(Archivist.java:614)
at
com.sun.enterprise.deployment.archivist.ApplicationFactory.createApplicationFromStandardDD(ApplicationFactory.java:211)


Amy Roh added a comment - 05/Mar/10 11:44 AM

change category


Amy Roh added a comment - 17/Jun/10 04:29 PM

These unit tests are failing due to the reported reason

jspCustomTaglibBundledAsJar
jspCustomTaglibJarInsideEarWithManifestClassPath
jspCustomTaglibJarInsideEarWithoutManifestClassPath
jspInWebappWithBundledXercesImpl
virtualServerEarWrappedDefaultWebModuleRestart

[glassfish-embedded-deploy] org.apache.jasper.JasperException: PWC6177: XML
parsing error on file
file:/files/hudson/workspace/webtier-dev-tests-embedded/appserv-tests/devtests/web/gfembed3108821185131741115tmp/applications/web-jsp-custom-taglib-bundled-as-jar/WEB-INF/lib/mytaglib.jar

[glassfish-embedded-deploy] Caused by: java.io.FileNotFoundException:
http://java.sun.com/j2ee/dtd/web-jsptaglibrary_1_2.dtd


sirajg added a comment - 20/Jul/10 12:51 AM
      • Issue 12601 has been marked as a duplicate of this issue. ***

marciowb added a comment - 02/Aug/10 10:36 PM

Created an attachment (id=4629)
Changes to do the GF3 Embedded work out of Internet


Bhavanishankar added a comment - 08/Oct/10 02:25 AM

Bundling the dtds and schemas in the uber jar, and copying them under
installRoot/lib is the solution for this issue.

Updating the milestone.


Amy Roh added a comment - 08/Oct/10 10:14 AM
      • Issue 11515 has been marked as a duplicate of this issue. ***

Bhavanishankar added a comment - 21/Oct/10 08:17 AM

This has been fixed for ms6.


rouche added a comment - 27/Jan/11 05:47 AM

Ok, after the redirects that hapenned today, read :
http://www.reddit.com/r/programming/comments/f9sxu

Can we get a clear and straight forward explanation as to where to put that GlassFixSchemaFix.jar with the 3.0.1 release so that we can actually run our tests?

Ive put in in the domains/lib, in installRoot/lib, inside the embedded-all.jar intself inside lib, in the root.....

Nothing works ><

NetBeans 6.9.1 btw.


Bhavanishankar added a comment - 27/Jan/11 06:47 AM

In 3.1, there were quite a few changes put in to fix this issue. I don't have the exact list of changes. So, I don't know how you can patch 3.0.1.

Please start using 3.1 embedded-all.jar, you will see it working.


rouche added a comment - 27/Jan/11 07:36 AM - edited

Ive tryed dont worry.

With, glassfish-embedded-all-3.1-b38.jar, seems like theres a lot of incompatibility with our NetBeans project.
That was working perfectly before.

1) (minor)
WARNING:
java.io.FileNotFoundException: .\test\glassfish\domains\domain1\config\admin-keyfile

2)
WARNING: Incorrect @Resource annotation class definition - missing lookup attribute
symbol: FIELD
location: java.util.Properties blahblah.back.ejbs.export.thing.ThingExportSessionBean.configuration

Wich i guess result in:
SEVERE: Exception while invoking class org.glassfish.webservices.WebServicesDeployer prepare method
Jan 27, 2011 4:30:30 PM org.glassfish.api.ActionReport failure
SEVERE: Exception while preparing the app
java.util.logging.ErrorManager: 5
java.lang.NullPointerException
at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:136)
at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
at java.util.ResourceBundle.getString(ResourceBundle.java:334)
...

3)
Jan 27, 2011 4:30:33 PM org.glassfish.ejb.embedded.EJBContainerProviderImpl createEJBContainer
SEVERE: EJB6001:Caught exception instantiating EmbeddedContainer.
javax.ejb.EJBException: Failed to deploy EJB modules - see log for details
at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:145)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:132)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:127)
at blah.back.util.ContainerTestUtils.initialize(ContainerTestUtils.java:45)
at blah.back.ejbs.BlahTest.setUpSuite(BlahTest.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:643)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:446)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:162)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:92)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:301)
at org.testng.SuiteRunner.run(SuiteRunner.java:195)
at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:903)
at org.testng.TestNG.runSuitesLocally(TestNG.java:872)
at org.testng.TestNG.run(TestNG.java:780)
at org.testng.TestNG.privateMain(TestNG.java:952)
at org.testng.TestNG.main(TestNG.java:926)
FAILED CONFIGURATION: @BeforeSuite setUpSuite
javax.ejb.EJBException: No EJBContainer provider available
The following providers:
org.glassfish.ejb.embedded.EJBContainerProviderImpl
Returned null from createEJBContainer call.

at javax.ejb.embeddable.EJBContainer.reportError(EJBContainer.java:216)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:146)

Seems like there gonna be a lot of work to do to switch to 3.1


Bhavanishankar added a comment - 27/Jan/11 07:44 AM

Can you please put a write up on how you were using 3.0.1 embedded glassfish in your netbeans 6.9.1 (along with the app you are trying to deploy)?


rouche added a comment - 31/Jan/11 05:59 AM

In fact i found the bug i have in jira.
http://java.net/jira/browse/GLASSFISH-12278

Reverted to 3.0 now.


manuel_b added a comment - 03/Mar/11 05:25 AM

Hi rouche,
I am having similar problems like you. I upgraded from embedded Glassfish V3.0.1 to V3.1.

I have some more informations for your second (2) problem. I am running an embedded glassfish in my TestNG. These get started by maven. I was able to attache a debugger:

  1. start TestNG test (which start internally a embedded glassfish)
    $ mvn -Dmaven.surefire.debug test
  2. wait until it stops and attach the debugger
    $ jdb -attach 5005
  3. Use http://java.net/projects/glassfish/sources/svn/content/tags/3.1/core/kernel/src/main/java/com/sun/enterprise/v3/server/ApplicationLifecycle.java?rev=45380
  4. to know where to set a breakpoint
    > stop at com.sun.enterprise.v3.server.ApplicationLifecycle:412
  5. wait until it stops and show local variables
    > locals
  6. print a stack trace
    > eval prepareException.printStackTrace()

Here is the complete stack trace for the WebServicesDeployer prepare methodexception.
SEVERE: Exception while invoking class org.glassfish.webservices.WebServicesDeployer prepare method
java.lang.RuntimeException
at org.glassfish.webservices.WebServicesDeployer.prepare(WebServicesDeployer.java:192)
at com.sun.enterprise.v3.server.ApplicationLifecycle.prepareModule(ApplicationLifecycle.java:870)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:410)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:193)
at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:142)
at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:135)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:132)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:127)
at de.apaxo.semrecsys.test.EJB3Container.startGlassfish(EJB3Container.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:73)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:516)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:196)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:126)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:258)
at org.testng.SuiteRunner.run(SuiteRunner.java:221)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:946)
at org.testng.TestNG.runSuitesLocally(TestNG.java:883)
at org.testng.TestNG.run(TestNG.java:814)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:74)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
Caused by: java.lang.NullPointerException
at org.glassfish.webservices.WsUtil.getWebServerInfoForDAS(WsUtil.java:1548)
at org.glassfish.webservices.WebServicesDeployer.doWebServicesDeployment(WebServicesDeployer.java:618)
at org.glassfish.webservices.WebServicesDeployer.prepare(WebServicesDeployer.java:183)
... 33 more

I am looking into this.


manuel_b added a comment - 03/Mar/11 05:34 AM

http://java.net/projects/glassfish/sources/svn/content/tags/3.1/webservices/jsr109-impl/src/main/java/org/glassfish/webservices/WsUtil.java?rev=45380

So the problem seems to be that the networkListeners are empty and the following code which is supposed to fill them is not working correctly:

...
if(this.networkListeners == null) {
List<Integer> adminPorts = new ArrayList<Integer>();

for (org.glassfish.api.container.Adapter subAdapter :
habitat.getAllByContract(org.glassfish.api.container.Adapter.class)) {
if (subAdapter instanceof AdminAdapter) { AdminAdapter aa = (AdminAdapter) subAdapter; adminPorts.add(aa.getListenPort()); } else if (subAdapter instanceof AdminConsoleAdapter) { AdminConsoleAdapter aca = (AdminConsoleAdapter) subAdapter; adminPorts.add(aca.getListenPort()); }
}

for (NetworkListener nl : config.getNetworkConfig().getNetworkListeners().getNetworkListener()) {

if(!adminPorts.contains(Integer.valueOf(nl.getPort()))) { // get rid of admin ports if(networkListeners == null) networkListeners = new ArrayList<NetworkListener>(); networkListeners.add(nl); }
}
}
...


manuel_b added a comment - 03/Mar/11 07:28 AM

I just checked glassfish v3.0.1 the function org.glassfish.webservices.WsUtil.getWebServerInfoForDAS() is not called during deployment.