Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Ant jar file built by ant jar task does not have all the dependant jars and throws exception while reading the appplicationContext,xml
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


raga
jar file built by ant jar task does not have all the dependant jars and throws exception while reading the appplicationContext,xml
0 Answer(s)      2 years and 2 months ago
Posted in : Ant


I have a spring class with main method. Inside the class am trying to read the values applicationContext.xml . My intention is to jar this main class along with its dependant jars,property files and applicationContext.xml .Hence i have my target as below

 <target name="testing" depends="init">
<property name="mech.dir" value="${target.dir}/MECHNSM" />
<property name="mech.classes.dir" value="${mech.dir}/classes" />
<delete dir="${mech.dir}" />
<mkdir dir="${mech.dir}" />
<mkdir dir="${mech.classes.dir}" />
<copy file="${tests.dir}/Mechanism.properties"      todir="${mech.classes.dir}" overwrite="true" />
<copy file="${tests.dir}/applicationContext.xml" todir="${mech.classes.dir}" overwrite="true" />
<javac destdir="${mech.classes.dir}" debug="true" classpath="/jars/dependency_jars/spring-context-support-3.1.1.RELEASE.jar" classpathref="project.class.path">
    <src path="${tests.dir}"/>
    <include name="com/test/Sample.java" />
</javac>
<jar destfile="${retymech.dir}/retryOrderPerformPost.jar" basedir="${retymech.classes.dir}">
    <manifest>
        <attribute name="Main-Class" value="com.test.Sample"/>
    </manifest>
    <!--<zipgroupfileset dir="${lib.dir}" includes="**/*.jar" />-->
    <zipfileset src="${lib.dir}/spring-web-3.1.1.RELEASE.jar" includes="**/*.class" excludes="META-INF/**/*" />
    <zipfileset src="${lib.dir}/spring-core-3.1.1.RELEASE.jar" includes="**/*.class" excludes="META-INF/**/*" />
    <zipfileset src="${lib.dir}/log4j.jar" />
    <zipfileset src="${lib.dir}/commons-logging-1.1.1.jar" includes="**/*.class" excludes="META-INF/**/*" />
    <zipfileset src="${lib.dir}/spring-asm-3.1.1.RELEASE.jar" includes="**/*.class" excludes="META-INF/**/*" />
    <zipfileset src="${lib.dir}/spring-beans-3.1.1.RELEASE.jar" includes="**/*.class" excludes="META-INF/**/*" />
    <zipfileset src="${lib.dir}/spring-context-3.1.1.RELEASE.jar" includes="**/*.class" excludes="META-INF/**/*" />
    <zipfileset src="${lib.dir}/spring-core-3.1.1.RELEASE.jar" includes="**/*.class" excludes="META-INF/**/*" />
    <zipfileset src="${lib.dir}/spring-expression-3.1.1.RELEASE.jar" includes="**/*.class" excludes="META-INF/**/*" />
    <zipfileset src="${lib.dir}/spring-web-3.1.1.RELEASE.jar" includes="**/*.class" excludes="META-INF/**/*" />
    <zipfileset src="${lib.dir}/spring-oxm-3.1.1.RELEASE.jar" includes="**/*.class" excludes="META-INF/**/*" />
    <zipfileset src="${lib.dir}/spring-test-3.1.1.RELEASE.jar" includes="**/*.class" excludes="META-INF/**/*" />
    <zipfileset src="${lib.dir}/httpmime-4.1.3.jar" includes="**/*.class" excludes="META-INF/**/*" />
    <zipfileset src="${lib.dir}/httpclient-cache-4.1.3.jar" includes="**/*.class" excludes="META-INF/**/*" />
    <zipfileset src="${lib.dir}/httpcore-4.1.4.jar" includes="**/*.class" excludes="META-INF/**/*" />
    <zipfileset src="${lib.dir}/httpclient-4.1.3.jar" includes="**/*.class" excludes="META-INF/**/*" />

    <fileset dir="${tests.dir}" includes="applicationContext.xml" />
</jar>
</target>

While executing the jar file using java -jar command it is throwing me the below exception

Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinit ionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http.springframework.org/schema/context]

Could you help me to solve this issue


Advertisement
View Answers

Related Tutorials/Questions & Answers:
jar file built by ant jar task does not have all the dependant jars and throws exception while reading the appplicationContext,xml
jar file built by ant jar task does not have all the dependant jars and throws exception while reading the appplicationContext,xml  I have a spring...;/target> While executing the jar file using java -jar command it is throwing
Reading a file from Jar JAVA
Reading a file from Jar JAVA  I have added one excel sheet into a jar file. can anybody tell me how i can read that file. actually when i am running code from eclipse i able to read it but when i am adding that jar file
Advertisements
Reading a file from Jar JAVA
Reading a file from Jar JAVA  I have added one excel sheet into a jar file. can anybody tell me how i can read that file. actually when i am running code from eclipse i able to read it but when i am adding that jar file
jar file not reading input from serial port
jar file not reading input from serial port  i used a coding... when i execute thru jar file. but when i execute thru netbeans, data is received... = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements()) { portId
jar file not reading input from serial port
jar file not reading input from serial port  i used a coding... when i execute thru jar file. but when i execute thru netbeans, data is received... = CommPortIdentifier.getPortIdentifiers(); while (portList.hasMoreElements
Need to know struts1 all jar file names
Need to know struts1 all jar file names  Hi, My name is Neeraj, I want to know all the jar file names for struts1 and plz provide me the link to download these files. Thanks & Regards Neeraj
jar file
jar file  how to create a jar file in java
jar file
jar file  jar file where it s used
jar file
jar file  steps to create jar file with example
JAR FILE
JAR FILE  WHAT IS JAR FILE,EXPLAIN IN DETAIL?   A JAR file... and applications. The Java Archive (JAR) file format enables to bundle multiple... link: Jar File Explanation
jar file
jar file  how to run a java file by making it a desktop icon i need complete procedur ..through cmd
File path for jar file
File path for jar file  Hi Experts, I have created one eclipse project, its about Velocity Template. In that project I have given the hard-coded... jar file of that application, unfortunately it is giving the error that resource
Running Jar file in Windows
Running Jar file in Windows  Running Jar file in Windows
How to use JAR file in Java
do not use JAR file, then they will have to download every single file one... on any platform. All operating system support Java. JAR file works as normal Zip... to digitally sign the JAR file. Users who want to use the secured file can check
jar file with html
jar file with html  I have a jar file. On double click it shows an applet page. Please tell me how to connect that applet into html or jsp page
JAR File - Swing AWT
JAR File   Is there anybody to solve my problem of not executing the JAR file? I have asked the question previously but I haven't got any answer yet. Please help me
Extract Jar File
Extract Jar File  How to extract jar file?   Hi Please open the command Prompt and to the jar file and write the command jar -xvf JaraFileName.jar
How to create a jar file
(); System.out.println("Jar File is created successfully."); } catch (Exception ex...How to create a jar file  Hello!!!! I have a project which has...???   The given code creates a jar file using java. import java.io.*; import
jar file - Java Beginners
jar file  jar file When creating a jar file it requires a manifest... options in jar file. What is Jar File? JAR files are packaged in the zip format  What is Jar File?JAR files are packaged in the zip format making
Jar file - Java Beginners
Jar file  Hello this is my second question and i hope atleast i will get answer i bulid a jar file of my project using netbeans but now problem is when i open that jar file in command prompt i got error exception in thread
org.apache.commons.collections15.Transformer jar file
org.apache.commons.collections15.Transformer jar file  Dear, Please can you provide me the link for the following jar file: import org.apache.commons.collections15.Transformer; tahnks too much
Creating an executable jar file
Creating an executable jar file  When I try to create jar.exe through CMD, the manifest file created doesn't contain Main-Class attribute, even though it is included in text file used during creation of jar file
Java Execute Jar file
are two different files. If a .jar file does not have an executable... operating system or platform. To execute a JAR file, one must have Java... step is to make the JAR file executable. All class files of the application
What is a JAR file in Java
with detail of a jar file extract all the files of a jar... What is a JAR file in Java       JAR file is the compressed file format. You can store many
How to Unjar a Jar file in Java
file and place all of them into the current folder. Points to remember while...A JAR file is a collection of Java class files that contains images, methods, texts, etc into one file. All these class files are compressed and archived
Jar file creation - Swing AWT
Jar file creation  i have developed a swing application using Net... comunication application... i have these doubts using IDE when i built the application i gets a JAR file a lib file is also created in dist folder
Executing JAR file - Swing AWT
Executing JAR file  Hello Friends! I have successfully created the JAR file of my project with the Manifest File including my Main... Manifest.txt secl/*.class and my jar file is created. But there is a problem, when
Java Jar File - Java Beginners
Java Jar File  What is a Java JAR file ..and how can i open a .jar file in Java?  Just create a Jar file and Double click on it, it will automatically runs main method in that Jar : to create Project as JAR
java jar file - Java Beginners
(); System.out.println("Jar File is created successfully."); } catch (Exception ex...java jar file  How to create jar Executable File.Give me simple steps to create jar files  Hi Friend, Try the following code: import
requesting for a jar file - Development process
requesting for a jar file  Sir Please send me a jar file of this sir , i need this package jar file org.apache.poi.hssf.usermodel for Excel reading... After extracting, put the following jar files in the lib folder of your apache
Apache HSSF Jar file location
Apache HSSF Jar file location  where can i get jar files for apache hssf
 

 

 

DMCA.com