This week's book giveaway is in the Open Source forum.
We're giving away four copies of Programmers Guide to Apache Thrift and have Randy Abernethy on-line!
See this thread for details.
Win a copy of Programmers Guide to Apache Thrift this week in the Open Source forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Path of template not found  RSS feed

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have imported a maven project that was previously in a computer with WIndows as OS and the project is now in Linux OS. So I had to change the directory of the templates. Now when I try to run the program, he says that he can not find the template path because he is still using the old one, even if I have changed it.

The error message is :

Template not found: C:\Users\Aula1_2\Desktop\workspace\Sigil\WebContent\WEB-INF\template\Door.html




I have defined the template url in Confing class:



Then I have used the template in a view class:



 
Marshal
Posts: 64471
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Discussion moved to our Maven forum.
 
Marshal
Posts: 5980
155
Chrome Eclipse IDE Java Postgres Database Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see the connection between the classes Config and ViewHtml.  How is ViewHtml called?
 
Daniel Russell
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:I don't see the connection between the classes Config and ViewHtml.  How is ViewHtml called?



There is an Interface wich ViewHtml implements, wich is IView:



then I use the view in the servlet, for example here:



And the fact is that the browser can not find the template, because he is still using the old path e non not the new one.

I have recently discovered that when I go to "configure build path" there is an error in servlet-api.jar, because he can not find obviously the old path, and he says that is missing.

 
Knute Snortum
Marshal
Posts: 5980
155
Chrome Eclipse IDE Java Postgres Database Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's the full error message and stack trace?  Can you have the class log what path it is trying when it fails?
 
Daniel Russell
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:What's the full error message and stack trace?  Can you have the class log what path it is trying when it fails?


In the console it is not displayed any error. The only message is on the browser and it is this:

Template not found: C:\Users\Aula1_2\Desktop\workspace\Sigil\WebContent\WEB-INF\template\Door.html



He is trying to search the old directory and it doesn't find it, because, I have changed it to the new one, the one of Linux, wich is this:

 /home/dario/eclipse-workspace/Sigil/WebContent/WEB-INF/template/Door.html



this path is defined in the class Config.
 
Knute Snortum
Marshal
Posts: 5980
155
Chrome Eclipse IDE Java Postgres Database Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm assuming you've restarted the server after changing the config.  Is there any possibility that the config info is still in the jar, or have you rebuilt that?
 
Daniel Russell
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:I'm assuming you've restarted the server after changing the config.  Is there any possibility that the config info is still in the jar, or have you rebuilt that?



Yes, it is possible, I haven't changed any jar file. In fact when I go to "configure build path" there is a message near the servlet-api.jar and the message is:

/Sigil/C:/Users/Aula1_2/Dekstop/workspace/tomcat/lib (missing)



it means that there has to be a library with the new path?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!