Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

From Tomcat5 to Tomcat7

 
Michele Feliciani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody!
I'm experiencing a trouble caused by a Request/Response different from my previous version of Tomcat5 and Eclipse3.5
When my debug goes to:
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{

I see that my old variable "request" has got the following definition in Eclipse3.5/Tomcat5:
- <unknown type> request=CoyoteRequestFacade
+ ServletRequest request (RequestFacade)=CoyoteRequest
+ CoyoteRequest request (CoyoteRequestFacade)=CoyoteRequest

My new variabile in Tomcat7 is really simply and not so complete:
- request RequestFacade
+ request Request

The same appens also to Response; I also can't find significant logs or messages in Eclipse helping me to solve this hard trouble.
I wonder what I should install/modify to let me login.
Thanks a lot for your support.
Greetings,
Michele.

PS: if it could help, I attach something helpful during Tomcat7 starting:
Informazioni: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:....
Avvertenza: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:RRSWeb_Bari' did not find a matching property.
Informazioni: validateJarFile(C:\apache-tomcat-7.0.12\webapps\RRSWeb_Bari\WEB-INF\lib\javax.servlet.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64844
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The actual implementation classes do not matter and are liable to change from version to version. This is not a problem. The implementation classes implement the correct interface and that is all that matters.

Your error messages seem to indicate that you have included a version of the servlet API in your WEB-INF hierarchy, Remove it. You should never do this as the container will provided the servlet API (and JSP API) in the class path. You do not and should not.
 
Michele Feliciani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
thanks a lot for your support!
I've deleted javax.servlet.jar and I've resolved one of the warning.
But I still can't go on with the trouble in Coyote Request / Response.
The request variable is still this:
request RequestFacade (id=63)
request Request (id=87)

Here attached my startup warnings:
Avvertenza: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:RRSWeb_Bari' did not find a matching property.
Avvertenza: A docBase C:\apache-tomcat-7.0.12\webapps\RRSWeb_Bari inside the host appBase has been specified, and will be ignored
Informazioni: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_02\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jdk1.7.0_02\jre\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\Common Files\Acronis\SnapAPI\;C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\;.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64844
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I've already said, the implementation class doesn't matter. So is there really a problem here?
 
Michele Feliciani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's hard to explain because I can only tell you what happens when I start Tomcat7 and I open my application.
The only strange thing I see is that the variable request is different now from before, but I don't know how to transform it in CoyoteResponse ad ServerResponse.
The code of my software is the same, but now it doesn't work anymore in Tomcat7 + Java7 + Postgres 9.1
If there's something different I should say to explain it better, ask me what you want.
Greetings,
Michele.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64844
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Michele Feliciani wrote:The only strange thing I see is that the variable request is different now from before

As I've already explained twice, this is not strange, it is not wrong, and it is not unexpected. Why are you so focused on the implementation class of the interfaces? It doesn't matter.

but I don't know how to transform it in CoyoteResponse ad ServerResponse.

You don't. Why do you insist that you must?

The code of my software is the same, but now it doesn't work anymore in Tomcat7 + Java7 + Postgres 9.1

So instead of tilting at windmills, why do you not focus on what's really wrong rather than guessing that it's somehow about the behind-the-scenes details that don't matter?

If there's something different I should say to explain it better

Yes, tell what the real problem is. You haven't said. You've only guessed (incorrectly) about what might be wrong.

This is a classic example of the so-called "XY Problem". You're having problem X, but you've guessed that the problem is Y, and so are asking about Y when you should be asking about X.

 
Michele Feliciani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, no problem, I'm gonna use different words to explain what I'm looking for.
I'm a newbie so I apologize if I don't focus on the right problem.
Could you help me to find the real problem?
Should I delete other JARs in my external libraries after javax.servlet.jar?
Here what I have referenced to my code:
C:\RRS\lib\chart.ext.jar
C:\RRS\lib\chart.jar
C:\RRS\lib\chartServer.jar
C:\RRS\lib\commons-logging.jar
C:\RRS\lib\cos.jar
C:\RRS\lib\crimson.jar
C:\RRS\lib\dwr.jar
C:\RRS\lib\itext-1.3.jar
C:\RRS\lib\jaxp.jar
C:\RRS\lib\jcommon-1.0.16.jar
C:\RRS\lib\jfreechart-1.0.13.jar
C:\RRS\lib\jfreechart-1.0.13-experimental.jar
C:\RRS\lib\jfreechart-1.0.13-swt.jar
C:\RRS\lib\log4j.jar
C:\RRS\lib\poi-2.5-final-20040302.jar
C:\RRS\lib\postgresql-9.1-901.jdbc4.jar
C:\RRS\lib\swtgraphics2d.jar
C:\RRS\lib\xalan.jar
C:\RRS\lib\xerces.jar
C:\RRS\lib\junit-4.10.jar

Greetings,
Michele.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18164
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Avvertenza: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:RRSWeb_Bari' did not find a matching property


This sounds to me like you attempted to define an attribute on a Tomcat Context (sub?)element that isn't a valid attribute (property) name, Check the Context definition carefully. And come to think of it, why is an Eclipse component being assigned to a Tomcat webapp in the first place???


Avvertenza: A docBase C:\apache-tomcat-7.0.12\webapps\RRSWeb_Bari inside the host appBase has been specified, and will be ignored


This one sounds like you've got a URL mapping conflict. In J2EE, each webapp must be a discrete WAR and one WAR cannot contain another WAR. It's also possible that you've attempted to define a user WAR at the context root ("/") but not defined the Context information correctly.

One thing that will help a lot more than enumerating the names of Tomcat's internal classes and jars is if you'll provide us with the Context information that's being used to define your webapp to Tomcat.

The message about the APR native library is normal. Ignore it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic