Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Deploying remote web resources
Deploying remote web resources [message #684268] Wed, 15 June 2011 10:10 Go to next message
ziggy  is currently offline ziggy Friend
Messages: 11
Registered: February 2010
Junior Member
I have an eclipse dynamic web project in the following folder

c:\documents and settings\me\My Documents\eclipse\workspace\myProject


The project is a web project using struts and jsp files and i would like it to refer to source files that are in the following locations

Java source files -  c:\myfiles\app\java\com
Libraries         -  c:\myfiles\app\java\lib
Web resources     -  c:\myfiles\app\java\webapp


To achieve the above i created a linked folder that links to c:\myfiles\app.

I then changed the build path to include c:\myfiles\app\java\com as the source folder (with lib & webapp excluded). I also created a user library that points to all jar files in c:\myfiles\app\javalib and added the user library in the project.

Now the problem i am having is with the web resources folder (c:\myfiles\app\webapp) which includes all the jsp, javascript, css etc. I had a look around and found that it was possible to link to the web content folder via Properties>Deployment Assembly.

I set up the "Deployment Assembly" to point to the c:\myfiles\app\webapp so now the deployment assembly setup looks like this

Deploy Path     Source
/               /WebContent
/WEB-INF/classes    /src
/WEB-INF/classes    /remote.trunc/app/java
/               /remote.trunc/app/java/webapp


remote.trunc is the linked folder that points to c:\myfiles\app.
The WebContent folder is the web folder configured by eclipse. My project does not use this as the web resources i want to use are in /remote.trunc/app/java/webapp

I run the application via Eclipse's tomcat and i can get to the index.jsp file that is at the top level of webapp folder. This means that the remote web resources folder is also deployed. But when i click on any link i get the following error

The requested resource (/myProject/findUser) is not available.

The difference between the index.jsp is that the index.jsp is called directly and does not go via any struts. Any of the links are struts actions. My guess is that something is not being deployed correctly in the libraries etc.

I had a look at the eclipse deployment folder in eclipse.metadata.plugins\org.eclipse.wst.server.core\tmp0 and everything appears to be in place.

Any ideas?
Re: Deploying remote web resources [message #684371 is a reply to message #684268] Wed, 15 June 2011 13:42 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 6/15/2011 6:10 AM, ziggy wrote:
> I have an eclipse dynamic web project in the following folder
>
> c:\documents and settings\me\My Documents\eclipse\workspace\myProject
>
> The project is a web project using struts and jsp files and i would like
> it to refer to source files that are in the following locations
>
> Java source files - c:\myfiles\app\java\com
> Libraries - c:\myfiles\app\java\lib
> Web resources - c:\myfiles\app\java\webapp
>
> To achieve the above i created a linked folder that links to
> c:\myfiles\app.
>
> I then changed the build path to include c:\myfiles\app\java\com as the
> source folder (with lib & webapp excluded). I also created a user
> library that points to all jar files in c:\myfiles\app\javalib and added
> the user library in the project.
>
> Now the problem i am having is with the web resources folder
> (c:\myfiles\app\webapp) which includes all the jsp, javascript, css etc.
> I had a look around and found that it was possible to link to the web
> content folder via Properties>Deployment Assembly.
>
> I set up the "Deployment Assembly" to point to the c:\myfiles\app\webapp
> so now the deployment assembly setup looks like this
>
> Deploy Path Source
> / /WebContent
> /WEB-INF/classes /src
> /WEB-INF/classes /remote.trunc/app/java
> / /remote.trunc/app/java/webapp
>
> remote.trunc is the linked folder that points to c:\myfiles\app.
> The WebContent folder is the web folder configured by eclipse. My
> project does not use this as the web resources i want to use are in
> /remote.trunc/app/java/webapp
>
> I run the application via Eclipse's tomcat and i can get to the
> index.jsp file that is at the top level of webapp folder. This means
> that the remote web resources folder is also deployed. But when i click
> on any link i get the following error
>
> The requested resource (/myProject/findUser) is not available.
>
> The difference between the index.jsp is that the index.jsp is called
> directly and does not go via any struts. Any of the links are struts
> actions. My guess is that something is not being deployed correctly in
> the libraries etc.
>
> I had a look at the eclipse deployment folder in
> eclipse.metadata.plugins\org.eclipse.wst.server.core\tmp0 and everything
> appears to be in place.
>
> Any ideas?
>

The key question is does this atypically configured project publish
correctly to "...\org.eclipse.wst.server.core\tmp0\...". The only clue
here is "everything appears to be in place". If this is true, I don't
know of any reason you would have problems unless there was something
wrong with the Dynamic Web Project itself. If the Tomcat log doesn't
offer any clues as to what is actually happening, you may need to use
logging perhaps debug mode to see where things are going wrong.

Cheers,
Larry
Re: Deploying remote web resources [message #684891 is a reply to message #684371] Thu, 16 June 2011 12:46 Go to previous messageGo to next message
ziggy  is currently offline ziggy Friend
Messages: 11
Registered: February 2010
Junior Member
By everything appears to be in place i meant the folder that was deployed contained everything i was expecting. i..e all the jsp files, libraries and all the class files in WEB-INF/classes.

The tomcat log does not show any errors during deployment. Did you mean i can debug the deployment?
Re: Deploying remote web resources [message #685042 is a reply to message #684891] Thu, 16 June 2011 17:18 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
On 6/16/2011 8:46 AM, ziggy wrote:
> By everything appears to be in place i meant the folder that was
> deployed contained everything i was expecting. i..e all the jsp files,
> libraries and all the class files in WEB-INF/classes.
> The tomcat log does not show any errors during deployment. Did you mean
> i can debug the deployment?

With the testing I've done, I would expect the project to publish
correctly. However, I haven't tested a scenario with as much "linking"
as yours. I would say the odds strongly favor something being wrong in
the webapp, but a publishing problem can't be ruled out completely.

When the webapp doesn't respond as expected, determining where it's
going wrong and what it's doing instead can be a challenge sometimes.
This is especially true for "can't find resource" errors, where this is
the expected result for tons of different mistakes. Sometimes the
problem can be found by double checking things. When this doesn't work,
running the server in debug mode is one way to try to discover what is
actually happening. Unfortunately, if things are going wrong before it
reaches your code, it means you may need additional source, such as
Tomcat or Struts source.

An alternate approach is to use logging to determine what's going wrong.
However, figuring out how to configure the logging to give you useful
information can be a challenge too. You can turn on DEBUG logging for
everything, but then you have to scan through lots of noise to find what
you need. This approach also assumes logging is actually implemented
where it's needed to show you what's going wrong. Sometimes this proves
not to be true.

It has been a long time since I played with Struts. I do recall one
general impression, which was that simple mistakes can result in things
not working with virtually no clue as to what I did wrong. I usually
can't find my mistakes just by examination, so I'm pretty quick to grab
source and start debugging.

Cheers,
Larry
Re: Deploying remote web resources [message #688770 is a reply to message #685042] Sat, 25 June 2011 17:04 Go to previous message
ziggy  is currently offline ziggy Friend
Messages: 11
Registered: February 2010
Junior Member
Thanks guys for your help. I did eventually work out why it was not working. The following two entries were causing the problem.

> /WebContent
> /remote.trunc/app/java/webapp

The first one was the webcontent folder in the eclipse project folder and the other was the webcontent folder on the remote folder. As i was not using the first i decided to remove and it started working. My guess is that given that both folders had WEB-INF/web.xml files eclipse could not deploy it correctly. It was probably deploying the local one which is why i couldnt figure out why i couldnt access any of the other jsp pages.

Previous Topic:Run an Applet from Dynamic Web Project
Next Topic:Publish working sporadically
Goto Forum:
  


Current Time: Tue Apr 23 13:15:43 GMT 2024

Powered by FUDForum. Page generated in 0.03054 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top