|Deploying remote web resources [message #684268]
||Wed, 15 June 2011 10:10
Registered: February 2010
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.
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
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.
|Re: Deploying remote web resources [message #685042 is a reply to message #684891]
||Thu, 16 June 2011 17:18
| Larry Isaacs
Registered: July 2009
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.
|Re: Deploying remote web resources [message #688770 is a reply to message #685042]
||Sat, 25 June 2011 17:04
Registered: February 2010
Thanks guys for your help. I did eventually work out why it was not working. The following two entries were causing the problem. |
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.
Powered by FUDForum
. Page generated in 0.02379 seconds