You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Anthony Martin <An...@TRAMS.com> on 2001/07/30 16:48:27 UTC

Struts w/JBuilder 5

Has anyone gotten a Struts project to work in JBuilder5?  Currently, my
project is able to "make" but unable to execute.  I get the following
message in the console:

Error: 500
Location: /WebCBP/error.jsp
Internal Servlet Error:

javax.servlet.ServletException: Missing message for key general.title
	at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:459)
	at
_0002ferror_0002ejsperror_jsp_0._jspService(_0002ferror_0002ejsperror_jsp_0.
java:359)

Normally, if I saw this message, I would check the
ApplicationResources.properties file.  In fact, I think it's related.
JBuilder5 can't find this file, but I don't know where to put it in order
for it to see it.  Any thoughts?



Anthony
  
The awful thing about getting it right the first time is that nobody
realizes how hard it was.


Unknown 

RE: Struts w/JBuilder 5

Posted by Bill G <to...@pacbell.net>.
Saw the following in borland.public.jbuilder newsgroup.

-----------------------------------------------------
We use struts with JBuilder 4 & 5 no problem,

and problem you describe can be avoided.
Instead of using the default 'context' to store
your web app.,Create another 'context'
say 'Utilicorp' to run your project under.
JBuilder will not clear out the
Utilicorp/WEB-INF/lib directory.

Jay Guidos wrote:
>
> Hi All,
>
> We have been working on getting JB5 and Struts working, but it seems some
> prebuilt features of JB5 means that they cannot.
>
> We installed Struts, built a JB5 library reference to it, copied in all
the
> tld files (yadda yadda yadda) and immediately got all the problems
> referenced here and in other news groups.
>
> We finally got them all nearly resolved, but it seems we have a conundrum.
> JB5 clears the WEB-INF/lib directory before each web-run, to be sure there
> are no old libraries lying around.  Then, all libraries that are included
in
> the WAR file are copied over and all should be well and good.  If we
include
> our Struts library file into the project and ask it to be included into
the
> WAR file we see this happen.
>
> BUT!!!!  By putting the Struts library file in the project (so it will be
> copied into the WEB-INF/lib directory) JB5 also automatically puts all
its'
> jar file references onto the java.exe classpath when tomcat is run. Since
> the system class loader is invoked before the application class loader
> (apparently) then the struts jars get loaded by the system loader and not
> the application loader and struts doesn't work properly!
>
> So, it seems to me we need to be able to include a JB5 library in a
project,
> in order to get it distributed with the WAR, but we need to be able to
> request that it is not included on the classpath during run and debug
> testing.  I don't see how we can do this using JB5 as it is now.  Further,
> this 'don't include jar files on classpath' option should only be
available
> while running a WebApp compliant servlet engine, and of course all the
> struts jars should be included in the classpath during compiles (otherwise
> compiling would never work right either).
>
> Seems complicated, and DEFINITELY broken.  Anyone know how to get around
> this?
>
> Jay Guidos
> Utilicorp Networks

--
Robert Leland (rleland@freetocreate.org)
804 N. Kenmore Street
Arlington, VA 22201-2225
Voice: 703-525-3580

-----Original Message-----
From: David Bolsover [mailto:david@bolsover.com]
Sent: Monday, July 30, 2001 1:05 PM
To: struts-user@jakarta.apache.org
Subject: RE: Struts w/JBuilder 5


Following the thread concerning Struts/JB5 I thought that I should chuck in
my own thoughts - JB5 is great for debugging but - boy does it take some
effort to set up - I am sure that there must be a simpler way of getting it
all to hang together but here's my technique:

1 File|NewProject
	Project Wizard step 1
	Project name "strutsconfig" or whaterver you want
	Project for defaults "(Default project)"
	Root path "C:/jbuilder5/jakarta-tomcat-3.2.1/webapps" does not have to be
