HttpURLConnection throws a FileNotFound exception

Hi Everybody,
I want to post the data to a remote servlet using HttpURLConnection.
But it throws a FileNotFound exception. Pls send me the solution.
My code is
First Servlet:
==============
import java.io.*;
import java.net.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Test extends HttpServlet {
     public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
response.setContentType("text/html");
          URL url = new URL("http://node_18:8080/examples/servlet/HelloWorldExample1");
          HttpURLConnection conn = (HttpURLConnection) url.openConnection();
          conn.setRequestMethod("POST");
          //HttpURLConnection.setFollowRedirects(true);
          conn.setUseCaches(false);
          conn.setDoOutput(true);
          conn.setDoInput(true);
          String postData = "name=value&othername=value";
          String lengthString = String.valueOf(postData.length());
          conn.setRequestProperty("Content-Length", lengthString);
          conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
          Writer out = new OutputStreamWriter(conn.getOutputStream());
          out.write(postData);
          out.close();
          PrintWriter out1 = response.getWriter();
          BufferedReader in =
          new BufferedReader(new InputStreamReader(conn.getInputStream()));
          String line = null;
          while (null != (line = in.readLine()))
          out1.println(line);
          in.close();
          out1.close();
Second Servlet:
================
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloWorldExample1 extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String name = request.getParameter("name");
String othername = request.getParameter("othername");
System.out.println("name = "+name+" othername = "+othername);
out.println("<html>");
out.println("<head>");
     out.println("<title> Test </title>");
out.println("</head>");
out.println("<body bgcolor=\"white\">");
     out.println("Test");
out.println("</body>");
out.println("</html>");
public void destroy() {
     System.out.println("Servlet Destroyed");
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
     doPost(request,
response);
Error:
=======
java.io.FileNotFoundException: http://node_18:8080/examples/servlet/HelloWorldExample1
     at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:574)
     at Test.doGet(Test.java:37)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
     at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:471)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2396)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
     at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
     at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:405)
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:380)
     at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:623)
     at java.lang.Thread.run(Thread.java:484)

Hi p200002,
I call doPost method in doPost in the second servlet. It will be
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
     doGet(request,
response);
}

Similar Messages

  • Problem with reading from DAT file. FileNotFound exception

    Can't seem to find the issue here. Two files, one (listOfHockeyPlayers) reads from a DAT file a list of players. The other (HockeyPlayer) has just the constructor to make a new hockey player from the read data.
    import javax.swing.*;
    import javax.swing.event.*;
    import java.util.*;
    import java.awt.*;
    import java.io.*;
    public class ImportHockeyPlayers
    private ArrayList<HockeyPlayer> listOfHockeyPlayers = new ArrayList<HockeyPlayer>();
    public ImportHockeyPlayers(String fileName)
      throws FileNotFoundException
      try
       Scanner scan = new Scanner(new File(fileName));
       while (scan.hasNext())
        //Uses all the parameters from the HockeyPlayer constructor
        String firstName = scan.next();
        String lastName = scan.next();
        int num = scan.nextInt();
        String country = scan.next();
        int dob = scan.nextInt();
        String hand = scan.next();
        int playerGoals = scan.nextInt();
        int playerAssists = scan.nextInt();
        int playerPoints = playerGoals + playerAssists;
        //listOfHockeyPlayers.add(new HockeyPlayer(scan.next(),scan.next(),scan.nextInt(),scan.next(),scan.nextInt(),scan.next(),
         //scan.nextInt(),scan.nextInt(),scan.nextInt()));
      catch(FileNotFoundException e)
       throw new FileNotFoundException("File Not Found!");
    public String toString()
      String s = "";
      for(int i = 0; i < listOfHockeyPlayers.size(); i++)
       s += listOfHockeyPlayers.get(i);
      return s;
    public class HockeyPlayer
    private String playerFirstName;
    private String playerLastName;
    private int playerNum;
    private String playerCountry;
    private int playerDOB;
    private String playerHanded;
    private int playerGoals;
    private int playerAssists;
    private int playerPoints;
    public HockeyPlayer(String firstName, String lastName, int num, String country, int DOB,
      String hand, int goals, int assists, int points)
      this.playerFirstName = firstName;
      this.playerLastName = lastName;
      this.playerNum = num;
      this.playerCountry = country;
      this.playerDOB = DOB;
      this.playerHanded = hand;
      this.playerGoals = goals;
      this.playerAssists = assists;
      this.playerPoints = goals + assists;
    DAT File
    Wayne Gretzky 99 CAN 8/13/87 R 120 222
    Joe Sakic 19 CAN 9/30/77 L 123 210These are all in early development, we seem to have the idea down but keep getting the odd FileNotFound exception when making an object of the ImportHockeyPlayers class with the parameter of the DAT file.
    We might even be on the wrong track with an easier way to do this. To give you an idea of what we want to do...read from the file and be able to pretty much plug in al lthe players into a GUI with a list of the all the players.
    Thanks for your time.

    Thanks for the tip on the date format...good to
    know.
    public static void main(String[] args)
    GUI gui = new GUI();
    ImportHockeyPlayers ihp = new
    ImportHockeyPlayers("HockeyPlayers.dat");
    }It's just being called in the main.
    Throws this error:
    GUI.java:39: unreported exception
    java.io.FileNotFoundException; must be caught or
    declared to be thrown
    ImportHockeyPlayers ihp = new
    ImportHockeyPlayers("HockeyPlayers.dat");
    ^This error is simply telling you that an exception may occur so you must enclose it in a try catch block or change the main method to throw the exception as follows
    public static void main(String[] args) throws  
                          java.io.FileNotFoundException {
         GUI gui = new GUI();
         ImportHockeyPlayers ihp = new
         ImportHockeyPlayers("HockeyPlayers.dat");
    }or
    public static void main(String[] args) {
         GUI gui = new GUI();
         try {
              ImportHockeyPlayers ihp = new
              ImportHockeyPlayers("HockeyPlayers.dat");
         catch (FileNotFoundException e) {
              System.out.println("error, file not found");
    }I would reccomend the second approch, it will be more helpful in debugging, also make sure that the capitalization of "HockeyPlayers.dat" is correct
    hope that helps

  • WPUMFactory.getUserFactory() throws null pointer exception

    Hi,
    I am trying to use KM API's to read files from KM repository. I am using the below code as mentioned in the blog: How to download KM documents using Web Dynpro Java
    Below is my code:
    IWDClientUser wdClientUser = WDClientUser.getCurrentUser();
    com.sap.security.api.IUser sapUser = wdClientUser.getSAPUser();
    IUser epUser = WPUMFactory.getUserFactory().getEP5User(sapUser);
    However the line WPUMFactory.getUserFactory() throws null pointer exception. Can some one please help on why these happens as these seems to be the standard code to read a file from KM.
    Thanks.
    Regards,
    Ponraj M

    Hi Ponraj ,
    Instead of fetching the current logged on user , use the below line to set the resource context and see if it helps .
    com.sapportals.wcm.repository.IResourceContext resourceContext = ResourceFactory.getInstance().getServiceContext("cmadmin_service");
    cmadmin_service is a existing user that can be used to access KM resources .
    Regards
    Mayank

  • File LookUp in the MM : FileNotFound Exception

    Hello Friends,
    I am trying to fetch a file during the message mapping. The code I have written in the UDF is as follows :
    <u>
    String company = "";
    HashMap fileMap = new HashMap();
    BufferedReader reader = new BufferedReader(new FileReader("C:
    testfolder
    Mydata.txt"));
    String line = "";
    while((line = reader.readLine())!=null)
    String[] lineArray = line.split(",");
    fileMap.put(lineArray[1], lineArray[0]);
    company = (String) fileMap.get(a);
    return company; </u>
    <b>
    But I am getting the FileNotFound Exception when I tried to run the interface mapping.
    I have confirmed that file is there in the respective folder.
    1. Can we use the above code to fetch the file ?
    2. Do we need to put the file in the XI server ?
    </b>
    Thanks for your time.
    ~PRANAV

    and what exactly you are trying to do with this code ?
    to access files,you need to use Java io api's,and you can access file from any server,not just XI server
    but there are few drawbacks with this,first of all the file name and path will be hardcoded so u need to change it every time you move your file from Dev to QA to Prd.
    secondly this approach is good to read the file,but not a very good idea to write something in the file
    Thanx
    Aamir

  • IO or FileNotFound Exception catch does not work for getRequestDispatcher

    Hi,
    I am trying to catch IOException / FileNotFoundException in my servlet for the call to getRequestDispatcher().forward(request, response) and than throw user define exception from that catch. I am using JDeveloper 10.1.3. Some how the control is not going to catch block when the file does not exist to forward. But instead JDeveloper is throwing its own exception with error mesg
    NOTIFICATION J2EE JSP0008 Unable to dispatch JSP Page : java.io.FileNotFoundException:
    and browser shows standard 404 File Not Found error page. I would rather have want to display appropriate error page. Here is my code:
    try
    System.out.println("in try");
    context.getRequestDispatcher("/" + currentScreen).forward(request, response);
    System.out.println("after try");
    catch(java.io.IOException fileNotFoundEx)
    System.out.println("runtime exception");
    logger.error(CLASS_OBJECT, "f n f "+RootException.getStackTraceString(fileNotFoundEx));
    throw new RequestHandlerException("requestHandlerError", fileNotFoundEx);
    Here is the output on console:
    06/08/01 10:35:18 in try
    2006-08-01 10:35:18.921 NOTIFICATION J2EE JSP0008 Unable to dispatch JSP Page : java.io.FileNotFoundException: F:\JavaProjects\WorkspaceDev\CorAssessment\web\jsp\assessment_multi_view1.jsp (The system cannot find the file specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:106)
    at java.io.FileInputStream.<init>(FileInputStream.java:66)
    at oracle.jsp.provider.JspFilesystemResource.fromStream(JspFilesystemResource.java:150)
    at oracle.jsp.parse.XMLUtil.getFromStream(XMLUtil.java:228)
    at oracle.jsp.runtimev2.JspPageCompiler.compilePage(JspPageCompiler.java:341)
    at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:610)
    at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:634)
    at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:370)
    at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)
    at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
    at com.evermind.server.http.ServletRequestDispatcher.unprivileged_forward(ServletRequestDispatcher.java:270)
    at com.evermind.server.http.ServletRequestDispatcher.access$100(ServletRequestDispatcher.java:42)
    at com.evermind.server.http.ServletRequestDispatcher$2.oc4jRun(ServletRequestDispatcher.java:204)
    at oracle.oc4j.security.OC4JSecurity.doPrivileged(OC4JSecurity.java:283)
    at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:209)
    at com.nexcom.cor.manager.ViewManager.forwardToNextScreen(ViewManager.java:142)
    at com.nexcom.cor.controller.FrontController.doProcess(FrontController.java:85)
    at com.nexcom.cor.controller.FrontController.doGet(FrontController.java:59)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
    at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
    at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
    at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
    at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
    at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
    at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
    at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
    at java.lang.Thread.run(Thread.java:534)
    06/08/01 10:35:18 after try
    It does not goto catch block and not printing message from System.out.

    You can map error codes to a specific jsp in your web.xml file, and add a parameter to the jsp that will display the message you intend to display back to the user.
    Example:
    <error-page>
    <error-code>404</error-code>
    <location>/index.html</location>
    </error-page>
    You can also trap specific exceptions by doing the following:
    <error-page>
    <exception-type> java.lang.Exception </exception-type>
    <location>/ErrorPage.jsp</location>
    </error-page>

  • How to throw a permanent exception during mapping?

    I'm using the java coding: "throw new RuntimeException(message);" to trigger an error during mapping.
    This will set the message status to: "System error, manual restart possible".
    How can I throw a permanent exception during mapping? So that the message is set to error but will NOT be restartable.

    Hi,
    Any error in  asynchronous mode in XI will be in a Restart Mode.  I dont think this can be done.
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    /people/sap.user72/blog/2005/11/29/xi-how-to-re-process-failed-xi-messages-automatically
    Regards,
    Bhavesh

  • Vector.clear() throws null pointer exception

    is there anything wrong in my code. when i try to clear the vector irrespective of whether i add elements to it or not, if there are no elements added to the vector v1.clear() it throws null pointer exception
    Vector v1 = new Vector(1,1);
    v1.clear()

    And the guessing game continues... anyone for a shortctu to duplicate this problem?
    public class NullVectorCreator
        private Vector v1;//just love the name, so clear and unambiguous... :)
        public NullVectorCreator
             Vector v1 = new Vector();//well done - a local variable masquerading as
                                                          // a class member
        public Vector getVector()
             return v1;
        public static void main(String[] args)
               NullVectorCreator nvc = new NullVectorCreator();
                nvc.getVector().clear();//Why does this throw an NPE? why? java is bugged!
    }

  • ValuePattern.SetValue Throws ElementNotAvailableException (Inner Exception of InvalidOperationException)

    I have a Wpf FrameworkElement derived control that offers a custom AutomationPeer:
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Windows;
    using System.Windows.Automation.Peers;
    using System.Windows.Automation.Provider;
    namespace TSystem.Content
    internal class MarkTopicElementAutomationPeer : FrameworkElementAutomationPeer, IValueProvider
    private static readonly Dictionary<string, TcsMarkStates> StringToStateMap = new Dictionary
    <string, TcsMarkStates>
    {"Positive", TcsMarkStates.Positive},
    {"Negative", TcsMarkStates.Negative},
    {"Neutral", TcsMarkStates.Neutral}
    #region Constructors
    public MarkTopicElementAutomationPeer(FrameworkElement owner) : base(owner)
    if (!(owner is MarkTopicElement))
    throw new ArgumentException("Owner must derive from MarkTopicElement");
    #endregion
    #region Automation Peer Overrides
    protected override string GetNameCore()
    StringBuilder name = new StringBuilder();
    name.AppendFormat("MarkTopicElement:{0}:{1}", OwnerAsElement.Caption, OwnerAsElement.ElementID);
    Topic parentTopic = OwnerAsElement.FindLogicalAncestorByType<Topic>();
    if (null != parentTopic)
    name.AppendFormat(":ParentTopic:{0}:{1}", parentTopic.GetType(), parentTopic.Instance);
    return name.ToString();
    public override object GetPattern(PatternInterface patternInterface)
    return patternInterface == PatternInterface.Value ? this : base.GetPattern(patternInterface);
    protected override AutomationControlType GetAutomationControlTypeCore()
    return AutomationControlType.ComboBox;
    protected override bool IsContentElementCore()
    return true;
    protected override bool IsControlElementCore()
    return true;
    #endregion
    #region IValueProvider Implementation
    public bool IsReadOnly
    get { return OwnerAsElement.ReadOnly; }
    public void SetValue(string value)
    OwnerAsElement.ChangeMarkState(StateFromString(value));
    public string Value
    get { return OwnerAsElement.MarkState.ToString(); }
    #endregion
    #region Helper methods
    private MarkTopicElement OwnerAsElement
    get { return (MarkTopicElement) Owner; }
    private static TcsMarkStates StateFromString(string value)
    TcsMarkStates state;
    return (StringToStateMap.TryGetValue(value, out state) ? state : TcsMarkStates.Neutral);
    #endregion
    However, when I try to access its implementation the ValuePattern:
    WpfComboBox mark = HistoryPage.UIEVSite234Window.UIHostedPageWindow.UIItemCustom.UIItemCustom11.StartedTopic.StartedJustPTA;
    var markElement = (AutomationElement) mark.NativeElement;
    ValuePattern pattern = (ValuePattern) markElement.GetCurrentPattern(ValuePattern.Pattern);
    pattern.SetValue("Positive");
    It throws this exception:
    Result Message: 
    Test method EVTCSTest.HistoryStartedTest.SetStartedToPositive threw exception:
    System.Windows.Automation.ElementNotAvailableException: Element not available ---> System.InvalidOperationException: Operation is not valid due to the current state of the object.
    Result StackTrace: 
    at UIAutomationClient.IUIAutomationValuePattern.SetValue(String val)
       at System.Windows.Automation.ValuePattern.SetValue(String value)
     --- End of inner exception stack trace ---
        at System.Windows.Automation.ValuePattern.SetValue(String value)
       at EVTCSTest.HistoryStartedTest.SetStartedToPositive() in c:\Development\zTest\EVTCSTest\EVTCSTest\HistoryStartedTest.cs:line 46
    Any ideas why this may be?  I know that the element is enabled and is not read only.
    One final update...I have confirmed that it is getting to my implementation of the read-only Value property of my automation peer.  However it doesn't seem to even be reaching my implementation of SetValue.
    Thanks,
    Kelly Hilliard

    Hi,
    Based on your description, I don’t think that the issue is really related to Coded UI test itself. Your issue is mainly on setting a value using ValuePattern.SetValue. I think it is more related to accessibility and automation. I noticed that you post a
    new thread on Windows Desktop Development for Accessibility and automation forum:
    http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/8c8f4566-22df-4944-ba57-13898dcec6be/valuepatternsetvalue-throws-elementnotavailableexception-inner-exception-of?forum=windowsaccessibilityandautomation#8c8f4566-22df-4944-ba57-13898dcec6be
    I am not an expert on accessibility and automation, I am sorry for that I can’t provide you something useful about ValuePattern.SetValue method’s usage. I think that community members on Windows Desktop Development for Accessibility and Automation forum
    will help you resolve this issue better.
    Thank you for your understanding and support.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • FileNotFound Exception

    Hello I am trying to parse an xml file chosen by the user. The file chosen is under:
    wkdis3/home/bwe but everytime i got this exception:
    ption caught: class java.io.FileNotFoundException
    Datei AABC.XML ist nicht g�ltig.java.io.FileNotFoundException: \home\bwe\AABC.XML (Das System kann den angegebenen Pfad nicht finden)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(FileInputStream.java:78)
         at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:99)
         at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:164)
         at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
         at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
         at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
         at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
         at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
         at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
         at ParseTest.<init>(ParseTest.java:51)
         at ParseTest.main(ParseTest.java:105)
    has anyone any idea baout that? and the main metode is so:
    public static void main(String[] args) {
    //     Work with /Dir/File.txt on the system wkdis3.
         AS400 system = new AS400("wkdis3");
         IFSJavaFile dir = new IFSJavaFile(system, "/home/bwe");
         JFileChooser chooser = new JFileChooser(dir, new IFSFileSystemView(system));
         Frame parent = new Frame();
         int returnVal = chooser.showOpenDialog(parent);
              if (returnVal == JFileChooser.APPROVE_OPTION) {
              IFSJavaFile chosenFile = (IFSJavaFile)(chooser.getSelectedFile());
              System.out.println("You selected the file named " +
                                       chosenFile.getName());
                   String filename = chosenFile.getName()
                   try{
              File file= chosenFile;
         ParseTest xIncludeTest = new ParseTest(file);
         }catch(Exception e) {
         // System.out.println("Exception"+e+ "ist gefunden. /n ");
         System.out.println("Exception caught: "+e.getClass());
         System.out.println("Datei "+filename+" ist nicht g�ltig.");
         e.printStackTrace();
         }//ende catch
         }//Ende if
    } //ende main()
    }/

    Thanks alot Mike ..The tips you gave were very helpful..I could solution using the Object IFSJavaFile, cause when i make :
    IFSJavaFile chosenFile = (IFSJavaFile)(chooser.getSelectedFile());
    II was getting only the path but not the system and when the systems are different(you were right XMl files were on OS400) then i got the FileNotFound Exception always.Down is the corrected main methode:
    public static void main(String[] args) {
         try{
    //          Work with /Dir/File.txt on the system wkdis3.
         AS400 system = new AS400("wkdis3");
         IFSJavaFile dir = new IFSJavaFile(system, "//wkdis3/ROOT/home/bwe/");
         String directory0 = dir.getParent();
         System.out.println ("Directory0: " + directory0);
         String directory4=dir.getCanonicalPath();
         System.out.println ("Canonicalpath-Directory4: " + directory4);
    //     IFSJavaFile dir = new IFSJavaFile( "\\wkdis3\ROOT\home\bwe");
         JFileChooser chooser = new JFileChooser(dir, new IFSFileSystemView(system));
         Frame parent = new Frame();
         int returnVal = chooser.showOpenDialog(parent);
              if (returnVal == JFileChooser.APPROVE_OPTION) {
              IFSJavaFile chosenFile = (IFSJavaFile)(chooser.getSelectedFile());
              System.out.println("You selected the file named " +
                                       chosenFile.getName());
                   String filename = chosenFile.getName();
         IFSJavaFile file = new IFSJavaFile(system,directory4+filename);
         ParseTest xIncludeTest = new ParseTest(file);
              }//ende if
         catch(Exception e) {
              // System.out.println("Exception"+e+ "ist gefunden. /n ");
              System.out.println("Exception caught: "+e.getClass());
              // System.out.println("Datei "+filename+" ist nicht g�ltig.");
              e.printStackTrace();
    }

  • Should a signed applet ever throw a security exception?

    hi,
    I've had a few times when a signed applet seems to throw a security exception (at the moment am trying to figure out a SocketException being thrown).
    I thought if the applet was signed, and when the browser asks if you want to grant it permissions you press Yes (which I do), then there should not be any security issues?
    thanks,
    asjf

    A signed applet has to assert which permissions it wants. The client JVM then asks the user if they will give those permissions to the signer. If the applet tries to do something for which it hasn't been granted permission a security exception is thrown.

  • How to throw a SOAP exception

    Hi,
    I have a requirement from customer that when they call the WSDL from their app and the workflow will not get what it should, that it should throw standard SOAP exception.
    To give more details on it, they will send for example input string "A" and based on that I will return output string "B" in the process.
    Now if they ask for "C" for instance, I need to be able to throw that SOAP exception. Is that possible? The process in workbench consists of simple decision point and set value activity based on route conditions.
    Thanks
    J.

    I am assuming you are wanting something to come back as a SOAP fault element?
    Unhandled process exceptions are sent back as faults. So, theoretically, you could write a service component to do nothing but throw an exception. Then you could route your process to call that in specific situations.
    As an alternative, I would consider having something like an additional 'status' output variable that always came back in the response which indicated the status of your process.
    Good Luck,
    Ryan M. Jacobs
    [email protected]
    Cardinal Solutions Group

  • New ReportDocument() thows System.IO.FileNotFound exception

    I've inherited a Visual Studio 2003 windows service that uses managed C++ and C# + Crystal to print reports.  It was using Crystal 9 and now I'm trying to upgrade it to Crystal 11.
    Most of the windows service is in managed C++ but the Crystal part is in C#.  Basically it does a new ReportDocument, loads a report file, feeds it a dataset and some parameters and uses ReportDocument.PrintToPrinter(...) to output it.
    Everything still compiles after moving to Crystal 11 but I get a System.IO.FileNotFound exception when it gets to
    m_rptDocument = new ReportDocument();
    The exception doesn't include any information as to which file is not found.  So far FileMon hasn't been very helpful.  there are too many NOT FOUND results generated just as part of the normal running.  I tried a simplified test windows service and that seemed to work.
    I assume it is some sort of dependency issue.  Does anyone have any ideas how I can uncover the problem source?
    Thanks.
    Ben

    The service pack helped a little.  I'm getting different errors now.  They are a little more informative.  4 exceptions all stemming from doing a new ReportDocument();
    Exception:     {com.crystaldecisions.common.keycode.KeycodeException.ReadingFromRegistry}     com.crystaldecisions.common.keycode.KeycodeException.ReadingFromRegistry
    Stack:      businessobjects.licensing.keycodedecoder.dll!com.crystaldecisions.common.keycode.KeycodeCollectionImpl.Load(string location = @"Software\Business Objects\Suite 11.5\Crystal Reports\Keycodes\CR Ent") + 0xbd bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.  (string      9 = @"Software\Business Objects\Suite 11.5\Crystal Reports\Keycodes\CR Ent") + 0x29 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.~() + 0xb1 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.z() + 0x6b bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.ReportDocument() + 0xc5 bytes     
    Exception:     {com.crystaldecisions.common.keycode.KeycodeException.UnknownProperty}     com.crystaldecisions.common.keycode.KeycodeException.UnknownProperty
    Stack:      businessobjects.licensing.keycodedecoder.dll!com.crystaldecisions.common.keycode.KeycodeCollectionImpl.GetProperty(string propName = "CRSDK.InProc", long version = 115) + 0xa9 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.(com.crystaldecisions.common.keycode.KeycodeCollection      - = {com.crystaldecisions.common.keycode.KeycodeCollectionImpl}, string      0 = "CRSDK.InProc", int      1 = 115, long      2 = 0) + 0x3e bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.  (com.crystaldecisions.common.keycode.KeycodeCollection      3 = {com.crystaldecisions.common.keycode.KeycodeCollectionImpl}, int      4 = 115) + 0x4a bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.  (string      9 = @"Software\Business Objects\Suite 11.5\Crystal Reports\Keycodes\CR Dev") + 0x36 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.~() + 0xb1 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.z() + 0x6b bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.ReportDocument() + 0xc5 bytes     
    Exception:     com.crystaldecisions.common.keycode.KeycodeException     {com.crystaldecisions.common.keycode.KeycodeException.UnknownProperty}     com.crystaldecisions.common.keycode.KeycodeException
    Stack:      businessobjects.licensing.keycodedecoder.dll!com.crystaldecisions.common.keycode.KeycodeCollectionImpl.GetProperty(string propName = "CRSDK.Queuing", long version = 115) + 0xa9 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.(com.crystaldecisions.common.keycode.KeycodeCollection      - = {com.crystaldecisions.common.keycode.KeycodeCollectionImpl}, string      0 = "CRSDK.Queuing", int      1 = 115, long      2 = 0) + 0x3e bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.  (com.crystaldecisions.common.keycode.KeycodeCollection      3 = {com.crystaldecisions.common.keycode.KeycodeCollectionImpl}, int      4 = 115) + 0x6b bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.  (string      9 = @"Software\Business Objects\Suite 11.5\Crystal Reports\Keycodes\CR Dev") + 0x36 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.~() + 0xb1 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.z() + 0x6b bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.ReportDocument() + 0xc5 bytes     
    Exception:     {com.crystaldecisions.common.keycode.KeycodeException.UnknownProperty}     com.crystaldecisions.common.keycode.KeycodeException.UnknownProperty
    Stack:      businessobjects.licensing.keycodedecoder.dll!com.crystaldecisions.common.keycode.KeycodeCollectionImpl.GetProperty(string propName = "CRSDK.CPL", long version = 115) + 0xa9 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.(com.crystaldecisions.common.keycode.KeycodeCollection      - = {com.crystaldecisions.common.keycode.KeycodeCollectionImpl}, string      0 = "CRSDK.CPL", int      1 = 115, long      2 = 1) + 0x3e bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.  (com.crystaldecisions.common.keycode.KeycodeCollection      3 = {com.crystaldecisions.common.keycode.KeycodeCollectionImpl}, int      4 = 115) + 0x8c bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.  (string      9 = @"Software\Business Objects\Suite 11.5\Crystal Reports\Keycodes\CR Dev") + 0x36 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.~() + 0xb1 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.z() + 0x6b bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.ReportDocument() + 0xc5 bytes     
    Exception: {com.crystaldecisions.common.keycode.KeycodeException.ReadingFromRegistry}     com.crystaldecisions.common.keycode.KeycodeException.ReadingFromRegistry
    Stack:      businessobjects.licensing.keycodedecoder.dll!com.crystaldecisions.common.keycode.KeycodeCollectionImpl.Load(string location = @"Software\Business Objects\Suite 11.5\Enterprise\CRNETKeycode") + 0xbd bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.  (string      9 = @"Software\Business Objects\Suite 11.5\Enterprise\CRNETKeycode") + 0x29 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.~() + 0xb1 bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.z() + 0x6b bytes     
         crystaldecisions.crystalreports.engine.dll!CrystalDecisions.CrystalReports.Engine.ReportDocument.ReportDocument() + 0xc5 bytes     
    It acts like it is having trouble accessing registry keys, but I'm not sure why.  I have permissions and the first key exists.  The last one is missing, CRNETKeycode.

  • Strange javax.ejb.EJBException FileNotFound Exception though form is found

    Hi,
    I've set up a simple workflow, which consists of two user QPACs, which are connected to each other, let's call the first one 'user' and the second one 'admin'.
    I use a simple init-form, which merely consists of a dropdown and a submit button.
    The workflow works fine: 'user' selects a value from the dropdown-list, submits the form, 'admin' opens the form, the dropdown's value is still selected.
    However, in the logfile, the following exception is thrown:
    INFO  [STDOUT] Got tempFile : D:\Adobe\LiveCycle\temp\adobejb\DM4268780530925093172.dir\DM6500814794164759285.pdf
    INFO  [STDOUT] com.adobe.fm.extension.formserver.AresUtil getPDFDocument
    INFO: Loading the PDF.
    INFO  [STDOUT] com.adobe.fm.extension.formserver.AresUtil setPdfRights
    INFO: BufLength : 100415
    ERROR [org.jboss.ejb.plugins.LogInterceptor] EJBException:
    javax.ejb.EJBException: FileNotFound Exception: File [/fm//Forms/test_dropdown.xdp] not found
    at com.adobe.ebxml.registry.appstore.url.provider.XappstoreUrlDataProviderBean.getInputStream(XappstoreUrlDataProviderBean.java:193)
    at sun.reflect.GeneratedMethodAccessor419.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    As the workflow works, I could easily forget about the exception. But it outputs a couple of thousand(!) lines in the logfile each time, the form's submit button is pressed.
    Does anyone know, why do I get a FileNotFound exception though the workflow works fine???
    The exception may result from the incorrect path, which contains
    //. But why is the form then loaded anyway?
    Regards,
    Steve

    Hi Steve
    I'm not sure what the cause of the problem is.
    One thing...do you use the same form all the way through your process?
    If so, you should just be moving your form url information via your form variable. You would only choose "Change the form template Url to:" field if there was a different version of the form at this step. It doesn't hurt to do it but there is no need to. This is extra overhead.
    To use the same form all the way through the WF and move the data from each step:
    1) specify an init-form
    2) specify a form variable
    3) on the Mappings tab of your user QPAC you select your form variable as your "Input Variable" and select "use form template Url defined by Input Form Variable".
    4) also on the Mappings tab of your user QPAC you select your form variable as your "Output Variable"
    (You are probably not doing this, but there is also no need to fill in the template-url field in your form variable.)
    Diana

  • JNLP filenotfound exception

    Hello,
    with build 36, I had a desktop application which uses spring framework. There is an XML file that is read from the classpath, using the ClassPathXmlApplicationContext from spring. The XML file is in the root of my jar file. JNLP is used to release the application (on Tomcat). Everything worked as expected.
    With build 37 and 38, I have a FileNotFoundException when running with JNLP. Running in IDE works fine.
    Has anyone else found resource / classpath problems when running with JNLP?
    kind regards,
    Peter
    The exception:
    org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext-ehBoxClient-core.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext-ehBoxClient-core.xml] cannot be opened because it does not exist
         at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:341)
         at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
         at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
         at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
         at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
         at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
         at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:126)
         at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92)
         at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
         at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
         at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
         at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
         at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)

    Oddly, now that the FileNotFound exception, but another IOException is thrown
    C:\>jar cmf h.txt Hello.jar Hello.class
    java.io.IOException: invalid header field name: &#8745;&#9559;&#9488;Main-Class
    at java.util.jar.Attributes.read(Attributes.java:403)
    at java.util.jar.Manifest.read(Manifest.java:167)
    at java.util.jar.Manifest.<init>(Manifest.java:52)
    at sun.tools.jar.Main.run(Main.java:124)
    at sun.tools.jar.Main.main(Main.java:904)
    C:\>

  • Purpose of throws clause in exception handling

    hi all,
    I have written a sample code for exception handling...please refer below....
    class a
    void fun() throws ArithmeticException
    int i=0;
    i=10/0;
    class exec
    public static void main(String a[])
    a a1=new a();
         try{a1.fun();}
         catch(ArithmeticException e){System.out.println("hi");}
    }

    I read the article...and came out with these points...
    1..If method is throwing an unchecked exception (as in this case) then there is no need for throws clause, if you are not catching it then and there only.....
    2...if a method is throwing a checked exception then either you need to catch it then and there only or you must specify a throws clause for the same in function definition......*And the purpose of not catching it then and there only is*
    "For example, if you were providing the ListOfNumbers class as part of a package of classes, you probably couldn't anticipate the needs of all the users of your package. In this case, it's better to not catch the exception and to allow a method further up the call stack to handle it."
    M I RIGHT??

Maybe you are looking for

  • New objects

    Hi, I would like to make new objects for use in LiveType, is this possible ? then how do i do it? Or must i buy them? Thanks,

  • Reorganizing photos - some are now darkened

    I've been going through my photos and moving some from one project to another, creating new projects and making albums within projects. When I copy all photos of some projects and combine them with photos of another projects, some photos will not tra

  • Problems related to SQL application migration from 6.5 to 7.0

    we have developed our application with D2K as the front end and MS-SQL6.5 server as the database. We are trying to migrate the application to MS-SQL7.0 server as the database. The following are the limitations we are facing 1) It has been seen that w

  • Plant in FI Invoice Posting

    Hi Experts, How can I reflect Plant for each line item in FI Invoice posting using F-43 or even atleast at header level.  I cannot use Business Plance since my plants are having multiple tax registration numbers.  Thanks in advance, Mallik

  • Query on Oracle Self Service Time & its R12 Upgrade

    We have received a request from one of the prospective US based client for R12 upgrade proposal. The RFP say "Upgrade of Self-Service Time to Oracle Time and Labor (since Self-Service Time is not supported in R12) ". Any idea on Self-Service Time, is