This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

The script seems looking for WatermarkServlet, but it looks on the wrong place  RSS feed

 
Lennart Sandqvist
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello folks

Now the attachments are added.

Please help me finding a way solving the problem.
The failure begun when I created a new site in the present site in order to create space for development.

As I copied the whole site and putted it in a new directory in the present site.
The site contained a tomcat5-webapps directory, and consequently, the whole lot ended up with 2 tomcat5-webapps directories.

I think that was the reason why the problems started. There is no need to comment on this. The importent bi is to solve the problem.

I have now restored it to the last functioning settings, ie with only one tomcat5-webapps directory, but it still does not work


Please read the enclosed "directory_structure_for_tomcat.txt"
and the screen dump with comments: "Sequences just before failure.doc"

I will return when I have converted the attachments to allowed formats. Any suggestion is appreciated, for practical format for files with embedded pictures.

Regards

Sequences just before failure has been converted into 2 png images
The "directory structure for tomcat" written in here below.
Please comment on the questions 1 and 2 below.

My site does not fuction in spite of restoring it to last functioning settings

My site after restoring to last functioning settings of directory structure (present structure) :
public_html/lagenergihus.nu/tomcat5-webapps/
public_html/lagenergihus.nu/tomcat5-webapps/app/WEB-INF
public_html/lagenergihus.nu/tomcat5-webapps/app/WEB-INF/web.xml
public_html/lagenergihus.nu/tomcat5-webapps/app/WEB-INF/lib
public_html/lagenergihus.nu/tomcat5-webapps/app/WEB-INF/lib/itext-2.0.4.jar
public_html/lagenergihus.nu/tomcat5-webapps/app/WEB-INF/classes
public_html/lagenergihus.nu/tomcat5-webapps/app/WEB-INF/classes/WatermarkServlet.class



As the javascript is looking for the WatermarkServlet at public_html/lagenergihus.nu/app/ 1)
would it be a solution to create a directory at public_html/lagenergihus.nu/app/ and putting
a file there pointing to the right directory?
1) see the screen dump.

Question 1
How should in such case that file be named and what should it contain?


I have taken part of the following exemple of directory structure in Levonlines Faq:
public_html/mindomän.com/app/
public_html/mindomän.com/tomcat5-webapps/
public_html/mindomän.com/tomcat5-webapps/app/WEB-INF
public_html/mindomän.com/tomcat5-webapps/app/WEB-INF/lib
public_html/mindomän.com/tomcat5-webapps/app/WEB-INF/lib/example.jar
public_html/mindomän.com/tomcat5-webapps/app/WEB-INF/classes
public_html/mindomän.com/tomcat5-webapps/app/WEB-INF/classes/HelloServlet.class
public_html/mindomän.com/tomcat5-webapps/app/index.jsp


If I use this structure on my site, would it solve the problem?
Only the first and the last line would be new.


public_html/lagenergihus.nu/app/ Question 1. See above
public_html/lagenergihus.nu/tomcat5-webapps/
public_html/lagenergihus.nu/tomcat5-webapps/app/WEB-INF
public_html/lagenergihus.nu/tomcat5-webapps/app/WEB-INF/web.xml
public_html/lagenergihus.nu/tomcat5-webapps/app/WEB-INF/lib
public_html/lagenergihus.nu/tomcat5-webapps/app/WEB-INF/lib/itext-2.0.4.jar
public_html/lagenergihus.nu/tomcat5-webapps/app/WEB-INF/classes
public_html/lagenergihus.nu/tomcat5-webapps/app/WEB-INF/classes/WatermarkServlet.class
public_html/lagenergihus.nu/tomcat5-webapps/app/index.jsp Question 2. What should this index file contain?

2016-05-12-(1).png
[Thumbnail for 2016-05-12-(1).png]
2016-05-12-(2).png
[Thumbnail for 2016-05-12-(2).png]
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your WatermarkServlet class should be in a package.
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And, welcome to the Ranch!
 