this but I think it is useful to be able to test project outside of JBuilder
and this is the default JB install structure
	Project directory name "strutsconfig" - JBuilder will do this for you.
	Source Directory name "WEF-INF/src"
	Backup Directory name "WEB-INF/bak"
	Document directory name "WEB-INF/doc"
	Output directory name "WEB-INF/classes"
	Check Project directory is parent to source and output directories.

	Project Wizard step 2
	Add struts.jar to Required Libraries (you have got the struts download
havn't you).
	If you have not already configured the struts library you can do this later
and add the library through the project properties dialogue.

	Project Wizard step 3
	whatever you want

	Finish


2 File|New Class
	The only reason for using the class wizard at this point is to create the
directory stucture under
"C:/jbuilder5/jakarta-tomcat-3.2.1/webapps/strutsconfig"
	Just create any class - Untitled1 will do nicely - you can delete it later.
Use your usual package names eg: com.foo.struts.strutsconfig
	Uncheck all the options.
	OK

3 Project|Make Project "strutsconfig" - whatever you called your project

4 Switch to Explorer and browse to:
"C:/jbuilder5/jakarta-tomcat-3.2.1/webapps/strutsconfig

If everything has gone according to plan you should have the following
directory structure:

\strutsconfig
 +WEB-INF
  +classes
  | +com
  |  +foo
  |   +struts
  |    +strutsconfig
  +src
    +com
     +foo
      +struts
       +strutsconfig


	5 Add a new folder named "lib" under /strutsconfig/WEB-INF

strutsconfig
 +-WEB-INF
  +classes
  | +com
  |  +foo
  |   +struts
  |    +strutsconfig
  |
  +src
  | +com
  |  +foo
  |   +struts
  |    +strutsconfig
  +lib

	6 From the struts distribution, copy struts.jar into
/strutsconfig/WEB-INF/lib

	7 From the struts distribution, copy the various .tld files you will be
referencing into /strutsconfig/WEB-INF for the sake of this demo copy at
least struts-bean.tld and struts-html.tld

	8 Back to JBuilder
		File|New|Web Application
		Name "strutsconfig"
		Directory "C:/jbuilder5/jakarta-tomcat-3.2.1/webapps/strutsconfig
		Check the Generate WAR box
		OK


	9 struts-config.xml goes in \strutsconfig\WEB-INF directory
	  web.xml goes in \strutsconfig\WEB-INF directory
	  resouce.properties file goes in
\strutsconfig\WEB-INF\classes\com\foo\.... and make sure it is correctly
referenced in the web.xml file!!
	  .tld's go in \strutsconfig\WEB-INF directory
	  .jsp go in root (or path from) \strutsconfig

	10 This is the fun part
	   Now you have your basic struts app - just a couple of jsp's and you are
ready to run
	   Use Project|Make project
	   Then "Web Run your chosen .jsp


	   In the messages view you will doubtless get lots of info but the first
line should be somthing like:

	   C:\jbuilder5\jdk1.3\bin\javaw -classpath
"C:\jbuilder5\jakarta-tomcat-3.2.1\lib\webserver.jar;C:\jbuilder5\jakarta-to
mcat-3.2.1\lib\jasper.jar;C:\jbuilder5\jakarta-tomcat-3.2.1\lib\parser.jar;C
:\jbuilder5\jakarta-tomcat-3.2.1\lib\jaxp.jar;C:\jbuilder5\jakarta-tomcat-3.
2.1\lib\servlet.jar;C:\jbuilder5\extras\jakarta-struts-1.0\lib\struts.jar;C:
\jbuilder5\lib\webserverglue.jar;C:\jbuilder5\extras\jakarta-struts-1.0\lib\
struts.jar;C:\jbuilder5\extras\jakarta-struts-1.0\lib\jdbc2_0-stdext.jar;C:\
jbuilder5\jakarta-tomcat-3.2.1\lib\servlet.jar;C:\jbuilder5\extras\ecs-1.4.1
\ecs-1.4.1.jar;C:\jbuilder5\extras\ecs-1.4.1\lib\jakarta-regexp-1.2.jar;C:\j
builder5\extras\ecs-1.4.1\lib\xerces-1.2.2.jar;C:\jbuilder5\lib\jdsserver.ja
r;C:\jbuilder5\lib\beandt.jar;C:\jbuilder5\lib\dx.jar;C:\jbuilder5\jdk1.3\de
mo\jfc\Java2D\Java2Demo.jar;C:\jbuilder5\jdk1.3\jre\lib\i18n.jar;C:\jbuilder
5\jdk1.3\jre\lib\jaws.jar;C:\jbuilder5\jdk1.3\jre\lib\rt.jar;C:\jbuilder5\jd
k1.3\jre\lib\sunrsasign.jar;C:\jbuilder5\jdk1.3\lib\dt.jar;C:\jbuilder5\jdk1
.3\lib\tools.jar"  org.apache.tomcat.startup.Tomcat -config
C:\jbuilder5\jakarta-tomcat-3.2.1\webapps\opsdemo3\conf\server8080.xml

(horrid isn't it)

	   Further down the messages you should have somthing like:

	   Classpath according to the Servlet Engine is:
C:\jbuilder5\jakarta-tomcat-3.2.1\webapps\opsdemo3\WEB-INF\classes;C:\jbuild
er5\jakarta-tomcat-3.2.1\webapps\opsdemo3\WEB-INF\lib\struts.jar;C:\jbuilder
5\jakarta-tomcat-3.2.1\webapps\opsdemo3\WEB-INF\lib\ecs-1.4.1.jar;C:\jbuilde
r5\jakarta-tomcat-3.2.1\webapps\opsdemo3\WEB-INF\lib\jdbc2_0-stdext.jar

	   Copy the two pieces of text into a text editor and splice them together
taking the second message from C:\jbuilder5 .. to the end and placing this
just after -classpath " in the first message - add a ';' to separate from
the rest of the classpath.

	   Delete the opening "C:\jbuilder5\jdk1.3\bin\javaw " and everything after
the closing '"' (that is get rid of "org.apache.....r8080.xml" )

	   You should be left with somthing like:

	   -classpath
"C:\jbuilder5\jakarta-tomcat-3.2.1\webapps\opsdemo3\WEB-INF\classes;C:\jbuil
der5\jakarta-tomcat-3.2.1\webapps\opsdemo3\WEB-INF\lib\struts.jar;C:\jbuilde
r5\jakarta-tomcat-3.2.1\webapps\opsdemo3\WEB-INF\lib\ecs-1.4.1.jar;C:\jbuild
er5\jakarta-tomcat-3.2.1\webapps\opsdemo3\WEB-INF\lib\jdbc2_0-stdext.jar;C:\
jbuilder5\jakarta-tomcat-3.2.1\lib\webserver.jar;C:\jbuilder5\jakarta-tomcat
-3.2.1\lib\jasper.jar;C:\jbuilder5\jakarta-tomcat-3.2.1\lib\parser.jar;C:\jb
uilder5\jakarta-tomcat-3.2.1\lib\jaxp.jar;C:\jbuilder5\jakarta-tomcat-3.2.1\
lib\servlet.jar;C:\jbuilder5\extras\jakarta-struts-1.0\lib\struts.jar;C:\jbu
ilder5\lib\webserverglue.jar;C:\jbuilder5\extras\jakarta-struts-1.0\lib\stru
ts.jar;C:\jbuilder5\extras\jakarta-struts-1.0\lib\jdbc2_0-stdext.jar;C:\jbui
lder5\jakarta-tomcat-3.2.1\lib\servlet.jar;C:\jbuilder5\extras\ecs-1.4.1\ecs
-1.4.1.jar;C:\jbuilder5\extras\ecs-1.4.1\lib\jakarta-regexp-1.2.jar;C:\jbuil
der5\extras\ecs-1.4.1\lib\xerces-1.2.2.jar;C:\jbuilder5\lib\jdsserver.jar;C:
\jbuilder5\lib\beandt.jar;C:\jbuilder5\lib\dx.jar;C:\jbuilder5\jdk1.3\demo\j
fc\Java2D\Java2Demo.jar;C:\jbuilder5\jdk1.3\jre\lib\i18n.jar;C:\jbuilder5\jd
k1.3\jre\lib\jaws.jar;C:\jbuilder5\jdk1.3\jre\lib\rt.jar;C:\jbuilder5\jdk1.3
\jre\lib\sunrsasign.jar;C:\jbuilder5\jdk1.3\lib\dt.jar;C:\jbuilder5\jdk1.3\l
ib\tools.jar"

	   Now copy all of this (take care not to include and new line characters)
into Project|Project properties|Run|VM parameters.

	11 Try to debug - if it's all OK you will be able to debug within JBuilder5
	   Try to launch Tomcat on its own that should work too with this
configuration.


	12 Tear out hair if you ever use Project|Rebuild project because JBuilder5
will trash the project by deleting the \lib     directory and the
resource.properties file - don't ask me why


	Good luck

	PS if anyone is brave enough to check out all the above and find my
mistakes - please post me the corrections!!!!



David
E-Mail : david@bolsover.com
Web    : http://www.bolsover.com




RE: Struts w/JBuilder 5

Posted by David Bolsover <da...@bolsover.com>.
Following the thread concerning Struts/JB5 I thought that I should chuck in
my own thoughts - JB5 is great for debugging but - boy does it take some
effort to set up - I am sure that there must be a simpler way of getting it
all to hang together but here's my technique:

1 File|NewProject
	Project Wizard step 1
	Project name "strutsconfig" or whaterver you want
	Project for defaults "(Default project)"
	Root path "C:/jbuilder5/jakarta-tomcat-3.2.1/webapps" does not have to be
this but I think it is useful to be able to test project outside of JBuilder
and this is the default JB install structure
	Project directory name "strutsconfig" - JBuilder will do this for you.
	Source Directory name "WEF-INF/src"
	Backup Directory name "WEB-INF/bak"
	Document directory name "WEB-INF/doc"
	Output directory name "WEB-INF/classes"
	Check Project directory is parent to source and output directories.

	Project Wizard step 2
	Add struts.jar to Required Libraries (you have got the struts download
havn't you).
	If you have not already configured the struts library you can do this later
and add the library through the project properties dialogue.

	Project Wizard step 3
	whatever you want

	Finish


2 File|New Class
	The only reason for using the class wizard at this point is to create the
directory stucture under
"C:/jbuilder5/jakarta-tomcat-3.2.1/webapps/strutsconfig"
	Just create any class - Untitled1 will do nicely - you can delete it later.
Use your usual package names eg: com.foo.struts.strutsconfig
	Uncheck all the options.
	OK

3 Project|Make Project "strutsconfig" - whatever you called your project

4 Switch to Explorer and browse to:
"C:/jbuilder5/jakarta-tomcat-3.2.1/webapps/strutsconfig

If everything has gone according to plan you should have the following
directory structure:

\strutsconfig
 +WEB-INF
  +classes
  | +com
  |  +foo
  |   +struts
  |    +strutsconfig
  +src
    +com
     +foo
      +struts
       +strutsconfig


	5 Add a new folder named "lib" under /strutsconfig/WEB-INF

strutsconfig
 +-WEB-INF
  +classes
  | +com
  |  +foo
  |   +struts
  |    +strutsconfig
  |
  +src
  | +com
  |  +foo
  |   +struts
  |    +strutsconfig
  +lib

	6 From the struts distribution, copy struts.jar into
/strutsconfig/WEB-INF/lib

	7 From the struts distribution, copy the various .tld files you will be
referencing into /strutsconfig/WEB-INF for the sake of this demo copy at
least struts-bean.tld and struts-html.tld

	8 Back to JBuilder
		File|New|Web Application
		Name "strutsconfig"
		Directory "C:/jbuilder5/jakarta-tomcat-3.2.1/webapps/strutsconfig
		Check the Generate WAR box
		OK


	9 struts-config.xml goes in \strutsconfig\WEB-INF directory
	  web.xml goes in \strutsconfig\WEB-INF directory
	  resouce.properties file goes in
\strutsconfig\WEB-INF\classes\com\foo\.... and make sure it is correctly
referenced in the web.xml file!!
	  .tld's go in \strutsconfig\WEB-INF directory
	  .jsp go in root (or path from) \strutsconfig

	10 This is the fun part
	   Now you have your basic struts app - just a couple of jsp's and you are
ready to run
	   Use Project|Make project
	   Then "Web Run your chosen .jsp


	   In the messages view you will doubtless get lots of info but the first
line should be somthing like:

	   C:\jbuilder5\jdk1.3\bin\javaw -classpath
"C:\jbuilder5\jakarta-tomcat-3.2.1\lib\webserver.jar;C:\jbuilder5\jakarta-to
mcat-3.2.1\lib\jasper.jar;C:\jbuilder5\jakarta-tomcat-3.2.1\lib\parser.jar;C
:\jbuilder5\jakarta-tomcat-3.2.1\lib\jaxp.jar;C:\jbuilder5\jakarta-tomcat-3.
2.1\lib\servlet.jar;C:\jbuilder5\extras\jakarta-struts-1.0\lib\struts.jar;C:
\jbuilder5\lib\webserverglue.jar;C:\jbuilder5\extras\jakarta-struts-1.0\lib\
struts.jar;C:\jbuilder5\extras\jakarta-struts-1.0\lib\jdbc2_0-stdext.jar;C:\
jbuilder5\jakarta-tomcat-3.2.1\lib\servlet.jar;C:\jbuilder5\extras\ecs-1.4.1
\ecs-1.4.1.jar;C:\jbuilder5\extras\ecs-1.4.1\lib\jakarta-regexp-1.2.jar;C:\j
builder5\extras\ecs-1.4.1\lib\xerces-1.2.2.jar;C:\jbuilder5\lib\jdsserver.ja
r;C:\jbuilder5\lib\beandt.jar;C:\jbuilder5\lib\dx.jar;C:\jbuilder5\jdk1.3\de
mo\jfc\Java2D\Java2Demo.jar;C:\jbuilder5\jdk1.3\jre\lib\i18n.jar;C:\jbuilder
5\jdk1.3\jre\lib\jaws.jar;C:\jbuilder5\jdk1.3\jre\lib\rt.jar;C:\jbuilder5\jd
k1.3\jre\lib\sunrsasign.jar;C:\jbuilder5\jdk1.3\lib\dt.jar;C:\jbuilder5\jdk1
.3\lib\tools.jar"  org.apache.tomcat.startup.Tomcat -config
C:\jbuilder5\jakarta-tomcat-3.2.1\webapps\opsdemo3\conf\server8080.xml

(horrid isn't it)

	   Further down the messages you should have somthing like:

	   Classpath according to the Servlet Engine is:
C:\jbuilder5\jakarta-tomcat-3.2.1\webapps\opsdemo3\WEB-INF\classes;C:\jbuild
er5\jakarta-tomcat-3.2.1\webapps\opsdemo3\WEB-INF\lib\struts.jar;C:\jbuilder
5\jakarta-tomcat-3.2.1\webapps\opsdemo3\WEB-INF\lib\ecs-1.4.1.jar;C:\jbuilde
r5\jakarta-tomcat-3.2.1\webapps\opsdemo3\WEB-INF\lib\jdbc2_0-stdext.jar

	   Copy the two pieces of text into a text editor and splice them together
taking the second message from C:\jbuilder5 .. to the end and placing this
just after -classpath " in the first message - add a ';' to separate from
the rest of the classpath.

	   Delete the opening "C:\jbuilder5\jdk1.3\bin\javaw " and everything after
the closing '"' (that is get rid of "org.apache.....r8080.xml" )

	   You should be left with somthing like:

	   -classpath
"C:\jbuilder5\jakarta-tomcat-3.2.1\webapps\opsdemo3\WEB-INF\classes;C:\jbuil
der5\jakarta-tomcat-3.2.1\webapps\opsdemo3\WEB-INF\lib\struts.jar;C:\jbuilde
r5\jakarta-tomcat-3.2.1\webapps\opsdemo3\WEB-INF\lib\ecs-1.4.1.jar;C:\jbuild
er5\jakarta-tomcat-3.2.1\webapps\opsdemo3\WEB-INF\lib\jdbc2_0-stdext.jar;C:\
jbuilder5\jakarta-tomcat-3.2.1\lib\webserver.jar;C:\jbuilder5\jakarta-tomcat
-3.2.1\lib\jasper.jar;C:\jbuilder5\jakarta-tomcat-3.2.1\lib\parser.jar;C:\jb
uilder5\jakarta-tomcat-3.2.1\lib\jaxp.jar;C:\jbuilder5\jakarta-tomcat-3.2.1\
lib\servlet.jar;C:\jbuilder5\extras\jakarta-struts-1.0\lib\struts.jar;C:\jbu
ilder5\lib\webserverglue.jar;C:\jbuilder5\extras\jakarta-struts-1.0\lib\stru
ts.jar;C:\jbuilder5\extras\jakarta-struts-1.0\lib\jdbc2_0-stdext.jar;C:\jbui
lder5\jakarta-tomcat-3.2.1\lib\servlet.jar;C:\jbuilder5\extras\ecs-1.4.1\ecs
-1.4.1.jar;C:\jbuilder5\extras\ecs-1.4.1\lib\jakarta-regexp-1.2.jar;C:\jbuil
der5\extras\ecs-1.4.1\lib\xerces-1.2.2.jar;C:\jbuilder5\lib\jdsserver.jar;C:
\jbuilder5\lib\beandt.jar;C:\jbuilder5\lib\dx.jar;C:\jbuilder5\jdk1.3\demo\j
fc\Java2D\Java2Demo.jar;C:\jbuilder5\jdk1.3\jre\lib\i18n.jar;C:\jbuilder5\jd
k1.3\jre\lib\jaws.jar;C:\jbuilder5\jdk1.3\jre\lib\rt.jar;C:\jbuilder5\jdk1.3
\jre\lib\sunrsasign.jar;C:\jbuilder5\jdk1.3\lib\dt.jar;C:\jbuilder5\jdk1.3\l
ib\tools.jar"

	   Now copy all of this (take care not to include and new line characters)
into Project|Project properties|Run|VM parameters.

	11 Try to debug - if it's all OK you will be able to debug within JBuilder5
	   Try to launch Tomcat on its own that should work too with this
configuration.


	12 Tear out hair if you ever use Project|Rebuild project because JBuilder5
will trash the project by deleting the \lib     directory and the
resource.properties file - don't ask me why


	Good luck

	PS if anyone is brave enough to check out all the above and find my
mistakes - please post me the corrections!!!!



David
E-Mail : david@bolsover.com
Web    : http://www.bolsover.com




RE: Struts w/JBuilder 5

Posted by Renzo Toma <re...@xs4all.nl>.
Anthony,

Welcome to the strange world of JBuilder5!

Check if JB has copied your ApplicationResources.properties (or equivalent)
to the output path. If not, check if you have set your Project Properties ->
Build -> Resource -> 'properties' to 'copy'.

Also I noticed, when I do a rebuild JB removes all lot of files from the
output path. Stick to making a project or file, or do a rebuild followed by
a make.

Have I said JB is weird yet? Well, here you go: it is weird!

For this reason, I do not run struts from within JB but outside. More
control and a quicker boottime.

Cheers,


Renzo

-----Original Message-----
From: Anthony Martin [mailto:Anthony@TRAMS.com]
Sent: maandag 30 juli 2001 16:48
To: Struts User List (E-mail)
Subject: Struts w/JBuilder 5


Has anyone gotten a Struts project to work in JBuilder5?  Currently, my
project is able to "make" but unable to execute.  I get the following
message in the console:

Error: 500
Location: /WebCBP/error.jsp
Internal Servlet Error:

javax.servlet.ServletException: Missing message for key general.title
	at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:459)
	at
_0002ferror_0002ejsperror_jsp_0._jspService(_0002ferror_0002ejsperror_jsp_0.
java:359)

Normally, if I saw this message, I would check the
ApplicationResources.properties file.  In fact, I think it's related.
JBuilder5 can't find this file, but I don't know where to put it in order
for it to see it.  Any thoughts?



Anthony

The awful thing about getting it right the first time is that nobody
realizes how hard it was.


Unknown