I am simply trying to get the Spring 3.0 sample App "mvc-basic" to run in Tomcat from Eclipse with Maven2.
At boot time, I got HTTP 404 with ClassNotFoundException on org.springframework.web.filter.CharacterEncodingFilter and org.tuckey.web.filters.urlrewrite.UrlRewriteFilter. I have these 2 classes on my Build Path, in my App, in Tomcat and no where else. Their versions are the same.
Any suggestions will be greatly appreciated.
THANK YOU
THA
This message was edited 1 time. Last update was at by Bear Bibeault
Did you put the org.springframework.web-X.X.X.jar in the lib directory of your web application ? Please post the full path of where you put that jar file.
My org.springframework.web.3.0.0.RELEASE jar file is under my maven dependencies lib, in my Java Build Path for the project and in Apache Tomcat's lib.
Here's is a picture of my maven directory viewed in Eclipse:
Looking forward to knowing what I did wrong. THANK YOU!
You are making a web application, aren't you ? Where is the root of your web application ? You must have a directory (maybe somewhere under Tomcat's webapps directory ?) where your web application lives, with a WEB-INF directory in it.
Mimi Tam
Ranch Hand
Joined: Mar 05, 2010
Posts: 121
posted
0
Hi,
Yes, I am making a web application.
I am having terrible trouble locating files at runtime. Using Maven2 seemed to have made it worse (all due to my own wrong doing, or course....but only if I knew and how I wish to know what I'd done wrong.... ).
I am now facing this problem - applicationContext-dataSource.xml is not finding my jdbc.properties file.
This is the exception I am getting:
Here's my web.xml showing where my webAppRootKey is:
This is my applicationContext.dataSource.xml file where "${jdbc.driverClassName} is not found:
But my jdbc.properties file is in "<webAppRoot: petclinic>src/main/resources" as specified in the classpath and within the Eclipse project. Here is where my "jdbc.properties" file is - <webAppRoot>/src/main/resoureces (please see picture below).
I tried manipulating the classpath with absolute and relative paths but nothing worked. I am really at a loss ....
When you run a web application, the root of the application is not in the classpath. You can make a "classes" directory under WEB-INF, and put your properties file in there.
Mimi Tam
Ranch Hand
Joined: Mar 05, 2010
Posts: 121
posted
0
Hi Christophe,e.
Thank you so much for the advice! My "jdbc.properties" error went away and I got another error. I searched for info and solution for it but so far came up with nothing. I don't mean to post every problem that I encountered on this forum but only the ones that I really could not find a clue. I think I need help on this one as well...
"...
Mar 18, 2010 8:04:30 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/48 config=null
Mar 18, 2010 8:04:30 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 5004 ms
Mar 18, 2010 8:06:24 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet default threw exception
java.lang.IndexOutOfBoundsException: No group 1 at java.util.regex.Matcher.group(Unknown Source)
at java.util.regex.Matcher.appendReplacement(Unknown Source)
at java.util.regex.Matcher.replaceAll(Unknown Source)
at org.tuckey.web.filters.urlrewrite.RuleBase.executeBase(RuleBase.java:191)
at org.tuckey.web.filters.urlrewrite.Rule.execute(Rule.java:85)
at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:144)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:338)
...
Here's my welcome.jsp
My include.jsp:
My header.jsp:
I am really hoping to get this petclinic sample running and not to sit on it for days....after all it is a sample program that I am using for my learning curve...
Your help is greatly appreciated.
Many Sincere Thanks...
This message was edited 1 time. Last update was at by Mimi Tam
Are you following a tutorial ? I may not be able to help on that one. It looks like there might be problem with tuckey's urlrewriting configuration. Do you have a urlrewrite.xml file somewhere ? If so, what does it look like ?
And, tried placing my jdbc.properties file under either WEB-INF or WEB-INF/classes, etc. Nothing worked. I got "file does not exist" everytime and in both sample projects.
Am I doing something atrociously wrong somewhere? How should my "classpath=" look like in the applicationContext.dataSource.xml file and where exactly should I put the properties file to have them found?
Many Thanks...
This message was edited 1 time. Last update was at by Mimi Tam
Mimi Tam
Ranch Hand
Joined: Mar 05, 2010
Posts: 121
posted
0
I do have urlrewrite.xml:
This gave me the error in the mvc-basic sample project:
SEVERE: Servlet.service() for servlet default threw exception
java.lang.IndexOutOfBoundsException: No group 1
Could it be somehow complaining about the "$" sign? If so, how shall I fix it?
For the "file does not exist" problem, it happened in the petclinic project.