Results 1 to 1 of 1
- 05-13-2008, 06:16 AM #1
Member
- Join Date
- May 2008
- Posts
- 2
- Rep Power
- 0
Able to find class file in WEB-INF/classes but not after add sub folders in class dir
Greetings,
i'm now struggling with velocity for a day now. Currently i am able to run velocity when the class file is in WEB-INF/classes directory.
However, my project need to add in sub directories in the classes folder for easier management.
eg: WEB-INF/classes/com/velocity/velocityObj/<the class file in here>
This is my web xml
I have state in the servlet class tag: com.velocity.velocityObj.velocityTest.Java Code:<?xml version = '1.0' encoding = 'windows-1252'?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"> <description>Empty web.xml file for Web Application</description> <welcome-file-list> <welcome-file> index.jsp </welcome-file> </welcome-file-list> <session-config> <session-timeout>35</session-timeout> </session-config> <mime-mapping> <extension>html</extension> <mime-type>text/html</mime-type> </mime-mapping> <mime-mapping> <extension>txt</extension> <mime-type>text/plain</mime-type> </mime-mapping> <servlet> <servlet-name>VelocityTest</servlet-name> <servlet-class>com.velocity.velocityObj.velocityTest</servlet-class> </servlet> <servlet-mapping> <servlet-name>VelocityTest</servlet-name> <url-pattern>/VelocityTest</url-pattern> </servlet-mapping> </web-app>
Previously when the class file is in the WEB-INF/classes directory, my servlet tag is this: <servlet-class>velocityTest</servlet-class>
What can i edit to the tag to read the class file:?
This is my error:
Thanks i n advanceJava Code:11:37:28,753 ERROR [MainDeployer] Could not create deployment: file:/C:/jboss-4.2.2.GA/server/default/deploy/velocity.war/ java.lang.NoClassDefFoundError: com/velocity/velocityObj/velocityTest (wrong name: velocityTest) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)Last edited by vitalstrike82; 05-13-2008 at 10:22 AM.
Similar Threads
-
Could not find the main class, program will exit.
By aryubi in forum New To JavaReplies: 39Last Post: 02-19-2010, 10:02 AM -
[SOLVED] instantiating a class from other classes of different types...
By olbion in forum New To JavaReplies: 2Last Post: 05-05-2008, 10:55 AM -
How to Merge all classes into One class
By jazz2k8 in forum New To JavaReplies: 12Last Post: 04-23-2008, 03:40 AM -
[SOLVED] Using classes and overriding one class for another
By StealthRT in forum New To JavaReplies: 3Last Post: 04-08-2008, 07:12 AM -
cannot find symbol class error
By po0oker in forum New To JavaReplies: 5Last Post: 10-31-2007, 02:52 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks