Access network path from within servlet

I'm trying to copy some files from a network path from within a servlet. I realize that I cannot use drive letter mappings as they are profile specific. Instead I'm trying to use the unc path. I'm getting the following error when I read the error inputstream from the process:
String cmd = "XCOPY \\SERVER\SHARE\File.DAT C:\FOLDER /Y"
Runtime rt = Runtime.getRuntime();
Process p = rt.exec(cmd);
p.waitFor(); //execute process and wait for it to finish
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
BufferedReader error = new BufferedReader(new InputStreamReader(p.getErrorStream());0 File(s) copied
Invalid drive specification
Exit code: 4
It works from the command line, the problem I'm guessing is that Tomcat runs at as service under the SYSTEM account. What permissions should I put on the shared folder to allow this, or is it a path problem?
Any help would be appreciated.

Starting the Tomcat service under the Administrator account fixes the problem, is there any reason I shouldn't use the Administrator account for this?

Similar Messages

  • T400s and T500 experiencing slow response time accessing certain websites from within our network

    Hello there.... we have some Lenovo T400s running Windows 7 and T500 running WinXP Pro that are experiencing slow response time when trying to access certain website from within our company network (particularly this global crossing Web meeting, google maps): https://core1.callinfo.com/interface/guest.jsp?host=globalcrossing ... it takes 10-15 minutes before it loads the meeting login screen and same response time for google maps to respond as well... the thing is, other Lenovo T400s, T61, and other HP desktop machines that are connected to the same network in our company does not experience this slow response time... HOWEVER, when these problematic T400s / T500 laptops are connected to external network (e.g. home DSL, hotel DSL/Cable modem) the problem goes away.   Our NETWORK ran tests to monitor traffic to the websites from our company's network but seem to connect just fine... just wondering if anybody out there experienced the same problem and know of a solution.  By the way, the two newer T400s that are experiencing the slow response time have the following BIOS version 1.11 (6HET26WW) and BIOS version 1.09 (6HET24WW).  Then a T400s that is also connected to the same network but not experiencing the problem has a BIOS version of 1.02 (6HET17WW - running WinXP Pro).   NOTE: We also connected a Linksys USB wireless adapter to connect to our wireless network in the company but same problem - and problem occurs even when connected via network cable.  Your feedback will be greatly appreciated.

    Network World posted an article about a free response time monitoring tool that would be worth checking out

  • Accessing JAXR registry from within web service

    Hi I'm having trouble accessing the registry from within a web service running in the tomcat server.
    The service should register with the registry at startup, but in the logs from the tomcat server I can see that a JAXRException is thrown:
    javax.xml.registry.JAXRException: Unable to create ConnectionFactory: Provider com.sun.xml.registry.common.ConnectionFactoryImpl not found
         at javax.xml.registry.ConnectionFactory.newInstance(Unknown Source)
    If I run the program from outside the tomcat server as a standalone program, it registers perfectly.
    I believe the problem is that it is missing one or more jars.
    I have tried to put the jaxr-jars under shared/libs but that hasn't solved the problem.
    Has anyone an idea of what I'm doing wrong?
    Help is greatly appreciated!
    / Bo

    Hi swatdba
    I know that the build file states alle the packages that I need, and as I said, if I run my program like the regular JAXR examples, it works fine.
    The thing is, the JAXR examples are not web services on their own. They are merely Java programs that access the registry.
    In my case I am building a web service that should run in the tomcat server. When it initialises, it should register with the register, and also be able to search for other web services.
    I thought this would be possible per default, ie. the jars that the web service needs should already be available in the tomcat server, but it doesn't work. I have tried to put the jars that I've found in the build script in the folder C:\jwsdp-1.3\shared\lib, which according to the tomcat manual should be used to put jars that you want to share between your web services.

  • Is it possible to insert a url link into the itunes description tag. I want the user to be able to access my webpage from within itunes

    Hi,
    Is it possible to insert a url link into the itunes description tag in a feed. I want the user to be able to access my webpage from within itunes
    Thanks

    In the next release, we will be making adding our Measurement Studio components to existing projects much easier, but for now what you would need to do is add the support for Measurement Studio to your MFC project manually as detailed in our Knowledgbase at:
    http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/0cb6707522e92c958625689e0052bb77?OpenDocument
    Best Regards,
    Chris Matthews
    Measurement Studio Support Manager

  • How can I access applet paramters from within javafx?

    I have a simple javafx applet from the clock tutorial, but I would like to initialise this from parameters that are specified in the <APPLET> tag, for exaple <param name="timeZone" value="America/Los_Angeles">My question is how do I access this parameter from within javafx?
    Thanks,
    Phil

    I'm looking for the same answer, if anybody knows ... ;)

  • Accessing java objects from within javascript

    Hello,
    Anyone with an idea of a useful toolkit for accessing java objects from within javascript will be much appreciated.
    Thanks in advance,
    Antana.

    What do you mean by accessing Java objects? Do you mean interacting with an applet via JavaScript? Something else?

  • Accessing iPad camera from within DPS application

    I have a potential client who asked me if it were possible to access the camera from within a DPS application. I have no further information at this point regarding what the reason for it will be but thought I'd shoot the question out anyway. Apparently it is possible in iOS 6 to access the camera in mobile Safari but I don't know if that is of any help.
    Thoughts? Thanks!
    :jaj

    See http://forums.adobe.com/message/5040166#5040166.
    Neil

  • How to access a variable from within a symbol.

    How do I access a variable set outside a symbol from within that symbol?
    Thanks

    If you set a variable on stage ,say
    sym.setVariable("stageVariable", "I am stage variable");
    You can access it from within  a symbol using :
    var myVariable = sym.getComposition().getStage().getVariable("stageVariable");
    Basically you need to get handle to the symbol in which the variable is defined.

  • Accessing an ejb from a servlet gives resource not allowed exception

    hi friends,
    i deployed a bean in weblogic server calling from within a servlet. this bean is used to retrieve a database connection and returns to the servlet. i have done all the resource references lookups everything and also the bean is deployed successfully, but when i run the servlet i didn't get even the println messages. it gives resource not allowed message.
    here is the deployment descriptor is correct ? if anything wrong or missed, please mention and try to give me the solution.
    web.xml
    <web-app>
    <servlet>
    <servlet-name>TestConnection</servlet-name>
    <display-name>TestConnection</display-name>
    <servlet-class>tms.com.ejb.TestConnection</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>TestConnection</servlet-name>
    <url-pattern>TestConnection</url-pattern>
    </servlet-mapping>
    <resource-ref>
    <res-ref-name>tmsPool</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    <env-entry>
    <env-entry-name>tmsDataSource</env-entry-name>
    <env-entry-value>tmsPool</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>
    <env-entry>
    <env-entry-name>TMS_DBConnectionBean</env-entry-name>
    <env-entry-value>java:comp/env/ejb/TMS_DBConnectionBean</env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
    </env-entry>
    <ejb-ref>
    <ejb-ref-name>ejb/TMS_DBConnectionBean</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>tms.com.ejb.TMS_DBConnectionHome</home>
    <remote>tms.com.ejb.TMS_DBConnection</remote>
    <ejb-link>TMS_DBConnectionBean</ejb-link>
    </ejb-ref>
    </web-app>
    Ejb jar is
    <enterprise-beans>
    <session>
    <display-name>ConnectionBean</display-name>
    <ejb-name>TMS_DBConnectionBean</ejb-name>
    <home>tms.com.ejb.TMS_DBConnectionHome</home>
    <remote>tms.com.ejb.TMS_DBConnection</remote>
    <ejb-class>tms.com.ejb.TMS_DBConnectionBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    <env-entry>
    <env-entry-name>tmsDataSource</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>tmsPool</env-entry-value>
    </env-entry>
    <security-identity>
    <description></description>
    <use-caller-identity></use-caller-identity>
    </security-identity>
    <resource-ref>
    <res-ref-name>tmsPool</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    <!--<res-sharing-scope>Shareable</res-sharing-scope>-->
    </resource-ref>
    </session>
    </enterprise-beans>
    <weblogic-ejb-jar>
    weblogic ejb jar file is the following content.
    <weblogic-enterprise-bean>
    <ejb-name>TMS_DBConnectionBean</ejb-name>
    <stateless-session-descriptor>
    <pool>
         <max-beans-in-free-pool>1</max-beans-in-free-pool>
    </pool>
    </stateless-session-descriptor>
    <jndi-name>TMS_DBConnectionBean</jndi-name>
    </weblogic-enterprise-bean>
    thanx in advance..

    hi
    i tried the same but still i'm getting the same problem, the value i mentioned in the servlet lookup is java:comp/env/TMS_DBConnectionBean.
    then the value returned by the lookup would be java:comp/env/ejb/TMS_DBConnectionBean. right. Anyway i tried the same as u mentioned. that same problem resource not allowed is displayed in the browser. is there any other alternative to solve this?
    thanks

  • WRT610n access external ip from within LAN - NAT loopback

    Hi everybody,
    I've replaced my old ZyXEL P-320W with a WRT610n and lost one feature...
    I basically have a NAS assigned to IP 192.168.1.2, my router has IP 192.168.1.1 locally of course.
    Imagine I have IP X.X.X.X from the internet and that this IP is registered to myip.dyndns.org.
    In the old days (with my ZyXEL), I could ssh to my NAS using myip.dyndns.org from within my LAN, but now, I HAVE TO use the local ip (192.168.1.2) to access to it...
    I've done some research and found out that this feature is named "NAT loopback" and the closest to that feature I've found in the router configuration is "Filter Internet NAT Redirection" (in Security > Firewall) but enabling it or not does not make any difference...
    Did you guys already experience this? Is there a solution?
    Thanks in advance
    Jon

    Basically,to access the NAS...you have to use the local ip address...As far as the SSH is concerned,You need to open port 22 on the linksys router.Check this link.
    For logins using ssh keys permissions are very important to make it work. By default in WRT root's home directory is "/tmp". Create a directory called "/root" and changed root's home directory to this (edit the /etc/passwd file). Put your DSA and/or RSA keys in "/root/.ssh/authorized_keys" and "chmod -R go= /root" on the WRT. It should work...

  • How to access HTTP Header from within Web service?

    Hello,
    Is there a way to access HTTP header variables like CONTENT_TYPE, CONTENT_LENGTH from within Web Logic web service.
    I was able to get the HTTP header variable from within Apache AXIS services by calling context.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST
    How can i do this from weblogic web service.
    I need this to verify the client SSL_CLIENT_DN
    In access I can get the header as follows.
    HttpServletRequest req = (HttpServletRequest) context
              .getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
    clientID = req.getHeader("SSL_CLIENT_S_DN_Email");
    Thanks
    --Arun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    hi
    the following link may helpful to you
    http://e-docs.bea.com/wls/docs81/webserv/anttasks.html#1111537
    Regards
    Prasanna Yalam

  • Cannot access Dynamics XRM from within Event Receiver

    Hello everyone
    I'm struggling with an issue here and I would like to hear some advice from you. The problem is the following:
    I need to do something on Dynamics CRM whenever a document is uploaded to a specific location in SharePoint. I'm using an Event receiver for this purpose and connecting to CRM via the IOrganizationService, like this:
    IOrganizationService service = new OrganizationServiceProxy(serviceUri, null, credentials, null); //service uri is https//serviceUri is something like "https://crmserver/organization/XRMServices/2011/Organization.svc"
    But for some reason I'm unable to execute that line successfully (looks like it times out) from within the Event receiver. However, the same exact piece of code works perfectly fine if executed from a separate console application (i.e., outside the IIS application
    pool) running on the same SharePoint server...I'm confused, do I need to configure anything else on the SharePoint application pool so it let's me access the XRM service?
    More info:
    - It's not credentials issue, even provinding hardcoded it doesn't work
    - Both SharePoint 2013 and Dynamics CRM 2013 are on premises.
    - Integration between SharePoint and Dynamics CRM is done through the CRM List Component, over https, and it's working fine.This is not really important for this but it's just to tell that both servers can comunicate over https.
    I would really like to get some advice on this. Thank you in advance.
    Regards

    Hi,
    Per my understanding, there is an issue when trying to access Dynamic CRM in an Event Receiver.
    As you said, the same code works in a Console Application, it means the code should be OK. To narrow down the issue, I suggest you do as follows:
    1. Please debug this Event Receiver in Visual Studio to see if the Event Receiver is working, what’s more, it will give you more information about how the code works
    or if there is any exception thrown during debugging;
    2. Is it a Sandboxed solution? Sometimes
    the limitation of a Sandboxed solution would interrupt the code execution, you can try to change it to “Farm” solution and make another test;
    3. If the above steps not work for you, please trace the requests using Fiddler when the Event Receiver running, more details there would help you easier to find out
    the root cause of this issue.  
    Thanks 
    Patrick Liang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • No access to method from within the same class

    Hey there.
    First I have to excuse my English for I'm german and just learning...
    Ok, my problem is as follows. I have a class called JDBC_Wrapper it includes the method sendQuery(String query). When I call this method from within another class (where 'wrapper' is my instance of JDBC_Wrapper) it works fine. For example:
    wrapper.sendQuery("SELECT * FROM myDataBase");
    But then I have written a method called getNumRows() into my JDBC_Wrapper class.
    This method should send a query through sendQuery(Strin query) but when calling getNumRows() it says: "java.sql.SQLException: [FileMaker][ODBC FileMaker Pro driver][FileMaker Pro]Unbekannter Fehler." (Unbekannter Fehler -> Unknown Exception). What could that be?
    I'm using jdk2 sdk 1.4.2 with BlueJ. My database is Filemaker Pro 6. The ODBC/JDBC connector works fine.
    BerndZack

    This is within my JDBC_Wrapper class:
    public ResultSet sendQuery(String query)
            if(connected)
                try
                    Statement s = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
                    ResultSet rs = s.executeQuery(query);
                    return rs;
                catch(Exception e)
                    System.out.println(e);
            else
                //System.out.println("There is no connection to the datasource!");
            return null;
    public int getNumRows()
            try
                ResultSet r;
                r = this.sendQuery("SELECT COUNT(*) FROM " + table_name); // At this line the error occurs
                r.next();
                return (int)r.getInt(1);
            catch(Exception e)
                System.out.println(e.getMessage());
                return -1;
    }When I call sendQuery() from within another class it works, but calling getNumRows()
    throws an exception.

  • Accessing an AppleScript from within Mail

    Online Help in Mail says that you can automate tasks from within Mail using AppleScript (and Automator). It doesn't tell you how. It recommends that to learn more about AppleScript and Automator one should open those applications and browse their help files. Would that help me to learn how to install an AppleScript in Mail so that I can invoke it?
    Thanks.

    Thanks so much for the pointers, but I have already done those things. The Dictionary for Mail shows the nouns and verbs, but gives no other information. The Automator has about 8 automated tasks for Mail, none of which provide any information regarding how to install and invoke an AppleScript from within Mail. I have seen information on the web that led me to believe that I could put a script in ~/Library/Scripts/Applications/Mail and it would show up in a Script menu in Mail, but I tried this and it had no effect. I think it may not have been current. I was very surprised that Mail's Help facility didn't cover how to do it.
    I would appreciate your further assistance.
    Thank you.

  • Accessing a method from within another method

    I am having trouble accessing a method from inside a method in the same class.
    here is my code:
    public String getAns(int ans){
    answer = ans;
    ranswer = number1 * number2;
    if(answer != ranswer){
    return "No. Please try again";
    }else{
    return "Very good!";
    genQues();
    when i run this i get an Unreachable code error pertaining to genQues();
    is this allowed in Java and is there a more practical way to go about this?
    Thank you in advance

    next time use the correct code tags to post your code.
    Think of your problem like this though.
    You write
    if( something )
    then return some value;
    else
    then return some other value.
    The returns end the method here, returning the value.
    So, if the method ended at one of these 2 statements, how do you think it'll reach genQues(); ?
    Hope this helps.

Maybe you are looking for

  • In Mail, how can I get the type face for messages to be seen?

    By that, I mean when I open Mail and go to type an e mail message the type face is really quite small to the eye, yet it is set to be published as Tahoma 12. The only way I have found to enlarge it so that it can be read easily is to use Command and

  • I want to test a java program[UDDI  JAVAse1.4/2004] that uses:

    I want to test a java program[UDDI  JAVAse1.4/2004] that uses: 1.http://test.uddi.microsoft.com/inquire 2.https://test.uddi.microsoft.com/publish wel las of today(now) these urls changed or remain and are functional the same? if non, tell me new ones

  • Problem with CONTAINS function

    Hi all!! i got a problem with contains function. i'm running oracle 11g. if i execute this query: SELECT x.lid as id,  x.sztitular as titular, e.szname as proName, x.szresumen  as resumen, b.sztitle  as catName, f.szname  as secName, d.szname  as cli

  • Dynamic selections in LdB FMF

    Hello Guys, I hope some of you will be using the LdB FMF and the many SAP reports that use FMF. It is in Funds Management, specifically for Public sectors. There are some transactions for the program RFFMEPGAX. When any of these transactions or progr

  • I need the link to download Adobe Flash Player 64 bit for Windows 2008 server

    I need the link to download Adobe Flash Player 64 bit for Windows 2008 server