Java.io.FileNotFoundException: The system cannot find the path specified

hi all.
have this problem
i have a jsp with the codes as follows:
try{
File f=new File("C:/Program Files/Apache Group/Tomcat 4.1/webapps/iiso/account.xml");
FileWriter fw=new FileWriter(f,false);
XMLConverter xmlc=new XMLConverter();
String msg=xmlc.ConvertToXML("account");
fw.write(msg);
fw.flush();
System.out.println("file printed");
}catch(IOException ioe)
System.out.println(ioe);
}it works prefectly on my comp but however when i posted it up on the dev server
which is running on tomcat 4.0
i got this error:
java.io.FileNotFoundException: P:\Program Files\Apache Tomcat 4.0\webapps\IISOelearn\account.xml (The system cannot find the path specified)
the dev server is running on P drive.
tried installing tomcat 4.0 on my com and the code runs well.
could there be other sources tt i miss out causing the error?
many thanx in advance!
=)

Most probably the server has a different path setup from you.
Instead of hardcoding the full file path into your app, you should have the following
ServletContext application = getServletConfig().getServletContext();
String fileName = application.getRealPath("/account.xml");
File f = new File(fileName);The method ServletContext.getRealPath takes a WEBSITE relative link, and turns it into a real location on disk.
This makes your code completely independant of what machine it is installed on.
Cheers,
evnafets