Lennart Sandqvist
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:And, welcome to the Ranch![

Thank You
 
Lennart Sandqvist
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:Your WatermarkServlet class should be in a package.


Interesting. How should that package look like? What should it contain?

The Watermarking was installed year 2007 and has been running well all years.
When the problems started, I restored it to a date in year 2008.

I can not see any difference between the present directory structure and that of year 2008.
All tomcat files are in one directory: public_html/lagenergihus.nu/tomcat5-webapps/

What have I been missing?
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What should the package look like?



The compiled class should of course be in a path whose folder names match the package name.

As of about Java 5, I think, Java was changed so that a class in a package can't import a class which isn't in a package. Probably you upgraded Java in your copying process (hopefully you did because old versions have security exposures) and now you have this problem. It shouldn't take you more than 15 minutes to put the class into a package of whatever name you choose and rebuild the WAR.
 
Lennart Sandqvist
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:What should the package look like?



The compiled class should of course be in a path whose folder names match the package name.

As of about Java 5, I think, Java was changed so that a class in a package can't import a class which isn't in a package. Probably you upgraded Java in your copying process (hopefully you did because old versions have security exposures) and now you have this problem. It shouldn't take you more than 15 minutes to put the class into a package of whatever name you choose and rebuild the WAR.


Hi Paul

Thanks for your suggestions.

As I understand it, put the WatermarkServlet class in a package, means a complete new installation. Am I right?

I did not do the installation myself at the time, and I am a beginner to tomcat and java, so I would like to get some help.

Would you please give me a step by step guide to follow.

I have been looking into the files in the present installation:, in order to see how much local coding there are.
There are 3 files.
1. web.xml
2. WatermarkServlet.class
3. itext-2.0.4.jar

The first looks like very general. The URL-pattern has to be considered.
The No 2 looks like being all local coding.
The No 3 must be all general coding.

In a new installation, the 1 and 3 might come with packet. The URL-pattern might correct itself when installed.

For the No 2 the code has to be rewritten,
or can I use the file as it is,
or copy the content into the "your code goes here" in your suggestion.

There is a lot of coding as the name and address and order number is marked on the drawing before downloading. There are different sizes of drawings. It took a while testing to get the marking on the correct location.

I enclose another screen dump of the directory structure, the one above might have been confusing. Too many written lines.

Regards
2016-05-15-(1).png
[Thumbnail for 2016-05-15-(1).png]
Directory structure present
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not 100% sure that's the problem. I suggested putting the class into a package because it's the professional thing to do and because it's easy to do, and because there's a good chance that it could fix your problem.

But it seems that it's not an easy thing for you to do after all.

If you were in control of generating the WAR file then all you'd have to do is to put the source code (with one line added) for WatermarkServlet into the right folder, recompile it, modify the web.xml to match, rebuild the WAR, and you're done. However if you don't know how to do that, then this forum isn't the place to teach you how. Perhaps you could consider finding somebody who knows how to do that and help you through the process?
 
Lennart Sandqvist
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:I'm not 100% sure that's the problem. I suggested putting the class into a package because it's the professional thing to do and because it's easy to do, and because there's a good chance that it could fix your problem.

But it seems that it's not an easy thing for you to do after all.

If you were in control of generating the WAR file then all you'd have to do is to put the source code (with one line added) for WatermarkServlet into the right folder, recompile it, modify the web.xml to match, rebuild the WAR, and you're done. However if you don't know how to do that, then this forum isn't the place to teach you how. Perhaps you could consider finding somebody who knows how to do that and help you through the process?


Thanks Paul

I will try my best. Regards
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I was thinking... if you could just recompile your WatermarkServlet to be in the, let's say, the "watermark" package, then you could put it into this folder like this:

public_html/lagenergihus.nu/tomcat5-webapps/app/WEB-INF/classes/watermark/WatermarkServlet.class

in your existing Tomcat installation, the one which isn't working yet. You'd also have to change the installation's web.xml to refer to the servlet in its package. But you might get away without having to rebuild the whole thing. You just need a Java compiler, and you likely have that already.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!