Board index » jbuilder » JB 2007 J2EE problem

JB 2007 J2EE problem


2007-03-03 12:08:11 AM
jbuilder11
Folks
I have just installed JB2007 and am attempting to port an existing J2EE project from JB2005.
My current problem is that when I run build and run the server, no libraries are copied into
WEB-INF-lib. So Tomcat doesn't find them and falls over.
It does matter if I select "run modules directly from workspace (do not modify Tomcat installation)"
or not. If this is unticked the class files get copied to the TC webapps dir as I would expect, but
nothing gets written to the TC webapps WEB-INF/lib. There are no libs created in the local
"WebContent/WEb-INF/lib" dir,
How do I tell JB2007 to copy the project libraries in WEB-INF/lib dir?
Thanks - Adam
 
 

Re:JB 2007 J2EE problem

Adam Lipscombe wrote:
Quote
How do I tell JB2007 to copy the project libraries in WEB-INF/lib dir?
Open the properties dialog for your web project. On the "J2EE Module
Dependencies" page, choose the "Web Libraries" tab. This is where you
can add libraries that you want included in your WAR file.
Whatever you add on this page will also show up in "Web App Libraries"
on the "Libraries" tab of the "Java Build Path" properties page, but you
can't actually edit them there. You also won't be able to add source or
documentation attachments for these libraries. At least not via the
properties UI (maybe if you open a class found in one of the libraries
it will let you add a source attachment that way). I find the UI for
dealing with JEE projects extremely inconsistent and confusing.
Does that help?
--
Gillmer J. Derge [TeamB]
 

Re:JB 2007 J2EE problem

That seems to have sorted it. Many thanks...
One more question - I can see how to deploy the app to Tomcat (via the "servers" config page).
But I cannot see how to tell JB to generate a war file.
Q: How do I tell JB to generate a war file?
Q: How do I "pull" a copy of the project from CVS without any of the CVS dirs or .cvsignore files so
that I can produce a production build?
(In JB2005 this was possible via an option on the "New Project from CVS" wizard)
TIA - Adam
Gillmer J. Derge [TeamB] wrote:
Quote
Adam Lipscombe wrote:
>How do I tell JB2007 to copy the project libraries in WEB-INF/lib dir?

Open the properties dialog for your web project. On the "J2EE Module
Dependencies" page, choose the "Web Libraries" tab. This is where you
can add libraries that you want included in your WAR file.

Whatever you add on this page will also show up in "Web App Libraries"
on the "Libraries" tab of the "Java Build Path" properties page, but you
can't actually edit them there. You also won't be able to add source or
documentation attachments for these libraries. At least not via the
properties UI (maybe if you open a class found in one of the libraries
it will let you add a source attachment that way). I find the UI for
dealing with JEE projects extremely inconsistent and confusing.

Does that help?

 

{smallsort}

Re:JB 2007 J2EE problem

Adam Lipscombe wrote:
Quote
Q: How do I tell JB to generate a war file?
With great difficulty. Currently perhaps one of my biggest gripes with
JB2007.
1. File | Export...
2. Web / War file
3. <Next>
4. Fill in the appropriate values.
5. <Finish>
This actually works fine, but I haven't yet found any way to automate
the process, so I always need to open that dialog and flip through the
settings in order to generate an EAR. I'm not convinced that any of the
Eclipse WTP developers have ever actually tried to use this stuff on a
real project.
Quote
Q: How do I "pull" a copy of the project from CVS without any of the CVS
dirs or .cvsignore files so that I can produce a production build?
(In JB2005 this was possible via an option on the "New Project from CVS"
wizard)
I haven't used it yet, but while investigating the EAR/WAR export
recently, I discovered that you can also export a "Team Project Set."
Use the File | Export... menu item and browse to Team / Team Project Set
in the wizard dialog.
If you look at the generated file, it appears to be a simple XML file
containing the VCS settings for your projects. Presumably you can then
use File | Import... to load those projects into your workspace from
version control (that's the part I haven't actually done yet).
--
Gillmer J. Derge [TeamB]
 

Re:JB 2007 J2EE problem

Adam Lipscombe wrote:
Quote

That seems to have sorted it. Many thanks...

One more question - I can see how to deploy the app to Tomcat (via the "servers" config page).
But I cannot see how to tell JB to generate a war file.

Q: How do I tell JB to generate a war file?
The JAR and WAR export plugins in JB2007 are extremely limited.
Although it is a hassle to have to learn a new scripting language, using
Ant and setting up a build.xml file is the best way to generate WAR and
JAR files in JB2007. When you configure an Ant build in your project it
is run every time you do a clean build, or you can right-click the
build.xml in Package Explorer and do Run-As for an Ant Build.
Quote
Q: How do I "pull" a copy of the project from CVS without any of the CVS dirs or .cvsignore files so
that I can produce a production build?
(In JB2005 this was possible via an option on the "New Project from CVS" wizard)
Sorry I haven't used source control in JB2007 yet.
- Kelvin
 

Re:JB 2007 J2EE problem

"Gillmer J. Derge [TeamB]" < XXXX@XXXXX.COM >wrote in
Quote
Adam Lipscombe wrote:
>Q: How do I tell JB to generate a war file?

With great difficulty. Currently perhaps one of my biggest gripes
with JB2007.

1. File | Export...

2. Web / War file

3. <Next>

4. Fill in the appropriate values.

5. <Finish>

This actually works fine, but I haven't yet found any way to automate
the process, so I always need to open that dialog and flip through the
settings in order to generate an EAR. I'm not convinced that any of
the Eclipse WTP developers have ever actually tried to use this stuff
on a real project.

>Q: How do I "pull" a copy of the project from CVS without any of the
>CVS dirs or .cvsignore files so that I can produce a production
>build? (In JB2005 this was possible via an option on the "New Project
>from CVS" wizard)

I haven't used it yet, but while investigating the EAR/WAR export
recently, I discovered that you can also export a "Team Project Set."
Use the File | Export... menu item and browse to Team / Team Project
Set in the wizard dialog.

If you look at the generated file, it appears to be a simple XML file
containing the VCS settings for your projects. Presumably you can
then use File | Import... to load those projects into your workspace
from version control (that's the part I haven't actually done yet).

You MUST be joking...how is this a step forward?
What are the people saying "this is great" using 2007 for exactly?
--
Patrick Maloney
New York State Workers' Compensation Board
(Remove REMOVE from e-mail address to reply)