Hi,
My web application works great without any errors. However, when i am trying to do same stuff using standalone application, i am getting hit with strange errors.
Code file:
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlAp plicationContext;
public class pure
{
public static void main(String[] args)
{
ApplicationContext context = new
ClassPathXmlApplicationContext("*.xml");
}
}
All my xml files are stored in the same directory as the above java file.
My CLASSPATH points to all relevant spring jar files and java 1.6.X jdk jars
Trial 1: When i try to compile the java program, i get error
package org.springframework.context does not exist and similar errors on other packages and symbol not found errors etc
Trial 2: I manually copied all jars to the same directory location where my java programme resides. I still get the same error
Trial 3: But the errors seem to go away one by one when i incrementally start un jarring each of the spring jar files and all other dependent jar files.
jar -xvf spring-beans-2.5.5.jar
jar -xvf commons-logging-1.1.1.jar
etc
Note:One thing i noticed was the Manifest files donot have Main-Class attribute in all the jar files. So i am also not able to run the following command
Java -jar spring-beans-2.5.5.jar
How can i overcome these errors?
I don't want to copy all the jars locally to my programme and i certainly don't want to un jar the dependent jar files.
Whats my solution. I am new to Spring and also to Java.
Thanks
Sri


Reply With Quote
