  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Struts - A MVC web framework | | Tomcat - JSP/Servlet container | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | | JSP - A mailing list about Java Server Pages specification and reference | |
Struts & Hibernate
|
|
|
  | | | java.io.FileNotFoundException: mapping.xml (The system cannot find the path | java.io.FileNotFoundException: mapping.xml (The system cannot find the path 2004-08-17 - By Guy Katz
Back your manifest definition looks fine. if you did the manifest by hand and not with a tool than this could be a problem. how did you write the manifest. in general, i would not put an XML parser with the application. your app server already has an XML parser and this can cause problems. this goes for logging also. pther that this it looks fine to me.
-- --Original Message-- -- From: A mailing list for Java(tm) 2 Platform, Enterprise Edition [mailto:J2EE-INTEREST@(protected)]On Behalf Of Govind Kotwani Sent: Tuesday, August 17, 2004 4:35 PM To: J2EE-INTEREST@(protected) Subject: Re: java.io.FileNotFoundException : mapping.xml (The system cannot find the path specified)
Somehow whatever jar we use there is an issue in loading the classes..like now I used log4j jar, I placed it in ear but my application classes are not able to find it.
Below are my manifest entreis..
Class-Path: common.jar BusinessInvokerEJB.jar DataAccessEJB.jar EquipmentMgmtEJB castor-0 (See http://tor-0.ora-code.com).9.5.3-xml.jar xercesImpl.jar xmlParserAPIs.jar log4j-1.2.8.jar
What is the correct way of packaging the ear.
Govind
Guy Katz <gkatz@(protected)> Sent by: "A mailing list for Java(tm) 2 Platform, Enterprise Edition" <J2EE-INTEREST@(protected)>
08/17/2004 08:00 PM
Please respond to "A mailing list for Java(tm) 2 Platform, Enterprise Edition" <J2EE-INTEREST@(protected)>
To J2EE-INTEREST@(protected)
cc
Subject Re: java.io.FileNotFoundException : mapping.xml (The system cannot find the path specified)
looks like a classloading issue. try Thread.currentThread().getContextClassLoader().getResource/AsStream("mapping .xml") in order to load the file.
also, did you put correct manifest entries? -- --Original Message-- -- From: A mailing list for Java(tm) 2 Platform, Enterprise Edition [mailto:J2EE-INTEREST@(protected)]On Behalf Of Govind Kotwani Sent: Tuesday, August 17, 2004 3:22 PM To: J2EE-INTEREST@(protected) Subject: java.io.FileNotFoundException : mapping.xml (The system cannot find the path specified)
Hi,
This problem is more related to ear/packaging structure of files,still if someone has a solution.
I have an ear say "test.ear" which contain following jars and wars
a.jar-EJB b.jar-EJB c.jar-Not an EJB just some class files packaged in a jar d.war castor.jar xercesImpl.jar xmlParserAPIs.jar
In c.jar package strucure is like mapping.xml SomeClass.class in the package com.tcs.abc.xyz
This mapping. xml I am using with castor..to load mappings between business objects and xml .currently as described earlier this xml is lying at the root of c.jar.
In SomeClass.class I am trying to load this mapping.xml file by calling a castor API, code is as below
Mapping map = new Mapping(getClass().getClassLoader());
map.loadMapping("mapping.xml"); marshaller.setMapping(map);
When I try to run this it says xml file is not found and following exception is appearing
"java.io.FileNotFoundException : mapping.xml (The system cannot find the path specified)"
Does somebody know the solution.
Thanks and Regards, Govind =========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help". ForwardSourceID:NT0000782E
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD> <BODY> <DIV><SPAN class=819295915-17082004><FONT face=Arial color=#0000ff size=2>your manifest definition looks fine.</FONT></SPAN></DIV> <DIV><SPAN class=819295915-17082004><FONT face=Arial color=#0000ff size=2>if you did the manifest by hand and not with a tool than this could be a problem. how did you write the manifest.</FONT></SPAN></DIV> <DIV><SPAN class=819295915-17082004><FONT face=Arial color=#0000ff size=2>in general, i would not put an XML parser with the application. your app server already has an XML parser and this can cause problems. this goes for logging also.</FONT></SPAN></DIV> <DIV><SPAN class=819295915-17082004><FONT face=Arial color=#0000ff size=2>pther that this it looks fine to me.</FONT></SPAN></DIV> <BLOCKQUOTE> <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma size=2>-- --Original Message-- --<BR><B>From:</B> A mailing list for Java(tm) 2 Platform, Enterprise Edition [mailto:J2EE-INTEREST@(protected)]<B>On Behalf Of </B>Govind Kotwani<BR><B>Sent:</B> Tuesday, August 17, 2004 4:35 PM<BR><B>To:</B> J2EE-INTEREST@(protected)<BR><B>Subject:</B> Re: java.io.FileNotFoundException : mapping.xml (The system cannot find the path specified)<BR><BR></FONT></DIV><BR><FONT face=sans-serif size=2>Somehow whatever jar we use there is an issue in loading the classes..like now I used log4j jar, I placed it in ear but my application classes are not able to find it.</FONT> <BR><BR><FONT face=sans-serif size=2>Below are my manifest entreis..</FONT> <BR><BR><FONT face=sans-serif size=2>Class-Path: common.jar BusinessInvokerEJB.jar DataAccessEJB.jar</FONT> <BR><FONT face=sans-serif size=2> EquipmentMgmtEJB castor-0 (See http://tor-0.ora-code.com).9.5.3-xml.jar xercesImpl.jar</FONT> <BR><FONT face=sans-serif size=2> xmlParserAPIs.jar log4j-1.2.8.jar</FONT> <BR><BR><FONT face=sans-serif size=2>What is the correct way of packaging the ear.</FONT> <BR><BR><FONT face=sans-serif size=2>Govind</FONT> <BR><FONT face=sans-serif size=2><BR></FONT><BR><BR><BR> <TABLE width="100%"> <TBODY> <TR vAlign=top> <TD width="40%"><FONT face=sans-serif size=1><B>Guy Katz <gkatz@(protected)></B> </FONT><BR><FONT face=sans-serif size=1>Sent by: "A mailing list for Java(tm) 2 Platform, Enterprise Edition" <J2EE-INTEREST@(protected)></FONT> <P><FONT face=sans-serif size=1>08/17/2004 08:00 PM</FONT> <BR> <TABLE border=1> <TBODY> <TR vAlign=top> <TD bgColor=white> <DIV align=center><FONT face=sans-serif size=1>Please respond to<BR>"A mailing list for Java(tm) 2 Platform, Enterprise Edition" <J2EE-INTEREST@(protected)></FONT></DIV></TR></TBODY>< /TABLE><BR></P> <TD width="59%"> <TABLE width="100%"> <TBODY> <TR> <TD> <DIV align=right><FONT face=sans-serif size=1>To</FONT></DIV> <TD vAlign=top><FONT face=sans-serif size=1>J2EE-INTEREST@(protected)</FONT> <TR> <TD> <DIV align=right><FONT face=sans-serif size=1>cc</FONT></DIV> <TD vAlign=top> <TR> <TD> <DIV align=right><FONT face=sans-serif size=1>Subject</FONT></DIV> <TD vAlign=top><FONT face=sans-serif size=1>Re: java.io.FileNotFoundException : mapping.xml (The system cannot find the path specified)</FONT></TR></TBODY></TABLE><BR> <TABLE> <TBODY> <TR vAlign=top> <TD> <TD></TR></TBODY></TABLE><BR></TR></TBODY></TABLE><BR><BR><BR><FONT face=Arial color=blue size=2>looks like a classloading issue.</FONT> <BR><FONT face=Arial color=blue size=2>try Thread.currentThread().getContextClassLoader().getResource/AsStream("mapping .xml") in order to load the file.</FONT> <BR><FONT size=3> </FONT> <BR><FONT face=Arial color=blue size=2>also, did you put correct manifest entries?</FONT> <BR><FONT face=Tahoma size=2>-- --Original Message-- --<B><BR>From:</B> A mailing list for Java(tm) 2 Platform, Enterprise Edition [mailto:J2EE-INTEREST@(protected)]<B>On Behalf Of </B>Govind Kotwani<B><BR>Sent:</B> Tuesday, August 17, 2004 3:22 PM<B><BR>To:</B> J2EE-INTEREST@(protected)<B><BR>Subject:</B> java.io.FileNotFoundException : mapping.xml (The system cannot find the path specified)<BR></FONT><BR><FONT face=sans-serif size=2><BR><BR>Hi,</FONT><FONT size=3> <BR></FONT><FONT face=sans-serif size=2><BR>This problem is more related to ear/packaging structure of files,still if someone has a solution.</FONT><FONT size=3><BR></FONT><FONT face=sans-serif size=2><BR>I have an ear say "test.ear" which contain following jars and wars</FONT><FONT size=3> <BR></FONT><FONT face=sans-serif size=2><I><BR>a.jar-EJB</I></FONT><FONT size=3><I> </I></FONT><FONT face=sans-serif size=2><I><BR>b.jar-EJB</I></FONT><FONT size=3><I> </I></FONT><FONT face=sans-serif size=2><I><BR>c.jar-Not an EJB just some class files packaged in a jar</I></FONT><FONT size=3><I> </I></FONT><FONT face=sans-serif size=2><I><BR>d.war</I></FONT><FONT size=3><I> </I></FONT><FONT face=sans-serif size=2><I><BR>castor.jar</I></FONT><FONT size=3><I> <BR>xercesImpl.jar</I> <I><BR>xmlParserAPIs.jar</I></FONT><FONT face=sans-serif size=2><BR><BR>In c.jar package strucure is like <BR>mapping.xml</FONT><FONT size=3> </FONT><FONT face=sans-serif size=2><BR>SomeClass.class in the package com.tcs.abc.xyz</FONT><FONT size=3><BR><BR></FONT><FONT face=sans-serif size=2><BR>This mapping. xml I am using with castor..to load mappings between business objects and xml .currently as described earlier this xml is lying at the root of c.jar.<BR> <BR>In SomeClass.class I am trying to load this mapping.xml file by calling a castor API, code is as below</FONT><FONT size=3> </FONT><FONT face="Courier New" size=2><BR><BR>Mapping map = </FONT><FONT face="Courier New" color=#820040 size=2><B>new</B></FONT><FONT face="Courier New" size=2> Mapping(getClass().getClassLoader()); </FONT><FONT size=3> </FONT><FONT face="Courier New" size=2><BR>map.loadMapping(</FONT><FONT face="Courier New" color=#4200ff size=2>"mapping.xml"</FONT><FONT face="Courier New" size=2>);</FONT><FONT size=3> </FONT><FONT face="Courier New" size=2><BR>marshaller.setMapping(map);<BR><BR>When I try to run this it says xml file is not found and following exception is appearing</FONT><FONT size=3> <BR></FONT><FONT face="Courier New" size=2><BR>"java.io.FileNotFoundException : mapping.xml (The system cannot find the path specified)"</FONT><FONT size=3> <BR><BR></FONT><FONT face="Courier New" size=2><BR>Does somebody know the solution.</FONT><FONT size=3> <BR></FONT><FONT face="Courier New" size=2><BR>Thanks and Regards,</FONT><FONT size=3> </FONT><FONT face="Courier New" size=2><BR>Govind</FONT> <BR><FONT size=3>====================================================================== ===== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help". </FONT><BR><FONT face=sans-serif color=white size=2>ForwardSourceID:NT0000782E </FONT> <BR></BLOCKQUOTE></BODY></HTML> =========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help". <p>
|
|
 |