• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

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

 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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



 
Bartender
Posts: 4109
72
Hibernate Fedora Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic