aspose file tools*
The moose likes Servlets and the fly likes getting 404 error.. this is not struts application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "getting 404 error.. this is not struts application" Watch "getting 404 error.. this is not struts application" New topic
Author

getting 404 error.. this is not struts application

amitabh mehra
Ranch Hand

Joined: Dec 05, 2006
Posts: 98
i am new to ejb and trying my hands on ejb3. This is not a struts application... its ejb3 that i am working with.. mvc architecture. i created a ear file the structure is:



the application.xml is:



in the myStore.war, structure is:



the web.xml is:


the userRegister.html is like:


i m deploying the ear file in jboss5.0.1GA. on clicking the submit button, i get error that MyStore/MyStore/UserRegistration.do not found.
I guess I have made some wrong entry in web.xml or application.xml. Not sure where and what.
Am i missing something?
Please help!
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Assuming the URL you are trying is http://[server]:[port]/MyStore/[whatever context your HTML page has]/UserRegistration.do you should be hitting your Servlet. Is that the URL you are using?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
amitabh mehra
Ranch Hand

Joined: Dec 05, 2006
Posts: 98
When I submit the userRegistration.html page, the url is:
http://localhost:8080/MyStore/MyStore/UserRegistration.do

with error 404.

I thing there is some mismatch in the hierarchy of the ear file, servlet definition in the web.xml and the action in html page. I have tried different combos but none worked.

I even tried typing different urls to hit UserRegistration.do directly, like:

http://localhost:8080/MyStore/UserRegistration.do
or
http://localhost:8080/MyStore/MyStore/MyStore/UserRegistration.do

but none worked.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10059
    
163

Post the last few lines from the JBoss console which show your application being deployed and the server being started. And are you accessing this URL from the same machine where the AS is running?

[My Blog] [JavaRanch Journal]
Satya Maheshwari
Ranch Hand

Joined: Jan 01, 2007
Posts: 368
@amitabh mehra
In application.xml, try putting context-root as:

<context-root>/MyStore</context-root>

instead of:
<context-root>MyStore</context-root>

Maybe it may help.


Thanks and Regards
amitabh mehra
Ranch Hand

Joined: Dec 05, 2006
Posts: 98
sorry to update the thread so late... was not able to try the suggestions.

@Satya
tried after changing the application.xml.... nope, it didnt work.

@Jaikiran
Here is the console prints while bringing up the jboss server... might be too big... but was not sure what to leave out
(tried attaching it as txt / log file.. not allowed to upload)





I hope it will help to get where I am going wrong.
amitabh mehra
Ranch Hand

Joined: Dec 05, 2006
Posts: 98
@Jaikiran
did you get any clue from the log?

any help in this will be highly appreciated because i am stuck at this point and atmost i can do now is just read but cant implement and test...
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10059
    
163

Sorry did not notice your previous post.

18:07:01,484 INFO [TomcatDeployment] deploy, ctxPath=/MyStore

So the WAR is definitely being deployed and is available at http://localhost:8080/MyStore

I am assuming that your application has an index.html or some such welcome page. Or else that URL will lead to a 404 error.


The only suspicious thing that's in the log is this:

18:07:02,515 WARN [config] Unable to process deployment descriptor for context '/MyStore'

I haven't seen any JBoss related classes with that "config" name. Looks like some application (/framework) is logging that message?
amitabh mehra
Ranch Hand

Joined: Dec 05, 2006
Posts: 98
Jaikiran

I can access the url http://localhost:8080/MyStore/MyStore/userRegister.html
on submitting the form, it should call a servlet... as I have already stated in my earlier post, but it fails giving 404.

it surely has to do something with the paths... ahhhhhhh.. this is so irritating dont know how to proceed....
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10059
    
163

Amitabh,

This no longer is a EJB question, i'll move this to our Servlets forum where you might get some useful help.

on submitting the form, it should call a servlet... as I have already stated in my earlier post, but it fails giving 404.


Can you post those servlet mappings? And also the 404 error message details that you see in the browser (it usually shows the path to the resource which was not found).
amitabh mehra
Ranch Hand

Joined: Dec 05, 2006
Posts: 98
Okies Jaikiran, let me try in this forum also

i have already given the servlet mapping in my earlier post.
any help will be highly appreciated
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: getting 404 error.. this is not struts application