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

 
 


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)      7 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

View Answers









Related Pages:
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
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
THROWS
THROWS   how can we throw unkown exception using throws clause...?   To throw an exception using throws clause, we have defined a file... { public static void main(String[] args) throws Exception
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
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
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
Fat Jar Eclipse Plug-In
referenced classes and jars are included to the "Fat-Jar", so the resulting jar contains all needed classes and can be executed directly with "java -jar", no classpath has to be set, no additional jars have to be deployed. Jars, External
Java Glossary : ANT
provides easier processing of reading an XML file than MAKEFILE User does... support for XML namespaces having new concept of Ant libraries that allows... such as javac, javadoc, etc. Ant simplifies the process of building, read an XML
How to create a jar file with database connection
access & i want to create a jar file of it... I have tried with manifest file but its not working pls help me.....   The given code creates a jar...How to create a jar file with database connection  Hello Everyone
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 compilation error - Ant
using ant its main program is not running as it is unable to detect the jar file... exception, so do i have to make any changes in build.xml regarding external jar files...java compilation error  hi, i have a application in which i m reading
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
Creating JAR File - Java Beginners
me, in letting me know, as to how to create JAR file from my JAVA source...(); } out.close(); fout.close(); System.out.println("Jar File... main(String[]args){ CreateJar jar=new CreateJar(); File folder = new File
Runnable JAR
Runnable JAR  How to create runnable JAR file in eclipse ? Please provide me step by step demo... I am windows 7 user. I have made one jar file but when I double click it,it doesn't run. Why so
Runnable JAR
Runnable JAR  How to create runnable JAR file in eclipse ? Please provide me step by step demo... I am windows 7 user. I have made one jar file but when I double click it,it doesn't run. Why so
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
Ant Script Problem - Ant
Ant Script Problem  I refer roseindia's(www.roseindia.net) Ant tutorial. According to that I tried to create tables using Ant script, but it throws following exception. C:\ksenthuran\workspace\AntDemo2\build.xml:10: Class
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 - 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
Dependant & dynamic drop down list
(Exception e){ System.out.println(e); } %> For the above code, we have...Dependant & dynamic drop down list  I don't know this should be in this or AJAX forum. I have one dynamic drop down list from data base (working
jar file
jar file  steps to create jar file with example
jar file
jar file  jar file where it s used
jar file
jar file  how to create a jar file in java
throws Java Keyword
to indicate that the method raises particular type of exception while being... java.io.IOException; public class Class1{ public method readingFile(String file) throws... throws Java Keyword      
JAR Generation
JAR Generation  Hi, I have done this code. Can u pls tell me how to create a jar for this in eclipse, this is only a single java file? package... public boolean accept(File arg0
JAR Generation
JAR Generation  Hi, I have done this code. Can u pls tell me how to create a jar for this in eclipse, this is only a single java file? package... public boolean accept(File arg0
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
Could not able to load jar file - WebSevices
Could not able to load jar file  Hi, I tried to parse the xml file to a java object. I followed the procedure that you have mentioned in the website. I created one batch file that consists of all
Error 500-Server are not find the jar file in the program of upload the file - JSP-Servlet
Error 500-Server are not find the jar file in the program of upload... may end up creating multiple orders - and multiple charges! Most merchants have... a program to upload a file.I include the commons-fileupload-1.2.1.jar file in lib
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
ANT Tutorials
with the jar file.     Ant Customer Properties... the build.xml file. You may say that build.xml file is the backbone of ANT (Another Neat... and at least one target.   Ant built-in properties
Issue when deploying mdb jar in weblogic
Issue when deploying mdb jar in weblogic  Hi, I have written... creating a jar file it is showing unmarshaller failed Below is the code MyMdb.java...(); } } public void ejbRemove() throws EJBException { // TODO Auto-generated
jar file
jar file  how to run a java file by making it a desktop icon i need complete procedur ..through cmd
struts jar file problem
struts jar file problem  hi.. I'm using struts-core-1.3.9.jar. it works well if am using ma application with internet but it shows me an error while initializing ActionServlet when i disconnected to Internet The error stack trace
Ant
the .class date is older than the corresponding .java file. Ant also supports..., running tests, building jar files, ... The action of ant is determined by a build.xml... build.xml file can be used. This works correctly if all top-level classes
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
Listing the Main Attributes in a JAR File Manifest
Listing the Main Attributes in a JAR File Manifest       Jar Manifest: Jar Manifest file is the main section of a jar file. This file contains the detailed information about
jsf jars - Java Server Faces Questions
.   Hi friend, Jar file to run The Jsf Applications jsf...jsf jars  Hi frnds, i done jsf simple pages those are working fine but byusing tag iam getting this exception: org.apache.jasper.JasperException
pom.xml local jar
pom.xml local jar  Hi, I have placed one jar file in the WEB-INF/lib folder now I wan't to use this jar in the maven build and test phases. How to use this jar file? Thanks
Changing Executable Jar File Icon
Changing Executable Jar File Icon  I have created an executable jar file for my java program and the icon that appears is the java icon. I will like...;Hi, You may use JSmooth to create executable java file and also associate icon
Dependant & dynamic drop down list - Follow up
Dependant & dynamic drop down list - Follow up  Thanks for your..."); } if (xmlHttp==null){ alert("Browser does not support XMLHTTP Request...(); ResultSet rs = stmt.executeQuery("Select * from country"); while(rs.next
task
task  sir i have created a table with two rows n two column with smillar name in each cell without any primary key , how can i change the first row... changing the name all name are changing coz all name are same... i hav to change
Introduction to ANT
the development concepts that the software developers have to keep in regard while... sure you have JDK1.3 or above installed on your machine. Download ant from http://jakarta.apache.org/ant/ and unzip the file into your favorite directory
exception in thread main while running servlet
exception in thread main while running servlet  I got exception in thread main no such method error while running servlet. I have added servlet.api.jar file in classpath.my classpath is C:\Program Files\Apache Software Foundation
problem while reading .csv file
problem while reading .csv file  I have a problem here..... i am reading a .csv extention file which has some value....but the problem is der is an amount column which contains , in between (eg) 3,899.00 which inturns creates
pom.xml local jar
pom.xml local jar  Hi, I have placed one jar file in the WEB-INF/lib folder now I wan't to use this jar in the maven build and test phases. How to use this jar file? Thanks   HI, You can add following dependency