Results 1 to 1 of 1
  1. #1
    vitalstrike82 is offline Member
    Join Date
    May 2008
    Posts
    2
    Rep Power
    0

    Default 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
    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>
    I have state in the servlet class tag: com.velocity.velocityObj.velocityTest.

    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:
    Java 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)
    Thanks i n advance
    Last edited by vitalstrike82; 05-13-2008 at 11:22 AM.

Similar Threads

  1. Could not find the main class, program will exit.
    By aryubi in forum New To Java
    Replies: 39
    Last Post: 02-19-2010, 11:02 AM
  2. Replies: 2
    Last Post: 05-05-2008, 11:55 AM
  3. How to Merge all classes into One class
    By jazz2k8 in forum New To Java
    Replies: 12
    Last Post: 04-23-2008, 04:40 AM
  4. Replies: 3
    Last Post: 04-08-2008, 08:12 AM
  5. cannot find symbol class error
    By po0oker in forum New To Java
    Replies: 5
    Last Post: 10-31-2007, 03:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •