• Post Reply Bookmark Topic Watch Topic
  • New Topic

REST webservice + HTML using jquery libs is not working when deployed on same web application

 
Sharad Kharya
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am facing issue when deploying my web application which have both rich UI using jquery-ui and webservices.
I am not able to load the mentioned .css & .js files in my html.

I am getting error in firebug -

If I remove the webservice file, from my project. I am easily able to invoke my html with all Rich UI look & feel.

I spent 2 days, but really not understanding, what is going wrong here.

please help me on this.

Thanks



 
Vijitha Kumara
Bartender
Posts: 3952
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's hard to see the issue without knowing the structure/context of this application. What did you mean by "... remove the webservice file" ?
 
Sharad Kharya
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have made some changes in my example to make it more simple for demo on javaranch.
Please find the screenshot of project structure in Eclipse.

Please Note:- As mentioned in my original post - I have replaced the jquery .js files with my test.js. As I found, the issue is not specific to jquery, even it is not working with any included .js file

Here is my code snippet.

HelloWsService.java


Test.js


web.xml


cvr_test.html


index.html



With above code, when I run
1. http://localhost:8080/CVR_WS_GitHub/cvrrest - I get 'Hello sayDefault' on my web page. As it points to the mapped webservices
2. http://localhost:8080/CVR_WS_GitHub/cvrtest - I do not get anything in my UI, but getting following error in server and firebug console

a. server console error.



b. firebug error




The very interesting point here is,
If I remove the webservice class i.e. HelloWsService.java and make my application a pure WebApplication and restart tomcat server.
Then I am successfully able to run http://localhost:8080/CVR_WS_GitHub/cvrtest
and I get alert message along with 'Hello CVR TEST HTML' in UI.


I really do not understand the root cause of this issue.

Please help me. Also let me know, if I am doing something wrong.
Hope, I have posted all the required details.

Thanks in Advance.

Project Structure.jpg
[Thumbnail for Project Structure.jpg]
Project Structure in Eclipse
 
Sharad Kharya
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. Can somebody help me on this.
This is the first time I am feeling helpless because nobody is helping me in javaranch.

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!