Skip to main content

Why is glassfish looking in docroot for my jspx file?

8 replies [Last post]
nuffsaidx
Offline
Joined: 2008-12-18

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
lomniczi
Offline
Joined: 2009-09-24

Hi,

I think you solved this problem, but I even write my answer:

I think if you deploy the web application from NetBeans (leastwise in version 6.7.1), Glassfish will overwrite the context root with this value: application name'-WAR'.You should look at the generated xml, here:

domains//generated/xml/j2ee-apps//META-INF/sun-application.xml

See the value of 'context-root' entry.

Solution: If you want to access the application on the desired context path, deploy it from Admin Console or script.

wooff
Offline
Joined: 2010-08-24

Hello,
did you solve this problem? I am stucked at same place ))-:
W

Alexis Moussine-Pouchkine

How is (are) your servlet(s) declared? Can you share your web.xml?
docroot is for static content.
-Alexis

On Dec 24, 2008, at 20:25, glassfish@javadesktop.org wrote:

> I am finding, running my jsf page in glassfish a bit of a bother.
> All these ubiquitous 'hello world' examples on the Internet are like
> a new car advert on the telly--new roads, no traffic except you, car
> and your dame. Time to ban all "Hello World" programs. Sorry, I
> digress; the problem is that it is far more complex as I am finding
> out.
>
> I have successfully deployed my xxx.ears which contains the
> following modules:
> entities.jar
> xxx-ejb.jar
> xxx.web.war
>
> And I have a 'xxx.ear_deployed' ticket—in a manner of speaking-- to
> prove it. Even the server.log says:
>
> “#|2008-12-24T18:33:33.809+0000|INFO|sun-appserver2.1|
> javax.enterprise.system.tools.deployment|
> _ThreadID=15;_ThreadName=Timer-11;|[AutoDeploy] Autodeployed”
>
> Next I sat up for the next stage, namely, type:
>
> http://localhost:8080/xxx-web/pages/auth/new.jspx in firefox (and
> then in Opera for second opinion)
>
> but all to no avail. Glassfish responds:
>
> [#|2008-12-24T17:04:39.107+0000|SEVERE|sun-appserver2.1|
> org.apache.jasper.servlet.JspServlet|
> _ThreadID
> =16;_ThreadName=httpSSLWorkerThread-8080-0;_RequestID=1772cc60-
> fa48-4479-8636-b16298b3aa73;|PWC6117: File "/path to.../ glassfish/
> domains/domain1/[b]docroot[/b]/xxx-web/pages/autho/new.jspx" not
> found|#
>
> My question is why is glassfish looking for my 'news.jspx' in
> docroot (sigh!). I am not familiar with the docroot thingy.
>
> I am a seasoned but ex JBossAS user and very tempted to try JBoss 5
> but switching tools or introducing a new one in the middle of a
> project is a NO NO for me. My friends, what am I doing wrong or not
> doing right?
>
> Dev. environment:
>
> Linux (Centos 5.x)
> Eclipse 3.4
> Glassfish 2.1
> Myfaces 1.2.5
> Trinidad 1.2.9
> [Message sent by forum member 'nuffsaidx' (nuffsaidx)]
>
> http://forums.java.net/jive/thread.jspa?messageID=323230
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

nuffsaidx
Offline
Joined: 2008-12-18

[b]>>Can you share your web.xml?[/b]

Alexis. I must thank you for your response. And here is my web.xml (attached).

I have just edited it, only to remove sensitive info, so if you find any typos or open tag, please ignore it--The web.xml has been tested for well-formedness prior to this last minute editing.

In the past, I have even tried with a 'bare bone' web.xml but with no success. This problem is holding my work back, and I am already four days behind schedule trying to find the solution to the problem. What looks like a simple problem is now a major problem eating into project deadline.

Indeed against my better judgment and experience (and advise to others), I am contemplating abandoning glassfish, at the middle of a project, for JBoss, which I have used over the years. We can't afford the time.

Thanks again, Alexis, for your response.
And my apologies for 'letting it out'--as if that would solve the problem.

nuffsaidx

Alexis Moussine-Pouchkine

Humm... lots of dependencies here. I don't think I have the time to
reproduce, sorry.

Make sure you've read how to use the myfaces JSF implementation in
GlassFish : http://blogs.sun.com/arungupta/entry/totd_59_alternative_jsf_implementat...

Since you're saying the app deployed fine, I suppose there are no
exceptions in domains/domain1/logs/server.log and would suggest you
bump up the log level for the web container either using the web
console : Application Server > logging > log levels , or by editing
domains/domain1/config/domain.xml (look for )
to understand how your request is being translated to a call to a
static resource in docroot. Sounds like a servlet is not set up
properly...

thanks,
-Alexis

On Dec 26, 2008, at 9:17, glassfish@javadesktop.org wrote:

> [b]>>Can you share your web.xml?[/b]
>
> Alexis. I must thank you for your response. And here is my web.xml
> (attached).
>
> I have just edited it, only to remove sensitive info, so if you find
> any typos or open tag, please ignore it--The web.xml has been tested
> for well-formedness prior to this last minute editing.
>
> In the past, I have even tried with a 'bare bone' web.xml but with
> no success. This problem is holding my work back, and I am already
> four days behind schedule trying to find the solution to the
> problem. What looks like a simple problem is now a major problem
> eating into project deadline.
>
> Indeed against my better judgment and experience (and advise to
> others), I am contemplating abandoning glassfish, at the middle of a
> project, for JBoss, which I have used over the years. We can't
> afford the time.
>
> Thanks again, Alexis, for your response.
> And my apologies for 'letting it out'--as if that would solve the
> problem.
>
> nuffsaidx
> [Message sent by forum member 'nuffsaidx' (nuffsaidx)]
>
> http://forums.java.net/jive/thread.jspa?messageID=323306
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

nuffsaidx
Offline
Joined: 2008-12-18

Alexis Moussine...

Thanks for your suggestions, however, I am still looking for a solution. After deploying my foo.ear into glassfish auotdeploy (using Eclipse Export->EAR File), I opened my Opera (or firefox) to render the following URL:

http://localhost:8080/foo-web/pages/autho/new.jspx

But glassfish reports (short version):

[b]
[#|2008-12-28T19:22:47.756+0000|FINE|sun-appserver2.1|org.apache.jasper.servlet.JspServlet|_ThreadID=25;_ThreadName=httpSSLWorkerThread-8080-0;ClassName=org.apache.jasper.servlet.JspServlet;MethodName=service;_RequestID=97fe4739-c904-4385-a31c-d382b55456c2;|JspEngine --> [/foo-web/pages/autho/new.jspx] ServletPath: [/foo-web/pages/autho/new.jspx] PathInfo: [null] RealPath: [/home/fooprj/applications/glassfish/domains/domain1/docroot/foo-web/pages/autho/new.jspx] RequestURI: [/foo-web/pages/autho/new.jspx] QueryString: [null]|#]

[#|2008-12-28T19:22:47.759+0000|SEVERE|sun-appserver2.1|org.apache.jasper.servlet.JspServlet|_ThreadID=25;_ThreadName=httpSSLWorkerThread-8080-0;_RequestID=97fe4739-c904-4385-a31c-d382b55456c2;|PWC6117: [u]File "/home/fooprj/applications/glassfish/domains/domain1/docroot/foo-web/pages/autho/new.jspx" not found[/u]|#]
[/b]
Note the 'docroot' in the following file path:

File "/home/fooprj/applications/glassfish/domains/domain1/[b][u]docroot[/u][/b]/foo-web/pages/autho/new.jspx" not found.

[b]Project Structure:[/b]
fooEAR
fooEJB
fooWEB
.....WebContent
..........|---pages
...............|--autho
....................|--new.jspx

[b]Questions:[/b]
1.Why is it looking in docroot when I have no file in there or put another way, why is it attaching 'docroot' to the file path?
2.Under what circumstance would glassfish attach 'docroot' to the file path.

If I know the answer to question 2, I would be able to gain some insight into the causes.

Any suggestion or hint would be appreciated.

nuffsaidx
Offline
Joined: 2008-12-18

It is difficult to believe that in the life-time of glassfish (and before it, Sun Java System Application Server) that no one else has seen the following error:

[b][#|2008-12-28T19:22:47.759+0000|SEVERE|sun-appserver2.1|org.apache.jasper.servlet.JspServlet|_ThreadID=25;_ThreadName=httpSSLWorkerThread-8080-0;_RequestID=97fe4739-c904-4385-a31c-d382b55456c2;|PWC6117: [u]File "/home/fooprj/applications/glassfish/domains/domain1/docroot/foo-web/pages/autho/new.jspx" not found|#][/u] [/b]

whilst trying to render a jsp/jsf page—please see ealier post--from a web module enclosed in an ear, which has been verified and deployed successfully in the glassfish autodeploy directory?

My core question is:
Under what circumstance would glassfish attach 'docroot' to the file path?

Any help would be appreciated. And thanks

Alexis Moussine-Pouchkine

On Dec 29, 2008, at 14:23, glassfish@javadesktop.org wrote:

> It is difficult to believe that in the life-time of glassfish (and
> before it, Sun Java System Application Server) that no one else has
> seen the following error:

sounds odd indeed but I'd suggest trying to come up with a smaller
test case.
That would certainly help nail down the issue.
-Alexis

> [b][#|2008-12-28T19:22:47.759+0000|SEVERE|sun-appserver2.1|
> org.apache.jasper.servlet.JspServlet|
> _ThreadID
> =25;_ThreadName=httpSSLWorkerThread-8080-0;_RequestID=97fe4739-
> c904-4385-a31c-d382b55456c2;|PWC6117: [u]File "/home/fooprj/
> applications/glassfish/domains/domain1/docroot/foo-web/pages/autho/
> new.jspx" not found|#][/u] [/b]
>
> whilst trying to render a jsp/jsf page—please see ealier post--from
> a web module enclosed in an ear, which has been verified and
> deployed successfully in the glassfish autodeploy directory?
>
> My core question is:
> Under what circumstance would glassfish attach 'docroot' to the file
> path?
>
> Any help would be appreciated. And thanks
> [Message sent by forum member 'nuffsaidx' (nuffsaidx)]
>
> http://forums.java.net/jive/thread.jspa?messageID=323511
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net