Similar Messages

  • Java.io.FileNotFoundException: test.txt (The system cannot find the file sp

    Hi All,
    am getting the following error, help me out. Thanks in advance...
    java.io.FileNotFoundException: test.txt (The system cannot find the file specified)
         java.io.FileInputStream.open(Native Method)
         java.io.FileInputStream.<init>(FileInputStream.java:106)
         java.io.FileInputStream.<init>(FileInputStream.java:66)
         BinaryStreamServlet.doGet(BinaryStreamServlet.java:13)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    I have placed "test.txt" in the path"D:\Backup\Tomcat web server\apache-tomcat-6.0.14\webapps\examples\WEB-INF\classes\test.txt".
    web.xml entry is as follows,
    <servlet>
    <servlet-name>demoservlet2</servlet-name>
    <servlet-class>BinaryStreamServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>demoservlet2</servlet-name>
    <url-pattern>/demoservlet2</url-pattern>
    </servlet-mapping>
    Source code:
    import java.io.*;
    import java.net.*;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class BinaryStreamServlet extends HttpServlet{
    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException{     
    response.setContentType("text/plain"); /* set the MIME type */
         File f= new File("test.txt");
         byte[] arBytes = new byte[(int) f.length()];
         FileInputStream is= new FileInputStream("test.txt");
         is.read(arBytes);
         OutputStream os = response.getOutputStream();
         os.write(arBytes);
         os.flush();
    }

    I have one Drivers.xml file in /WEB-INF that i want to read .but everytime i get exception file not found..
    i m trying to read this xml file in DriverUtilties.java (a non servlet class)
    inside of /WEB-INF/classess folder is there and hierarchy for non-servlet class DriverUtilties is :- com.dds.apps.ptes.pidentifier.admin.util.common.DriverUtilties
    what code shall i write so that i can read the xml file. ???
    where i set in classpath ?
    MYCODE is like this :
    public static final String DEFAULT_FILE = "/WEB-INF/drivers.xml";
    InputStream in = new FileInputStream(DEFAULT_FILE);
    Thanks in advance

  • Java.lang.Error: java.util.zip.ZipException: The system cannot find the fil

    I got maven 221 installed
    i got jdk 1.6 and 1.5 installed (have tested both)
    I have a strange error. All my co-workers can build but I cant. The only thing I can find is that I dont have installed BEA Weblogic but I dont want to have that installed. It should be able to run anyway.
    Could someone tell me what is wrong? If you need pom.xml I got that one as well.
    process-classes:
    [copy] Copying 4 files to C:\hudson\jobs\albpm_ip-identity-asserter_-_Build\workspace\target\mbean-content
    [mkdir] Created dir: C:\hudson\jobs\albpm_ip-identity-asserter_-_Build\workspace\target\mbean-jar
    [java] Creating an MJF from the contents of directory C:\hudson\jobs\albpm_ip-identity-asserter_-_Build\workspace\target\mbean-content...
    [java] Compiling the files...
    [java] Creating the list.
    [java] Doing the compile.
    [java] WLMaker-SubProcess: : Exception in thread "main" java.lang.Error: java.util.zip.ZipException: The system cannot find the file specified
    [java] WLMaker-SubProcess: :      at weblogic.management.commo.BeanGenDriver.getManagementTempDir(BeanGenDriver.java:93)
    [java] WLMaker-SubProcess: :      at weblogic.management.commo.BeanGenDriver.main(BeanGenDriver.java:117)
    [java] WLMaker-SubProcess: : Caused by: java.util.zip.ZipException: The system cannot find the file specified
    [java] WLMaker-SubProcess: :      at java.util.zip.ZipFile.open(Native Method)
    [java] WLMaker-SubProcess: :      at java.util.zip.ZipFile.<init>(ZipFile.java:203)
    [java] WLMaker-SubProcess: :      at java.util.jar.JarFile.<init>(JarFile.java:132)
    [java] WLMaker-SubProcess: :      at java.util.jar.JarFile.<init>(JarFile.java:97)
    [java] WLMaker-SubProcess: :      at weblogic.management.commo.BeanGenDriver.getManagementTempDir(BeanGenDriver.java:90)
    [java] WLMaker-SubProcess: :      ... 1 more
    [java] WLMaker-SubProcess: : Stopped draining WLMaker-SubProcess:
    [java] WLMaker-SubProcess: : Stopped draining WLMaker-SubProcess:
    [java] BeanGen code generation failed
    [HUDSON] Archiving C:\hudson\jobs\albpm_ip-identity-asserter_-Build\workspace\pom.xml to C:\hudson\jobs\albpmip-identity-asserter_-Build\modules\dk.skat.ip.integration.albpm$ip-identity-asserter\builds\2010-11-2213-41-28\archive\dk.skat.ip.integration.albpm\ip-identity-asserter\1.2\pom.xml
    [INFO] ------------------------------------------------------------------------

    from my experience, using weblogic jars can be a pain if the full install is not on the local box.
    Note that you dont have to 'install' it. Just copy the directory.
    Reason is that the jar files have manifests with relative classpaths.
    For an example of horror take a look at the weblogic.jar MANIFEST's classpath entry.
    -Fred

  • Error in Java compilation: \s7u.log (The system cannot find the file specified)

    Hi there,
    I got an error when I tried to compile a group of sqlj and java files. The error below:
    ----------------------------------------------sqlj -status -passes -compile=true -ser2class -d=. -classpath=.;%CLASSPATH% E:\work\src\java\com\interadnet\persistence\*.sqlj E:\work\src\java\com\interadnet\persistence\*.java
    out [Translating 53 files]
    out [Reading file AdServerInformationType]
    out [Reading file AdsType]
    out [Reading file AgencyType]
    out [Reading file CampaigntocompletionType]
    out [Reading file CampaignType]
    out [Reading file ChannelType]
    out [Reading file ClientType]
    out [Reading file CompletionType]
    out [Reading file ContactType]
    out [Reading file CreativeType]
    out [Reading file FtpServerType]
    out [Reading file InsertioninstructionType]
    out [Reading file MediaServerType]
    out [Reading file SystemPropertyType]
    out [Reading file VendorType]
    out [Reading file AdServerInformationTypeRef]
    out [Reading file AdServerInformationView]
    out [Reading file AdsTypeRef]
    out [Reading file AdsView]
    out [Reading file AgencyTypeRef]
    out [Reading file AgencyView]
    out [Reading file CampaigntocompletionTypeRef]
    out [Reading file CampaignToCompletionView]
    out [Reading file CampaignTypeRef]
    out [Reading file CampaignTypeRefs]
    out [Reading file CampaignView]
    out [Reading file ChannelTypeRef]
    out [Reading file ChannelTypeRefs]
    out [Reading file ChannelView]
    out [Reading file ClientTypeRef]
    out [Reading file ClientTypeRefs]
    out [Reading file ClientView]
    out [Reading file CompletionTypeRef]
    out [Reading file CompletionTypeRefs]
    out [Reading file CompletionView]
    out [Reading file ContactTypeRef]
    out [Reading file ContactView]
    out [Reading file CreativeTypeRef]
    out [Reading file CreativeTypeRefs]
    out [Reading file CreativeView]
    out [Reading file FtpServerTypeRef]
    out [Reading file FtpServerView]
    out [Reading file InsertioninstructionTypeRef]
    out [Reading file InsertioninstructionTypeRefs]
    out [Reading file InsertionInstructionView]
    out [Reading file MediaServerTypeRef]
    out [Reading file MediaServerView]
    out [Reading file SystemPropertyTypeRef]
    out [Reading file SystemPropertyTypeRefs]
    out [Reading file SystemPropertyView]
    out [Reading file VendorTypeRef]
    out [Reading file VendorTypeRefs]
    out [Reading file VendorView]
    out [Translating file AdServerInformationType]
    out [Translating file AdsType]
    out [Translating file AgencyType]
    out [Translating file CampaigntocompletionType]
    out [Translating file CampaignType]
    out [Translating file ChannelType]
    out [Translating file ClientType]
    out [Translating file CompletionType]
    out [Translating file ContactType]
    out [Translating file CreativeType]
    out [Translating file FtpServerType]
    out [Translating file InsertioninstructionType]
    out [Translating file MediaServerType]
    out [Translating file SystemPropertyType]
    out [Translating file VendorType]
    out [Translating file AdServerInformationTypeRef]
    out [Translating file AdServerInformationView]
    out [Translating file AdsTypeRef]
    out [Translating file AdsView]
    out [Translating file AgencyTypeRef]
    out [Translating file AgencyView]
    out [Translating file CampaigntocompletionTypeRef]
    out [Translating file CampaignToCompletionView]
    out [Translating file CampaignTypeRef]
    out [Translating file CampaignTypeRefs]
    out [Translating file CampaignView]
    out [Translating file ChannelTypeRef]
    out [Translating file ChannelTypeRefs]
    out [Translating file ChannelView]
    out [Translating file ClientTypeRef]
    out [Translating file ClientTypeRefs]
    out [Translating file ClientView]
    out [Translating file CompletionTypeRef]
    out [Translating file CompletionTypeRefs]
    out [Translating file CompletionView]
    out [Translating file ContactTypeRef]
    out [Translating file ContactView]
    out [Translating file CreativeTypeRef]
    out [Translating file CreativeTypeRefs]
    out [Translating file CreativeView]
    out [Translating file FtpServerTypeRef]
    out [Translating file FtpServerView]
    out [Translating file InsertioninstructionTypeRef]
    out [Translating file InsertioninstructionTypeRefs]
    out [Translating file InsertionInstructionView]
    out [Translating file MediaServerTypeRef]
    out [Translating file MediaServerView]
    out [Translating file SystemPropertyTypeRef]
    out [Translating file SystemPropertyTypeRefs]
    out [Translating file SystemPropertyView]
    out [Translating file VendorTypeRef]
    out [Translating file VendorTypeRefs]
    out [Translating file VendorView]
    out [Compiling 53 Java files]
    err*** The following character string is too long:
    err***
    out Error in Java compilation: \s7u.log (The system cannot find the file specified)
    Any suggestion appreciated.
    Daniel Huang

    Having not seen this before, I assume that the issue is that the command line string is too long when Javac is invoked.
    Here are a few things to reduce the size of the command line:
    - do not use the CLASSPATH option, but set the CLASSPATH environment variable (you can to that in a .bat file)
    - do not provide the .java files but rely on the implicit make capability in both, the SQLJ translator and the Java compiler. (Note: you must mention all of the .sqlj files that your program requires, do not rely on implicit make to find all of those.)
    - you can perform the -ser2class conversion as a separate step (see the SQLJ FAQ), as well as the Java compilation
    - there may or may not be a facility in your operating system to increase the size of the environment (and this may or may not have an effect on the maximum command line length)
    - you could try to omit the -passes option and see if that helps (that may actually be where your invocation if failing in the first place, in that it cannot write to some temporary file).
    Let us know how it goes. Thanks!

  • The system cannot find the file specified error in ftp upload

    Hi,
    i am using filezilla ftp server and apache common ftp client and while uploading a file i am getting below error:
    code to call ftp client
    String local_file ="D:\\home2.JPEG";
    String remote_file ="\\abc";
    ApacheFTPClient apacheFTP = new ApacheFTPClient();
    String[] abc ={"-s", "127.0.0.1", "Manender", "Manender", remote_file, local_file};
    apacheFTP.main(abc);
    error log:
    220-FileZilla Server version 0.9.31 beta
    220-written by Tim Kosse ([email protected])
    220 Please visit http://sourceforge.net/projects/filezilla/
    Connected to 127.0.0.1.
    USER Manender
    331 Password required for manender
    PASS Manender
    230 Logged on
    SYST
    215 UNIX emulated by FileZilla
    Remote system is UNIX emulated by FileZilla
    java.io.FileNotFoundException: D:\home2.JPEG (The system cannot find the file specified)
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(Unknown Source)
         at java.io.FileInputStream.<init>(Unknown Source)
         at com.po.ApacheFTPClient.main(ApacheFTPClient.java:152)
         at com.po.sample.main(sample.java:120)
    i have file in my d directory with same name.
    please help me in this.
    thanks in advace..

    i have file in my d directory with same name.Doesn't look like that? Are you sure that it isn't named e.g. home2.jpg?

  • Startup error: ldaprealm.properties (The system cannot find the file specified)

    Hello,
    I'm starting WebLogic from JBuilder 3.5; before using the LDAP realm
    everything worked fine.
    After adding the following entry to the weblogic.properties file
    weblogic.security.realmClass=weblogic.security.ldaprealm.LDAPRealm
    the WLS states following error message:
    java.io.FileNotFoundException: ldaprealm.properties (The system cannot
    find the file specified)
    The ldaprealm.properties file is located in the WL_HOME dir (same location
    as weblogic.properties)
    I've start WLS with -Duser.dir=c:\weblogic, but it didn't affect my problem.
    When starting WLS with startWebLogic.cmd, everything works fine but no
    practicalbe for me,
    because I've to start in form JBuilder in order to enable remote debugging.
    Thanx for your help in advance,
    Michael

    http://www.bea.com/support/askbea/wls/S-06632.shtml
    ldaprealm.properties has to be in %WinDir%\System32 to be picked up by a WLS 5.1 server run as a service and LDAPRealm enabled.
    Still getting interesting LDAP errors, but the file is being picked up on startup.

  • Obfuscation Error: C:\Documents (The system cannot find the file specified)

    Hi,
    I want to obfuscate my jar file. for this purpose i followed the steps below.
    1. Copied proguard.jar in C:\WTK2.5.2\bin
    2. Now opened the file ktoolbar.vm , which is present in C:\WTK2.5.2\bin
    my ktoolbar.vm looks like this
    {color:#666699}C:\PROGRA~1\Java\JDK16~1.0_0\bin\java -Dkvem.home="%KVEM_HOME%" -Djava.library.path="%KVEM_HOME%/bin" -Dsun.java2d.ddlock=true -Dsun.java2d.gdiblit=false -cp "%KVEM_HOME%/wtklib/kenv.zip";"%KVEM_HOME%/wtklib/ktools.zip";"%KVEM_HOME%/bin/JadTool.jar";"%KVEM_HOME%/bin/MEKeyTool.jar";"%KVEM_HOME%/wtklib/customjmf.jar";"%KVEM_HOME%/lib/j2me-ws.jar";"%KVEM_HOME%/lib/j2me-xmlrpc.jar";"%KVEM_HOME%/bin/schema2beansdev.jar";"%KVEM_HOME%/bin/j2me_sg_ri.jar";"%KVEM_HOME%/bin/jaxrpc-impl.jar";"%KVEM_HOME%/bin/jaxrpc-api.jar";"%KVEM_HOME%/bin/jaxrpc-spi.jar";"%KVEM_HOME%/bin/activation.jar";"%KVEM_HOME%/bin/mail.jar";"%KVEM_HOME%/bin/saaj-api.jar";"%KVEM_HOME%/bin/saaj-impl.jar";"%KVEM_HOME%/bin/xsdlib.jar";"%KVEM_HOME%/wtklib/nist-sip-1.2.jar";"%KVEM_HOME%/wtklib/JainSipApi1.1.jar";"%KVEM_HOME%/wtklib/jain-sip-presence-proxy.jar" com.sun.kvem.toolbar.Main{color}
    3. my project or my workspace is at location D:\workspace\WTK
    4. Also my wtk is located at C:\WTK2.5.2
    5 Now i renamed ktoolbar.vm to ktoolbar.bat and the edited the file then added 2 lines at the beginning of ktoolbar.bat
    SET USER_HOME=D:\workspace\WTK
    SET KVEM_HOME=C:\WTK2.5.2
    6 Also i added -Duser.home=%USER_HOME% in the next line.
    7 Now my ktoolbar.bat looks like this.
    {color:#800080}SET USER_HOME=D:\workspace\WTK SET KVEM_HOME=C:\WTK2.5.2 C:\PROGRA~1\Java\JDK16~1.0_0\bin\java -Dkvem.home="%KVEM_HOME%" -Duser.home=%USER_HOME% -Djava.library.path="%KVEM_HOME%/bin" -Dsun.java2d.ddlock=true -Dsun.java2d.gdiblit=false -cp "%KVEM_HOME%/wtklib/kenv.zip";"%KVEM_HOME%/wtklib/ktools.zip";"%KVEM_HOME%/bin/JadTool.jar";"%KVEM_HOME%/bin/MEKeyTool.jar";"%KVEM_HOME%/wtklib/customjmf.jar";"%KVEM_HOME%/lib/j2me-ws.jar";"%KVEM_HOME%/lib/j2me-xmlrpc.jar";"%KVEM_HOME%/bin/schema2beansdev.jar";"%KVEM_HOME%/bin/j2me_sg_ri.jar";"%KVEM_HOME%/bin/jaxrpc-impl.jar";"%KVEM_HOME%/bin/jaxrpc-api.jar";"%KVEM_HOME%/bin/jaxrpc-spi.jar";"%KVEM_HOME%/bin/activation.jar";"%KVEM_HOME%/bin/mail.jar";"%KVEM_HOME%/bin/saaj-api.jar";"%KVEM_HOME%/bin/saaj-impl.jar";"%KVEM_HOME%/bin/xsdlib.jar";"%KVEM_HOME%/wtklib/nist-sip-1.2.jar";"%KVEM_HOME%/wtklib/JainSipApi1.1.jar";"%KVEM_HOME%/wtklib/jain-sip-presence-proxy.jar" com.sun.kvem.toolbar.Main{color}
    8 Now i opened the command promt and i executed the bat file.
    9 Now when i try to open the WTK toolkit it gives me the following error
    Fatal error : File: C:\WTK.2.5.2\bin\ktoolbar.vm does not exist
    Please help me to resolve this issue or suggest me some different way.
    Also i would like to tell that my project is completely build using netbeans 6.5 . but when i try to make the obfuscation level high using the scroll that is provided by netbeans , it gives me following error.
    {color:#ff0000}C:\Documents and Settings\SShete\My Documents\NetBeansProjects\vtms_test_lwuit_Backup\nbproject\build-impl.xml:459: Error while expanding C:\Documents and Settings\SShete\My Documents\NetBeansProjects\vtms_test_lwuit_Backup\build\obfuscated.jar
    java.io.FileNotFoundException: C:\Documents and Settings\SShete\My Documents\NetBeansProjects\vtms_test_lwuit_Backup\build\obfuscated.jar (The system cannot find the file specified)
    BUILD FAILED (total time: 8 seconds){color}
    Also i dont know what changes are to be done to the build.xml so that obfuscation can be done .
    Thats the reason why i am now opening the same project using wtk and trying to obfuscate it.

    hi....
    i have tried another way out ,
    i followed the procedure below
    In order to integrate this plug-in in the toolkit, you'll have to put the following lines in the file {j2mewtk.dir}/wtklib/Linux/ktools.properties or {j2mewtk.dir}\wtklib\Windows\ktools.properties (whichever is applicable).
    obfuscator.runner.class.name: proguard.wtk.ProGuardObfuscator
    obfuscator.runner.classpath: /usr/local/java/proguard/lib/proguard.jar
    Please make sure the class path is set correctly for your system.
    Once ProGuard has been set up, you can apply it to your projects as part of the build process. The build process is started from the WTK menu bar:
    Project -> Package -> Create Obfuscated Package
    The Toolkit obfuscates other sample projects
    However now my project gets build without errors , but when i try to create a obfuscated package it gives me the following error
    Error preverifying class bc
    VERIFIER ERROR bc.a(Z)Lhx;:
    Incompatible object argument for invokespecial
    com.sun.kvem.ktools.ExecutionException: Preverifier returned 1
    Build failed
    Please help..

  • Error: ldaprealm.properties (The system cannot find the file specified)

    Hi,
    I'm getting the following error message when starting up WLS
    java.io.FileNotFoundException: ldaprealm.properties
    (The system cannot find the file specified)
    This seems to me as if ldaprealm.properties isn't in the
    proper place/dir.
    The docu tells me to put it to WL_HOME - and there
    it resides.
    I cannot start WLS with the startWebLogic.cmd file (which
    alway works fine), because I'm forced to do it via JBuilder.
    Maybe someone can tell me a property to change the
    startup dir (-Duser.dir=c:\weblogic doesn't work)
    thanx in advance,
    Michael

    http://www.bea.com/support/askbea/wls/S-06632.shtml
    ldaprealm.properties has to be in %WinDir%\System32 to be picked up by a WLS 5.1 server run as a service and LDAPRealm enabled.
    Still getting interesting LDAP errors, but the file is being picked up on startup.

  • Getting Error- Desktop\WSDL1\main.wsdl The system cannot find the path spec

    Hai to every one !
    iam using wsdl file which is downloaded "wsdlzip" file from wsnavigator to my desktop.
    Extracted zip file .
    i used main.wsdl file as adaptive webservice model in webdynpro application.
    I developed application then iam not getting output ,  facing error like
    java.io.FileNotFoundException: Desktop\WSDL1\main.wsdl (The system cannot find the path specified)
    could any body help me on this.

    Hi Eswar,
           While importing WSDL using Adaptiver WS did you use the WS destinations. If yes, then did you create WS Destinations in the Visual Administrator?
    You need to provide the url of the webservice in WSDestinations in Visual Administrator. It should be the url of the webservice in which the webservice is deployed and not the desktop URL.
    the url will be like this
    Ex: http://host:50000/OrderRequestForEBasis/Config1?wsdl
    This url you can get by going to
    http://host:port/wsnavigator in which server your webservice is located.
    Thanks,
    Gopi

  • Upgrading to MBAM 2.5: Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0.....the system cannot find the file specified.

    Upgrading from MBAM 1.0 to 2.5 on the Administration and Monitoring server (database server already upgraded). To upgrade the administration server, I uninstalled MBAM 1.0 -> Deleted the MBAM website from IIS manually -> Reboot -> Installed MBAM
    2.5. After upgrade if I go to selfservice portal via
    https://myserver.mycompany.com/selfservice, I get this error:
    Server Error in '/SelfService' Application.
    Could not load file or assembly 'System.Web.WebPages.Razor,
    Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its
    dependencies. The system cannot find the file specified.
    Description:
    An unhandled exception occurred during the execution of the current web
    request. Please review the stack trace for more information about the error and
    where it originated in the code.
    Exception Details:
    System.IO.FileNotFoundException: Could not load file or assembly
    'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot
    find the file specified.
    Source Error:
    An unhandled exception was generated during the execution of the
    current web request. Information regarding the origin and location of the
    exception can be identified using the exception stack trace below.
    Stack Trace:
    [FileNotFoundException: Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.]
    System.Web.Mvc.PreApplicationStartCode.Start() +0
    [InvalidOperationException: The pre-application start initialization method Start on type System.Web.Mvc.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..]
    System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +12980619
    System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +12980328
    System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded) +280
    System.Web.Compilation.BuildManager.ExecutePreAppStart() +172
    System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1151
    [HttpException (0x80004005): The pre-application start initialization method Start on type System.Web.Mvc.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified..]
    System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12979668
    System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
    System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12819261
    Anyone know how to solve this? Thanks in advance

    Sorry for late response. I fixed the issue by installing the correct version of ASP .NET 4 from
    here.
    If .NET Framework 4.5 is already installed, also run aspnet_regiis -i from C:\windows\microsoft.net\Framework\v4.0.30319

  • The system cannot find the path specified - Problems

    I am having an issue that I am hoping someone can help figure out for me.
    I am currently learning Java, and am working with the Beginning Programming with Java for Dummies book second edition. I have downloaded and am running the Java 6 program and am using the JCreator 3.5Pro that was recommended to run the Practice files for the Dummies book.
    I have the practice files here:
    C/Program Files/Xinox Software/JCreatorV3/My Projects
    While trying to compile one of the practice files, I get this error message:
    --------------------Configuration: MyNewProject - JDK version 1.6.0_21 <Default> - <Default>--------------------
    javac: file not found: src_mynewproject.txt (The system cannot find the path specified)
    Process completed.
    **When I try to execute, I get this error message:**
    --------------------Configuration: MyNewProject - JDK version 1.6.0_21 <Default> - <Default>--------------------
    java.lang.NoClassDefFoundError: EchoLine
    Caused by: java.lang.ClassNotFoundException: EchoLine
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    Could not find the main class: EchoLine. Program will exit.
    Exception in thread "main"
    Process completed.
    When I set up the new file, and the new class, I confirmed the file path.
    I know most people will ask if I am absolutely certain I put in the code in properly, and yes I did. It was a matter of copying word for word, and punctuation. I did it 100% correctly. About 12 times. I have NO idea what this means, but I would REALLY REALLY appreciate any help on this.
    Please keep in mind, I am slightly clueless, and really need to have any help dumbed down a bit. Lol.
    As a side note, this isn't my first project, and I haven't had this problem before now.
    thanks in advance. =)

    So I wanted to clarify what I've done a bit more since I decided to redownload the dummies programs for the program and try again.
    I will try to list my steps in order of what I did and see if I've gone wrong somewhere along the line.
    I downloaded my project files from here: http://ca.dummies.com/store/product/Beginning-Programming-with-Java-For-Dummies-2nd-Edition.productCd-0764588745,navId-322469,descCd-DOWNLOAD.html
    I unzipped them this time here: C:\Program Files\Java\jdk1.6.0_21\MyProjects\
    I opened JCreator 3.5 and starting fresh, with all previous projects deleted and clicked on "Open Workspace". I chose "MyWorkspace.jcw". Right clicked MyWorkspace and chose "Add new Project" and then chose "Empty Project". As per the books instruction for the first project, I named it "MyFirstProject". My file path was: C:\Program Files\Java\jdk1.6.0_21\MyProjects\MyFirstProject. Which is where I upzipped the files. I added it to current workspace and clicked finish.
    I then added a new class. As per the books instructions, I right clicked "MyFirstProject" and selected Add New Class. For the name, I used MyFirstJavaClass, which is what the book told me to do. My locations are the exact same as above. and I clicked on Generate new Method, as it told me to. Which it doesn't in the next few lessons, so I know this has nothing to do with it. For that and a few other reasons. Lol.
    I clicked on Finish.
    All I had to do was replace a single line of code. Not type it all in this time.
    Here is what shows up on the screen:
    class MyFirstJavaClass {
         * Method main
         * @param args
         public static void main(String[] args) {
              // TODO: Add your code here
    I need to change the : // TODO: Add your code here
    with the line:
    System.out.println.("Chocolate, royalties, sleep");
    When I do this, and compile project, I get this:
    --------------------Configuration: MyFirstProject - JDK version 1.6.0_21 <Default> - <Default>--------------------
    javac: file not found: src_myfirstproject.txt (The system cannot find the path specified)
    Process completed.
    AGAIN! But it worked a few days ago.
    And when I execute, I get this:
    --------------------Configuration: MyFirstProject - JDK version 1.6.0_21 <Default> - <Default>--------------------
    java.lang.NoClassDefFoundError: MyFirstJavaClass
    Caused by: java.lang.ClassNotFoundException: MyFirstJavaClass
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    Could not find the main class: MyFirstJavaClass. Program will exit.
    Exception in thread "main"
    Process completed.
    I really hope the extra info helps someone help me!
    thank you!
    Edited by: MissPamela on Jul 19, 2010 3:23 PM

  • "The system cannot find the file specified" - error reading properties file

    I have packaged a class file and a .properties file in the same folder as a ejb-jar file and in the class file i try reading the properties file and it throws me the error - "The system cannot find the file specified". But when I put the complete path, it has no problem finding the file.
    I know that this must be the problem with classpath, but can anybody tell me why it is not finding the properties file even if they are in the same folder. How do I make class files find .properties file which are in a folder.
    Any help will be greatly appreciated.

    Hi,
    I am not sure if your question is realted to the Oracle Application Server - anyway, if you are packaging a class file and a properties file in a JAR File, you need to read the contents in a different manner...something like this... :
    URL url = new URL("jar:file:/home/duke/duke.jar!/");
    JarURLConnection jarConnection = (JarURLConnection)url.openConnection();
    You might want to have a look at this link for more information :
    http://java.sun.com/docs/books/tutorial/index.html
    You may also get better responses if you post your question in one of the Java Forums.
    Regards,
    Sandeep

  • The System cannot find the path specified

    I saved "HelloWorldApp.java" in note pad Then, what will be its path?
    In Command Prompt, .>>cd C:\java.> ENTER.
    Instead of getting C:\java> in Command Prompt, i am getting error "The System cannot find the path specified"
    I set PATH variable> C:\Program Files\Java\jdk1.6.0_05\bin since i downloaded jdk-6u5 windows.
    I am unable to proceed further (forget making .classpath and running the program.)
    My operating system is window xp.
    damp

    damp wrote:
    I saved "HelloWorldApp.java" in note pad Then, what will be its path?
    In Command Prompt, .>>cd C:\java.> ENTER.
    Instead of getting C:\java> in Command Prompt, i am getting error "The System cannot find the path specified"
    I set PATH variable> C:\Program Files\Java\jdk1.6.0_05\bin since i downloaded jdk-6u5 windows.
    I am unable to proceed further (forget making .classpath and running the program.)
    My operating system is window xp.
    dampIts path will be the path you saved it to in notepad?
    and unless you DO have a directory "c:\java" i recommend you cd to "C:\program Files\java".
    Edited by: AikmanAgain on Mar 22, 2008 9:39 AM

  • The system cannot find the file specified!!

    hi
    i am new to java web start. i am trying to run a program which copies the contents of a text file farrago.txt to a new file in some other directory.
    i have packed farrago.txt in the jar file with the program but
    when i run the program through webstart i am getting error:
    the system cannot find the file specified(farrago.txt)
    in my program the code to read the file is:
    File inputFile = new File("farrago.txt");
    how can i access my file from the jar file??
    please help!
    zamir

    You need to read in the file using loadResource() - see:
    http://java.sun.com/products/javawebstart/docs/developersguide.html#dev

  • The system cannot find the path specified.---- Error code:-2147467259 Error code name:failed

    Friends,
                I'm facing below issue while accessing a crystal report. I heard it might be an access issue. But i'm able to access a report within a same folder.
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException : The system cannot find the path specified.---- Error code:-2147467259 Error code name:failed
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    at com.crystaldecisions.sdk.occa.report.application.PrintOutputController.export(Unknown Source)
    Any suggestions would be very helpful.
    Thanks in Advance,
    Bharath

    Apply trace on RAS and look for errors in the RAS logs at the same timestamp.
    These errors come for various errors and tracing RAS would give us a better idea.
    It might hapen that you observe these errors for reports which takes more than the RAS timeout to export the reports.
    Post getting the RAS logs you can try below steps if we see timeout errors in RAS logs.
    Copy clientSDKOptions.xml file from <BO install path>\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib to the machine where your app is running Open clientSDKOptions.xml and change CORBARequestTimeOut from 600000 to a value large enough to allow the report to render, for instance 1200000. Default value is 600000 (10 minutes)
    Specify the location of the clientSDKOptions.xml file at run-time. In your JSP or Java files, use the Java method setProperty from the System class. Set the system property indicated by the ras.config key to the specified directory as: system.setProperty("ras.config","c:\temp"). This function call specifies that the clientSDKOptions.xml file in c:\temp is to be used for locating RAS servers.
    Thanks,
    Prithvi

Maybe you are looking for

  • Can I install OS 9 on an external Firewire drive?

    I am not sure if this belongs in the G5 thread or the Leopard thread. Anyway: I have a Mac G5, running Leopard 10.5.4. I understand that Leopard will not run Classic applications. *However, can I install OS 9 on an external Firewire drive? And just b

  • Decimal places in to copy factor in Realignment

    Hi Experts, We requierd to enter some decimal places in to "copy factor" field in the realignment. Do we have any other setting to fulfil this requirement? Regards Sujay

  • Counting letters in a field

    I have a field and for example inside it has the word "hello" and the "llo" in the text is red and the "he" is in gray... I want a script so that in the message window, it displays the number of words either in gray or red.. please help me find it AS

  • HDV downconverting vs shooting on DVcam

    Hello everyone, Having just found out i can't view my HDV project on a monitor (perhaps I should of realised this earlier) and having read many a thread on the pros and cons of HDV i wanted to ask a question: What is the qualititve difference between

  • Alert Manager HTML Email Query

    Hi, Is it possible to send an email in HTML format using Alert Manager as I would like to send a URL as part of the text. Thx in Advance. Best Regards Ramdas