On 10/27/05, Minh Tran-Le <[EMAIL PROTECTED]> wrote:
I got this error once when my input file is empty.
Just make sure that your code at:
if (url != null)
{mapping.loadMapping(URLDecoder.decode (url.getPath()));}
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Is really return a correct path.
Minh Tran-Le.
On 10/27/05, Adam Hiatt < [EMAIL PROTECTED]> wrote:
> //---------------------------------------------------------------------------------
> > > import java.io.ByteArrayInputStream;
> > > import java.io.FileReader ;
> > > import java.io.IOException;
> > > import java.io.InputStreamReader;
> > > import java.io.PrintWriter;
> > > import java.net.URL ;
> > > import java.net.URLDecoder ;
> > > import java.util.Date;
> > >
> > > import javax.servlet.ServletException;
> > > import javax.servlet.ServletInputStream;
> > > import javax.servlet.http.HttpServletRequest ;
> > > import javax.servlet.http.HttpServletResponse;
> > >
> > > import
> level3.applications.asrmgr.servlets.ASRResponseProcessor;
> > > import
> level3.enterprise.asrmgr.dataobjects.neustar.AsrRequest ;
> > >
> > > import org.exolab.castor.mapping.Mapping;
> > > import org.exolab.castor.mapping.MappingException;
> > > import org.exolab.castor.xml.Unmarshaller;
> > >
> > > /**
> > > * Class temp1
> > > */
> > > public class temp1
> > > {
> > >
> > > protected void doRequest(HttpServletRequest request,
> > > HttpServletResponse response)
> > > throws ServletException, IOException
> > > {
> > > ServletInputStream is = request.getInputStream ();
> > >
> > > Mapping mapping = new Mapping(
> > > Thread.currentThread().getContextClassLoader() );
> > >
> > > URL url ="">> > >
> getClass().getClassLoader().getResource(" bundleMapping.xml");
> > > String fileString = new String("");
> > > try
> > > {
> > > if (url != null)
> > > {mapping.loadMapping (URLDecoder.decode (url.getPath()));}
> > > }
> > > catch (Exception e1)
> > > {e1.printStackTrace();}
> > >
> > > try
> > > {
> > > Unmarshaller unmarshaller = new Unmarshaller(mapping);
> > > AsrRequest asrRequest =
> (AsrRequest)unmarshaller.unmarshal(new
> > > InputStreamReader(is));
> > > }
> > > catch (Exception e){
> > > e.printStackTrace ();
> > > }
> > > }
> > >
> > >
> > > ----------------------
> > > Adam Hiatt
> > > ----------------------
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------
--
----------------------
Adam Hiatt
----------------------

