File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes HelloWorld error, struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Application Frameworks » Struts
Reply Bookmark "HelloWorld error, struts 2" Watch "HelloWorld error, struts 2" New topic
Author

HelloWorld error, struts 2

Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 1923
Im running the sample blank app.

I imported into RAD 7.5(eclipse-based ide).

When I run index.html, it cannot find the url 'example/HelloWorld', and gives 'page not found'.

The same thing happens when I click login button at the login page. It cannot find the 'example/Login' url.

Any ideas?
Gayathri Chowduru
Ranch Hand

Joined: Oct 17, 2007
Posts: 42
Hi Angeles,

Actually you posted was,
************************************************************************
When I run index.html, it cannot find the url 'example/HelloWorld', and gives 'page not found'.
************************************************************************

Go to Project-->Properties-->Server

Check whether the WebSphere Application Server is there or not. If you have the WebSphere, make sure in the above path, the server is there or not..

If you did't install the WebSphere, you can run this on tomcat.. Install the tomcat and go to the above path and give the directory of tomcat and then try to run..

Thanks,
Gayathri Chowduru.
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 1923
I ran on RAD 7.5 with Tomcat and it went perfectly fine.

It doesnt run on WAS 6 or jboss.

The error I described is when I am trying to run it on WAS 6.

I didnt get what you mean about the properties / server.

Also, is there any issue about struts on these servers? I am wondering why they are not able to run the sample HelloWorld.

I also tried netbeans+glassfish, and the app ran fine.

My real target now is to use eclipse(or any flavor of eclipse) , plus either glassfish, jboss or WAS 6. But I am unable to find a good set.
[ March 31, 2008: Message edited by: Jesus Angeles ]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Struts 2 will not run on WebSphere 6 becuase it uses the wrong version of the java SDK. If you will look at the specifications for Struts 2, you will see that one of the requirements is that it must use Java SDK 1.5 or above. WebSphere 6.0 uses SDK 1.4.2, and therefore cannot run a Struts 2 application. If you want to run Struts 2 applications on WebSphere, you will have to use version 6.1, as it does have the required SDK level.

However, even with version 6.1, you have to "tweak" it a little before it will work. Just make sure you have the latest fix packs, and set the property com.ibm.ws.webcontainer.invokefilterscompatibility in the web Container custom properties to true. You do this by using the admin console and selecting:

Application Servers -> <server> -> Web Container Settings -> Web Container -> Custom Properties.

Another minor point: There is no RAD version 7.5. RAD 7.0.0.5 is the latest version.
[ March 31, 2008: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 1923
Originally posted by Merrill Higginson:
Struts 2 will not run on WebSphere 6 becuase it uses the wrong version of the java SDK. If you will look at the specifications for Struts 2, you will see that one of the requirements is that it must use Java SDK 1.5 or above. WebSphere 6.0 uses SDK 1.4.2, and therefore cannot run a Struts 2 application. If you want to run Struts 2 applications on WebSphere, you will have to use version 6.1, as it does have the required SDK level.

However, even with version 6.1, you have to "tweak" it a little before it will work. Just make sure you have the latest fix packs, and set the property com.ibm.ws.webcontainer.invokefilterscompatibility in the web Container custom properties to true. You do this by using the admin console and selecting:

Application Servers -> <server> -> Web Container Settings -> Web Container -> Custom Properties.

Another minor point: There is no RAD version 7.5. RAD 7.0.0.5 is the latest version.

[ March 31, 2008: Message edited by: Merrill Higginson ]


Merrill,

You are a life-saver! [this is not an april fool's day post]

It worked. Apparently, for the struts 1, I also needed to do it to run it in WAS 6.

Now, with another website's help (http://www.devx.com/Java/Article/31571/0/page/3), I was able to configure MySql at WAS 6, for EJB 3.

Now I am ready for my Struts 2/EJB 3/WAS 6/MySql project. Few hours before your post, I already gave up on it, and decided to go netbeans/glassfish, but now I am back to my favorite IDE.

For the RAD version, it is a 7.5 beta.
Lao Zhu
Greenhorn

Joined: Aug 17, 2009
Posts: 2
Same 404 error when I deploy struts 2 to our websphere 6.1.0.7 server.

We did set com.ibm.ws.webcontainer.invokefilterscompatibility to true. But the error still exist.

We are running on a cluster environment. Would this be an issue?
Lao Zhu
Greenhorn

Joined: Aug 17, 2009
Posts: 2
Actually it was my mistake in the web.xml config. When change from <url-pattern>/*.action</url-pattern> TO <url-pattern>*.action</url-pattern>, it fixed.
Anila Mathew
Ranch Hand

Joined: Jun 16, 2004
Posts: 52

Hi Merill,

Thank You so much!!. I know this is an old thread, but could not help it, since this reply (tweaking in for 6.1) saved my time. I was breaking my head on this for 3 days!!

Regards,
Anila.
 
 
subject: HelloWorld error, struts 2
 
MyEclipse, The Clear Choice