quality@glassfish.java.net

Re: Error while deploying WAR using admin console

From: Tim Quinn <Timothy.Quinn_at_Sun.COM>
Date: Sun, 14 Sep 2008 06:27:38 -0500

Jose,



Jose Noheda wrote:
> So, creating an empty WEB-INF/classes directory did not work.
By "did not work" do you mean that the module was not recognized as a
web app or that it was recognized but the deployment failed?

> Creating an empry web.xml did not work.
Well, an empty one might not help. Perhaps I should have been explicit
about that because the web archivist and deployer will try to make sense
of the contents of the WEB-INF/web.xml and they might not like an empty one.
> I tried Netbeans then and it generates a WAR with both a web.xml and
> an empty WEB-INF/classes directory. The deployment trace was:
>
> Deployment error:
> null
Was there any useful output in the server.log at the time of this
deployment?


- Tim
> See the server log for details.
> at
> org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:190)
> at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:104)
> at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
> at sun.reflect.GeneratedMethodAccessor135.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:106)
> 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:1337)
> at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
> at
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
> at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
> at
> org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:273)
> at
> org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:486)
> at
> org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:151)
> Caused by: java.lang.NullPointerException
> at
> org.netbeans.modules.glassfish.javaee.ide.Hk2TargetModuleID.getWebURL(Hk2TargetModuleID.java:84)
> at
> org.netbeans.modules.j2ee.deployment.impl.TargetModule.getWebURL(TargetModule.java:197)
> at
> org.netbeans.modules.j2ee.deployment.impl.projects.DeploymentTargetImpl.findWebUrl(DeploymentTargetImpl.java:178)
> at
> org.netbeans.modules.j2ee.deployment.impl.projects.DeploymentTargetImpl.getClientUrl(DeploymentTargetImpl.java:122)
> at
> org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:186)
> ... 16 more
> BUILD FAILED (total time: 6 seconds)
>
> But it deployed correctly....
>
> On Sat, Sep 13, 2008 at 6:37 PM, Jose Noheda <jose.noheda_at_gmail.com
> <mailto:jose.noheda_at_gmail.com>> wrote:
>
> On Sat, Sep 13, 2008 at 5:56 PM, Tim Quinn <Timothy.Quinn_at_sun.com
> <mailto:Timothy.Quinn_at_sun.com>> wrote:
>
> Hi, Jose.
>
> I don't know much at all about Dojo, but from their download
> web page <http://dojotoolkit.org/downloads> I found this:
>
> 1. Extract files from archive locally or on web server
> 2. Browse to dojo/tests/runTests.html or
> dijit/themes/themeTester.html to see Dojo in action
> 3. Include <script type="text/javascript"
> src="dojo/dojo.js"> in your own page and you're on your way
>
> Item 3 suggests to me that Dojo itself is not a web app but is
> a set of functionality ready to be included in and used from a
> web app.
>
>
> No, dojo is a javascript library. Just static content.
>
>
>
> Have you seen information somewhere else that says something else?
>
> By the way, the GlassFish web container currently recognizes
> an app as a web app if:
>
> 1. it contains a WEB-INF/web.xml file, a WEB-INF/classes
> directory, or a WEB-INF/lib directory; OR
> 2. it contains a .jsp file anywhere
>
>
> That could be it because it does not contain any of those. Just
> js, css, images and html files. Not sure why Glassfish asks for
> those though. A war file could be considered a web app I guess.
> Tomorrow I'll test adding those empty dirs
>
>
>
> Other than that the web container does not recognize the app
> as a web app.
>
>
> Thanks.
>
> - Tim
>
>
> Jose Noheda wrote:
>> Hi,
>>
>> I tried this ant task:
>>
>> <target name="dojo" description="--> Downloads and packages
>> dojo">
>> <get
>> src="http://download.dojotoolkit.org/release-1.2.0b1/dojo-release-1.2.0b1-src.tar.gz"
>> dest="dojo-1.2.tar.gz" verbose="true" usetimestamp="true" />
>> <untar src="dojo-1.2.tar.gz" dest="dojo"
>> compression="gzip" />
>> <war destfile="dojo/dojo-1.2.war" needxmlfile="false"
>> basedir="dojo/dojo-release-1.2.0b1-src/" level="9" />
>> </target>
>>
>> which should build a valid WAR file without a web.xml. I
>> tried to deploy the generated WAR using the admin console and
>> it fails with:
>>
>> GRAVE: Module type not recognized
>>
>> Can someone confirm this is a bug? Or the WAR is not well formed?
>>
>> Regards
>
>
>