Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Is WTP supposed to populate WEB-INF/lib for me?
Is WTP supposed to populate WEB-INF/lib for me? [message #166206] Fri, 07 April 2006 20:14 Go to next message
Chris Gage is currently offline Chris GageFriend
Messages: 74
Registered: July 2009
Member
I am using Eclipse 3.1.2 and WTP 1.0.1 installed about a week ago from
the update site and Tomcat 5.0.30. Most of the time things seems to
work more or less OK. But "most of the time" and "more or less ok" fall
short of the ideal.

Is there a functional definition anywhere of what WTP is definitively
supposed to do when I invoke a particular action such as Run-on-server
inside my web project? I can't help feeling that there is a certain
amount of randomness as to whether some things happen or not, and
whether they happen before other things that may be dependent on the result.

What gets copied, from where, to where? When does it get copied again?
How do I FORCE it to copy? These and other questions keep occurring
to me as I make a minor change to a JSP that has been working fine for
several days, and I save it and try to run it and get a 404 error, (yes,
a 404 error for a JSP that I just did rmb>run-on-server) and then I try
the same JSP again immediately, and it works. At other times I see the
"User operation is waiting for xxx to complete" dialog over and over
again, and each time it takes ages to do the JSP validation. Why does
this operation NOT get called in the cases where I get the 404?

In another case I get a message saying it can't find my JDBC driver
class, even though the official Oracle jar file containing it is there
sitting in my WEB-INF/lib, but no way can I make it appear in the
project's metadata. Sometimes if I make a change to a Servlet or a JSP
or a resource, it gets into the deployed code, other times it doesn't.
Restarting the server is not a guarantee that it will happen. What is
the magic spell that guarantees my project's files will get copied? Is
WEB-INF/lib in my project supposed to be populated for me from the
libraries I have defined in my project? Is the WEB-INF/lib in the
deployment target inside workspace/.metadata/.plugins/ supposed to be in
sync with what I have in my project's WEB-INF/lib? If so, when? How?
If not, why is it so selective?

Where are these rules all defined? What functionality is
guaranteed-else-bug?

I know there are a lot of questions in here....

Chris
Re: Is WTP supposed to populate WEB-INF/lib for me? [message #166246 is a reply to message #166206] Sat, 08 April 2006 04:39 Go to previous messageGo to next message
David Williams is currently offline David WilliamsFriend
Messages: 722
Registered: July 2009
Senior Member
On Fri, 07 Apr 2006 16:14:35 -0400, Chris Gage <chrisgage@bellsouth.net> wrote:

> I am using Eclipse 3.1.2 and WTP 1.0.1 installed about a week ago from
> the update site and Tomcat 5.0.30. Most of the time things seems to
> work more or less OK. But "most of the time" and "more or less ok" fall
> short of the ideal.
>
> .....
>
> Where are these rules all defined? What functionality is
> guaranteed-else-bug?
>
> I know there are a lot of questions in here....
>


There was a lot of questions in there! :) ... And, the short answer is there is not
a spec of "functionality is guarenteed-else-bug". You might try some of the tutorials
or "getting started" write-ups (you can find somewhere from main webtools page). And if something
doesn't work as written there, then that's a bug.

But, here are a couple of reminders: We are about to come out with R1.0.2, you might
try the "release candidate" and see if some of "the odd things" you are experiencing have been
fixed. Or ... if you are real energetic, you might try even one of our 1.5 builds. (though, some of those have
their own odd behavior).

Bottom line is: it is a bug if you don't like it, or does not work as you would expect it to.

But, the hard part, for you, for some of what you describe ... the semi random 404 errors, for example ...
are not especially easy for us to track down and fix. If you can find a good reproducible scenerio that
produces the "odd behavior", those would definitely be worth writing up as bugs. Even more helpful, if you find a bug
on 1.0.1 or 1.0.2, then its helpful to test and confirm if it is still a bug on preliminary 1.5 versions.

I know all that is not especially helpful to _you_ ... if you are "just trying to get work done" ... but, thought
I'd at least mention the general philosopy and approach.
Re: Is WTP supposed to populate WEB-INF/lib for me? [message #166356 is a reply to message #166246] Mon, 10 April 2006 14:51 Go to previous messageGo to next message
Chris Gage is currently offline Chris GageFriend
Messages: 74
Registered: July 2009
Member
David,

I'm not a beginner, in fact I have been developing web applications
since 2001, and Java code since 1996. I was development team lead on
IBM's first product shipped in Java in 1997. Now retired.

My problem is that a. I have previously used WSAD4 and WSAD5 and more
recently RAD6, which has insulated me from the real world with all the
extra stuff it does for you, and b. I have previously largely created
stuff from scratch while following the rules, ie I have not had to work
with stuff other people created skating around the rules.

Now I am a freelancer I am obliged to use whatever my customer provides,
in this case WTP, and to work with stuff that is part of a shrinkwrap
product, Crystal Reports XI (CR), whose documentation is fragmented into
hundreds of places that often contradict each other.

The 404 problems are "transient" in that eventually they go away, but I
have a specific case I cannot resolve. The application uses JDBC to
Oracle, and Oracle's official JDBC jar file is called ojdbc14.jar. It
is in my WEB-INF/lib folder as clear as day, along with a large number
of jar files from CR. The CR jar files get copied to the deployment
target at runtime, the Oracle jdbc jar file does not, so my code fails
because it cannot find its JDBC driver...

Let me ask a single question phrased differently: Suppose I were to
create an ant build to do it all for me (which I'll have to do
eventually for ship-to-production), correct me if I'm wrong, but it
would have to do the following:

Set a classpath for compile
Compile all java code for POJO and WEB projects
Zip the classes for each POJO java project into a jar file
Create a standard J2EE structure for the web project
Copy web classes to WEB-INF/classes
Copy runtime jar files to WEB-INF/lib
Copy POJO jar files created above to WEB-INF/lib
Copy web.xml to WEB-INF
Copy all JSPs, properties files and other "resources" to the root
Copy any additional folders such as /theme for CSS etc
Zip the J2EE structure into a WAR file.

So the question is, does WTP attempt to do all these steps for me?
Re: Is WTP supposed to populate WEB-INF/lib for me? [message #166383 is a reply to message #166356] Mon, 10 April 2006 22:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kc.baltz.yahoo.com

Do you have ojdbc14.jar mounted as part of your Eclipse Build path? If you
have any unit tests that use it, are they passing? I'm not sure if WTP will
copy WEB-INF/lib unless the jars in there are part of the build path.

I belive WTP is supposed to do everything you describe in your list, with
the possible exception of creating a WAR file, which is dependent on the
server to which you deploy. For Tomcat, my experience has been that it
deploys it to a directory without creating a WAR file. (which is faster for
development anyway).

K.C.


"Chris Gage" <chrisgage@bellsouth.net> wrote in message
news:e1drdt$oo6$1@utils.eclipse.org...
>
> David,
>
> I'm not a beginner, in fact I have been developing web applications since
> 2001, and Java code since 1996. I was development team lead on IBM's
> first product shipped in Java in 1997. Now retired.
>
> My problem is that a. I have previously used WSAD4 and WSAD5 and more
> recently RAD6, which has insulated me from the real world with all the
> extra stuff it does for you, and b. I have previously largely created
> stuff from scratch while following the rules, ie I have not had to work
> with stuff other people created skating around the rules.
>
> Now I am a freelancer I am obliged to use whatever my customer provides,
> in this case WTP, and to work with stuff that is part of a shrinkwrap
> product, Crystal Reports XI (CR), whose documentation is fragmented into
> hundreds of places that often contradict each other.
>
> The 404 problems are "transient" in that eventually they go away, but I
> have a specific case I cannot resolve. The application uses JDBC to
> Oracle, and Oracle's official JDBC jar file is called ojdbc14.jar. It is
> in my WEB-INF/lib folder as clear as day, along with a large number of jar
> files from CR. The CR jar files get copied to the deployment target at
> runtime, the Oracle jdbc jar file does not, so my code fails because it
> cannot find its JDBC driver...
>
> Let me ask a single question phrased differently: Suppose I were to
> create an ant build to do it all for me (which I'll have to do eventually
> for ship-to-production), correct me if I'm wrong, but it would have to do
> the following:
>
> Set a classpath for compile
> Compile all java code for POJO and WEB projects
> Zip the classes for each POJO java project into a jar file
> Create a standard J2EE structure for the web project
> Copy web classes to WEB-INF/classes
> Copy runtime jar files to WEB-INF/lib
> Copy POJO jar files created above to WEB-INF/lib
> Copy web.xml to WEB-INF
> Copy all JSPs, properties files and other "resources" to the root
> Copy any additional folders such as /theme for CSS etc
> Zip the J2EE structure into a WAR file.
>
> So the question is, does WTP attempt to do all these steps for me?
Re: Is WTP supposed to populate WEB-INF/lib for me? [message #166476 is a reply to message #166356] Tue, 11 April 2006 21:05 Go to previous messageGo to next message
David Williams is currently offline David WilliamsFriend
Messages: 722
Registered: July 2009
Senior Member
On Mon, 10 Apr 2006 10:51:41 -0400, Chris Gage <chrisgage@bellsouth.net> wrote:


> Let me ask a single question phrased differently: Suppose I were to
> create an ant build to do it all for me (which I'll have to do
> eventually for ship-to-production), correct me if I'm wrong, but it
> would have to do the following:
>
> Set a classpath for compile
> Compile all java code for POJO and WEB projects
> Zip the classes for each POJO java project into a jar file
> Create a standard J2EE structure for the web project
> Copy web classes to WEB-INF/classes
> Copy runtime jar files to WEB-INF/lib
> Copy POJO jar files created above to WEB-INF/lib
> Copy web.xml to WEB-INF
> Copy all JSPs, properties files and other "resources" to the root
> Copy any additional folders such as /theme for CSS etc
> Zip the J2EE structure into a WAR file.
>

Chris, thanks for clarifying ... I understand now the context of your question,
and, looks like you've got a rough draft of a spec here :)

Unfortunately, I do not know the answers to all these, so still a decent "feature request",
that WTP should "spec" its behavior. Well, at least for creating (exporting) a WAR!
(In fact, it'd be a good feature request, or contribution,! to provide an ant task to export a war!)

For "developement time" behavior, I'm not sure we should "spec" as working a certain way, since that
can change from release to release (some resources we want, when possible, to leave "in place", and others we
want to make copies of ... but, I think only partially implemented right now).

Hope this helps.
Re: Is WTP supposed to populate WEB-INF/lib for me? [message #166715 is a reply to message #166476] Thu, 13 April 2006 13:20 Go to previous messageGo to next message
Chris Gage is currently offline Chris GageFriend
Messages: 74
Registered: July 2009
Member
David,

OK, I volunteer. I'd like to be able to export an ant script from a WTP
project, just by rmb > export > ant script on the project name.

So we need to express this spec more rigorously, perhaps we could save
ourselves some confusion if we reused the carefully defined set of words
that are defined for RFCs... At a fundamental level, when you "do" WTP,
some things _MUST_ happen, some things _SHOULD_ happen, and some things
_MAY_ happen. These are the basics and should not be subject to
opinion. Some of these will (should?) be defined by the J2EE spec,
which I have not read for at least 3 years, and I will revisit.

But there is a more loose definition of what we in the community of WTP
users _BELIEVE_ is needed, and/or what we would _LIKE_ to have happen.

Chris
Re: Is WTP supposed to populate WEB-INF/lib for me? [message #167052 is a reply to message #166715] Tue, 18 April 2006 21:22 Go to previous message
David Williams is currently offline David WilliamsFriend
Messages: 722
Registered: July 2009
Senior Member
On Thu, 13 Apr 2006 09:20:48 -0400, Chris Gage <chrisgage@bellsouth.net> wrote:

>
> OK, I volunteer. I'd like to be able to export an ant script from a WTP
> project, just by rmb > export > ant script on the project name.
>

Ok, great, you are signed up :) Have a schedule yet? :)

Seriously though, I've noticed some innovation in Eclipse ... guess its the PDE?
Where you can "export a plugin" .. and as part of that process "save as an ant script".
That seems to be a nice way to re-use options, user preferences etc., in developement
environments ... give it a "quick test" .... and once happy with it, use the generated
ant script to produce some automated or ovenight sorts of builds.

I've not looked at it in detail, but just seems worth exploring a "common look and behavior"
for our parts of "Eclipse Export" as well.
Previous Topic:Problem creating Webservice in WTP 1.0 - Array out of bounds?
Next Topic:Error Starting eclipse "eclipse unable to read workbench state"
Goto Forum:
  


Current Time: Fri Mar 29 04:49:02 GMT 2024

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

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

Back to the top