Java Mailing List Archive

http://www.junlu.com/

Google
Google
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
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Oracle Connection Pooling in 3 2 2
Servlet : Session invalidate
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Tomcat and webapplication specific java library path
Running a Simple JMS Example
Mapping in workers2 properties
org apache jasper JasperException
Cannot find message resources under key org apache struts action
   MESSAGE
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
url string for connecting jboss to oracle
Value attribute of <html:checkbox
javax servlet ServletException: BeanUtils populate
HTTP Status 404 The requested resource is not available
5 0 18: Windows XP Pro vs Windows 2000
 
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
Reply:     1     2     3     4  

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 Source code of 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 Source code of 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".


<!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=991332614-17082004><FONT face=Arial color=#0000ff size=2>looks
like a classloading issue.</FONT></SPAN></DIV>
<DIV><SPAN class=991332614-17082004><FONT face=Arial color=#0000ff size=2>try
Thread.currentThread().getContextClassLoader().getResource/AsStream("mapping
.xml")
in order to load the file.</FONT></SPAN></DIV>
<DIV><SPAN class=991332614-17082004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=991332614-17082004><FONT face=Arial color=#0000ff size=2>also,
did you put correct manifest entries?</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 3:22
 PM<BR><B>To:</B> J2EE-INTEREST@(protected)<BR><B>Subject:</B>
 java.io.FileNotFoundException Source code of java.io.FileNotFoundException: mapping.xml (The system cannot find the path
 specified)<BR><BR></FONT></DIV><BR><FONT face=sans-serif size=2><BR>Hi,</FONT>
 <BR><BR><FONT face=sans-serif size=2>This problem is more related to
 ear/packaging structure of files,still if someone has a
 solution.<BR></FONT><BR><FONT face=sans-serif size=2>I have an ear say
 "test.ear" which contain following jars and wars</FONT><FONT size=3>
 </FONT><FONT face=sans-serif size=2><BR></FONT><BR><FONT face=sans-serif
 size=2><I>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> </I></FONT><BR><FONT size=3><I>xercesImpl.jar</I></FONT> <BR><FONT
 size=3><I>xmlParserAPIs.jar<BR></I></FONT><FONT face=sans-serif size=2><BR>In
 c.jar package strucure is like <BR>mapping.xml</FONT><FONT size=3>
 </FONT><BR><FONT face=sans-serif size=2>SomeClass.class in the package
 com.tcs.abc.xyz<BR></FONT><BR><BR><FONT face=sans-serif size=2>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>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<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> <BR></FONT><FONT face="Courier New"
 size=2><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()); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</FONT> <BR><FONT
 face="Courier New" size=2>map.loadMapping(</FONT><FONT face="Courier New"
 color=#4200ff size=2>"mapping.xml"</FONT><FONT face="Courier New"
 size=2>);</FONT> <BR><FONT face="Courier New"
 size=2>marshaller.setMapping(map);</FONT><FONT size=3><BR></FONT><FONT
 face="Courier New" size=2><BR>When I try to run this it says xml file is not
 found and following exception is appearing</FONT> <BR><BR><FONT
 face="Courier New" size=2>"java.io.FileNotFoundException Source code of java.io.FileNotFoundException: mapping.xml (The
 system cannot find the path specified)"</FONT> <BR><BR><BR><FONT
 face="Courier New" size=2>Does somebody know the solution.</FONT>
 <BR><BR><FONT face="Courier New" size=2>Thanks and Regards,</FONT> <BR><FONT
 face="Courier New" size=2>Govind</FONT></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>

©2008 junlu.com - Jax Systems, LLC, U.S.A.