WebServer on sbRIO

Hey Guys,
I am trying to make a webserver application on an NI 9636 sbRIO. I think I have all the necessary software installed on the target.
I have built the webserver Build Specification and I can see the deployed webserver under the "Deployed Web Services" option of the NI Web based Configuration & Monitoring tool (screenshot attached).
I attached a demo project, which has the sbRIO target with a "static" folder (this includes index.html), and the webserver Build Specification. The deployed webserver is shown in the attached screenshot. When I try to open 192.168.1.180/RIO_WebService/static/index.html, I get error 404.
Do you have any suggestions why I cannot open the index.html page?
I almost forgot: With the exact same configuration steps, I can deploy and reach the webserver on a desktop pc without any problems.
I hope I made it clear what the problem is. I you need any further information, please ask!
Thanks in advance,
Norbert
Solved!
Go to Solution.
Attachments:
_RIO_WebServer.zip ‏9 KB
Web Based Config and Monitor Screenshot.png ‏67 KB

Hi Norbert and welcome to NI Forums!
Did you try to access it using the port configued in the Web Application Server? So in your case, 192.168.1.180:8080/RIO_WebService/static/index.html or something similar.
The web service setup looks good to me.
Kind regards:
Andrew Valko
NI Hungary
Andrew Valko
National Instruments Hungary

Similar Messages

  • Webserver on compactrio problem

    i'm trying to program a remote front panel / website to control a vi running on the RT of a singleboard RIO
    the vi is just a control and led in a while loop (for testing)
    i've tried:
    http://digital.ni.com/public.nsf/allkb/7FEE6BCFD264175C8625723E000D928E
    and
    http://forums.ni.com/ni/board/message?board.id=170&message.id=275186&requireLogin=False
    clear steps, but it doesn't work
    i can make a remote frontpanel for a vi running on my pc, but not on the sbRIO.
    the page wil load, but the vi doesn't show.
    Can i get an example somewhere of how it is done?
    also why do you need to make an executable?
    are there any settings i should check?
    thanks
    Solved!
    Go to Solution.

    Is there anything strange about these steps?
    - create a new project: webpanel in my case
    - add the RT-target: sbRIO in my case
    - create a VI that´s gonna be the VI with the Frontpanel displayed in the Website later: named webpanel.vi
    - test that VI by simply running it and therefore connecting to the target
    - enable webserver on the target (rightclick the target in the LV-Project-Window)
    - reboot the target
    - build a website from the VI with the Web-Publishing Tool in LabVIEW/Tools
    - copy that website down to the target via ftp
    - create a new RT-Startup-Application under Build-Specifications in the Project Window
      and build that app
    - deploy all to the target from the Project Window (Rightclick the Project.lvproj) -> i clicked the sbRIO target
    - Reboot the target -> target disconnects after reboot, is that ok?
    - type IP-Adress of target and hit ENTER to check if the webserver is started (default site must be loaded)
    - finally type IP-Adress/Website.html to load the website
    I can't connect to any website on the sbRIO, but can still ftp them, however ftp'ing and opening the webpanel.html i get this error:
    thanks!

  • Error in Starting WebServer (Ver 7) Admin Server

    Hi,
    I am getting the error shown below when starting the Webserver 7 admin
    server. The Web server starts and I can administer the server but when deploying Access Manager getting agan the same java.lang.NoClassDefFoundError and can't AM complete configuration.
    Please help me. After attending Access Manager 7.1 training
    wanted to practice on this env.
    My Env is:
    uname -a:
    SunOS sun1 5.10 Generic_120012-14 i86pc i386 i86pc
    /etc/release:
    Solaris 10 8/07 s10x_u4wos_12b X86
    Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
    Use is subject to license terms.
    Assembled 16 August 2007
    cat release_info :
    Product=Java Enterprise System 5U1
    Date=Mon Aug 20 18:05:55 PDT 2007
    Build=08b
    PatchLevel=000
    [25/Dec/2007:19:06:54] info ( 8308): CORE1116: Sun Java System Web
    Server 7.0U1 B07/18/2007 14:21
    [25/Dec/2007:19:06:55] info ( 8309): CORE5076: Using [Java HotSpot(TM)
    Server VM, Version 1.5.0_12] from [Sun Microsystems Inc.]
    [25/Dec/2007:19:06:59] info ( 8309): WEB0100: Loading web module in
    virtual server [admin-server] at [admingui]
    [25/Dec/2007:19:07:00] info ( 8309): WEB0100: Loading web module in
    virtual server [admin-server] at [jmxconnector]
    [25/Dec/2007:19:07:06] info ( 8309): PWC1412: WebModule[jmxconnector]
    ServletContext.log():PWC1409: Marking servlet remotejmx as unavailable
    [25/Dec/2007:19:07:06] failure ( 8309): WebModule[jmxconnector]PWC1396:
    Servlet /jmxconnector threw load() exception
    java.lang.NoClassDefFoundError: javax/management/remote/message/Message
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
    at java.lang.Class.getConstructor0(Class.java:2671)
    at java.lang.Class.newInstance0(Class.java:321)
    at java.lang.Class.newInstance(Class.java:303)
    at
    org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1119)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:994)
    at
    org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4731)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:5123)
    at com.sun.webserver.connector.nsapi.WebModule.start(WebModule.java:182)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1224)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:924)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1224)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:520)
    at org.apache.catalina.startup.Embedded.start(Embedded.java:917)
    at com.sun.enterprise.web.PwcWebContainer.onStartup(PwcWebContainer.java:70)
    at
    com.sun.webserver.connector.nsapi.WebContainer.start(WebContainer.java:472)
    at com.sun.webserver.init.J2EERunner.confPostInit(J2EERunner.java:304)
    [25/Dec/2007:19:07:06] info ( 8309): HTTP3072: admin-ssl-port:
    https://sun1.mysite.com:8989 ready to accept requests
    [25/Dec/2007:19:07:06] info ( 8309): HTTP3072: admin-http-port:
    http://sun1.mysite.com:8800 ready to accept requests
    [25/Dec/2007:19:07:06] info ( 8309): CORE3274: successful server startup

    jmxremote_optional.jar has
    javax/management/remote/message/Message.class
    <server-class-path> in admin-server/config/server.xml contains path to this jar file. You may want to check if this jar file exists and has correct permissions.

  • Can not see a sbRIO in MAX running on a virtual machine

    I am trying to connect a sbRIO-9606 to a Windows 7 virtual machine (VMWare) running on a MacPro.  I can open a CMD prompt and ping the sbRIO but when I run MAX, it does not appear in Remote Systems.
    The virtual NIC is bridged to the pyhsical one (on the MAC) 
    Does anyone have experience doing this, or know why I cannot see the sbRIO?

    Hi jaketc,
    I've had similar issues at times depending on how my host and guest operating sytems network interfaces are configured.  It sounds like your settings are correct (bridged), but it is difficult to guarantee.  The first step I usually take is disable any network interfaces (on the host and guest OS) that are not critical to connecting to the remote target.
    A more generic answer is to walk through the troubleshooting steps in this document, but it won't cover the virtualized OS considerations of your setup:  
    Why Does My CompactRIO Controller or Single-Board RIO Not Show Up in Measurement & Automation Explor...
    Because you can ping the target, it sounds like the Single-Board RIO already has an IP address, you know what it is, and ethernet communication can be established.  When I've been in that situation in the past, I've been able to manually add the RIO target to MAX.  To find a system that is already configured with an IP address, simply right-click on Remote Systems and select Create New. Enter the appropriate configuration information in the dialog box, and MAX will manually place that system in the Remote Systems listing and all tasks will function properly.
    Cheers,
    Spex
    National Instruments
    To the pessimist, the glass is half empty; to the optimist, the glass is half full; to the engineer, the glass is twice as big as it needs to be...

  • HTTPS connection from portal to external webserver

    Hi,
    I am looking for a way to open a HTTPS connection from portal server to an external webserver. According to <a href="http://help.sap.com/saphelp_nw04/helpdata/en/e2/71c83edf72e16be10000000a114084/content.htm">SAP</a> the code should look like
    KeyStore keystoreCAs = ...
    SecureConnectionFactory factory = new SecureConnectionFactory(keystoreCAs, null);
    HttpURLConnection con = factory.createURLConnection("https://www.mycompany.com");
    Does not look difficult, <b>but how do I create the keystore object</b>? The keystore object should somehow be connected to the portal server's keystore which manages the certificates of trusted Certificate Authorities.
    Any ideas?
    Regards,
    Martin

    Hi,
    meanwhile I solved the problem by my own. The solution slightly simplified is given below.
    javax.naming.InitialContext ctx = new javax.naming.InitialContext();
    java.lang.Object o = ctx.lookup("keystore");          
    com.sap.engine.services.keystore.interfaces.KeystoreManagerWrapper_Stub manager = (com.sap.engine.services.keystore.interfaces.KeystoreManagerWrapper_Stub) o;
    java.security.KeyStore keystoreCAs = manager.getKeystore("TrustedCAs");     
    com.sap.security.core.server.https.SecureConnectionFactory factory = new SecureConnectionFactory(keystoreCAs, null);
    java.net.HttpURLConnection con = factory.createURLConnection("https://www.mycompany.com");
    For connecting via a proxy the host name and port number of the proxy have to be set as System properties using "https.proxyHost" and "https.proxyPort".
    java.util.Properties systemSettings = System.getProperties();
              systemSettings.put("proxySet", "true");
              systemSettings.put("https.proxyHost","192.168.0.1") ;
              systemSettings.put("https.proxyPort", "80") ;
    Additionally you have to make sure that the server's certificate is issued by a trusted Certification Authority (Must have an entry in your Keystore "TrustedCAs"). To verify this use the Visual Administrator and view service "Key Storage".
    Regards,
    Martin

  • WebServer 6.1 SP3 SSL reverse proxy to Sun One Application Server 7

    I have an application in the appserver7 that requires SSL authentication. I have already installed a self cert in the appserver7, and the authentication works fine when I browse directly to the appserver.
    The appserver7 has both listener for port 80 and 443 enabled.
    I'm currently setting up a webserver (WebServer 6.1 SP3) to act as a reverse proxy to the appserver7. The reverse proxy for the basic jsp pages found in the appserver worked fine.
    When I try to access the login page, in the appserver, in ssl mode, I am unable to do so. I then try changing the obj.conf to the following, from http to https:
    <Object name="passthrough">
    ObjectType fn="force-type" type="magnus-internal/passthrough"
    Service fn="service-passthrough" method="(GET|HEAD|POST)" servers="https://172.2
    8.48.53"
    However, it still doesn't work.
    Do I need to install a self cert in the webserver and enable the ssl listener as well?
    Do I need to install any reverse proxy addon for the appserver? Any
    setup for the obj.conf in the appserver?
    Any ideas how to get this done?
    Thanks.
    Mac.

    The Web Server 6.1 SP3 Reverse Proxy Plugin is supported, but it sounds like you're trying to do something that simply isn't possible.
    If you want the Reverse Proxy Plugin to perform SSL mutual authentication with the Application Server using the client's certificate, that's impossible due to the nature of SSL mutual authentication. If the plugin could impersonate the client, then SSL would be vulnerable to MITM (Man In The Middle Attacks). Fortunately, SSL isn't vulnerable to such attacks because the plugin doesn't know the client's private key.
    If you simply want the Reverse Proxy Plugin to pass information about the client's certificate along to the Application Server, that hapens automatically. There's nothing special to configure. Note that the plugin will not authenticate to the Application Server in this case. Rather, it will simply copy the X.509 certificate into the proprietary Proxy-auth-cert: HTTP request header.
    The application running on the Application Server can inspect the Proxy-auth-cert: header using standard Servlet APIs. Alternatively, you can use Application Server 7's auth-passthrough AuthTrans SAF to cause the contents of the Proxy-auth-cert: header to be copied to the javax.servlet.request.X509Certificate Servlet attribute.

  • ASA 5505 -Can I use outside dynamic IP for webserver DMZ?

    SETUP
    ASA 5505
    ASA Version 9.1(2)
    ASDM Version 7.1(3)
    I have basic license, using only three vlans (outside, inside, DMZ).
    QUESTION:
    I want to find a way (if possible) to use the single DYNAMIC IP (dhcp'd from ISP) on the "outside" interface, as a means to setup a web-server on the DMZ? I just want to allow my WHS-2011 (server) to talk to microsoft's free DDNS service where my domain name is hosted (ports 80,443,4125).
    So far, every setup option I have tried does not make it past the implicit deny acl's (on the outside interface) to the web-server (DMZ).
    I understand that the VLAN1 (inside) had to be disabled. I understand that objects now replace some of the older NAT'd components.
    CONFIG:
    object network webserver-external-ip
    host <X.X.X.X>
    ! I had set this to match my ISP DHCP address
    object network webserver
    host 172.16.0.2
    nat (DMZ,outside) static webserver-external-ip service tcp www www
    nat (DMZ,outside) static webserver-external-ip service tcp 443 443
    nat (DMZ,outside) static webserver-external-ip service tcp 4125 4125
    access-list outside_acl extended permit tcp any object webserver eq www
    access-list outside_acl_https extended permit tcp any object webserver eq 443
    access-list outside_acl_rww extended permit tcp any object webserver eq 4125
    access-group outside_acl in interface outside
    access-group outside_acl_https in interface outside
    access-group outside_acl_rww in interface outside
    ! added the dns statements below because the cisco doc (below) says it's required or dmz traffic can't get out despite default rule allowing it to do so.
    ! (ctrl-F) ... "all traffic would be blocked from the dmz to hosts on the internet"
    ! http://www.cisco.com/en/US/products/ps6120/products_configuration_example09186a0080bf150c.shtml
    object network dns-server
    host 8.8.8.8
    exit
    access-list dmz_acl extended permit udp any object dns-server eq domain
    access-list dmz_acl extended permit ip any any
    access-group dmz_acl in interface DMZ
    SUMMARY:
    I just want to allow my WHS-2011 (server) to talk to microsoft's free DDNS service where my domain name is hosted (ports 80,443,4125).
    I want to find a way (if possible) to use the single DYNAMIC IP (dhcp'd from ISP) on the "outside" interface, as a means to setup a web-server on the DMZ?
    Other:
    As an interim alternative, I have been able to setup & connect to the ASA using clientless vpn (web-ssl), and from there getting over to my WHS2011 server...-but the problem is, I have no way of knowing, or updating my DDNS once that IP changes since the ASA keeps blocking the return traffic to theh outside interface. My only assumption is that becasue I am using a single dynamic IP (outside interface) that it has nothing to re-direct the traffic to....???
    Thank You for any help you can provide!!
    k/r

    Hi,
    I cant really help with the DDNS portion but I would imagine you already have that sorted out.
    The ASA configurations however seem a bit off to me.
    Here is what you should configure
    STATIC PAT TO HOST SERVICES
    There are some changes that need to be done to both ACL and NAT configurations. First of the NAT configurations for each port require their own "object network" to be configured.
    Also since you are using a DHCP address from the ISP to act as the NAT address then you can use the keyword/parameter "interface" in the actual "nat" command. This basically tells the ASA that it should use whatever IP address is currently on the "outside" interface of the ASA. So you wont have to configure any separate "object network" for the public IP address every time it changes.
    Also, with regards to the ACL configurations. You should only configure one ACL per interface in the "in" direction. So all the rules you need to configure for traffic inbound from the Internet need to be in the same ACL that you then attach to the "outside" interface with the command "access-group"
    object network WEBSERVER-TCP80
    host 172.16.0.2
    nat (DMZ,outside) static interface service tcp www www
    object network WEBSERVER-TCP443
    host 172.16.0.2
    nat (DMZ,outside) static interface service tcp 443 443
    object network WEBSERVER-TCP4125
    host 172.16.0.2
    nat (DMZ,outside) static interface service tcp 4125 4125
    access-list outside_acl extended permit tcp any object WEBSERVER-TCP80 eq www
    access-list outside_acl extended permit tcp any object WEBSERVER-TCP443 eq https
    access-list outside_acl extended permit tcp any object WEBSERVER-TCP4125 eq 4125
    access-group outside_acl in interface outside
    DYNAMIC PAT FOR LANs and DMZs
    The above NAT configurations only handles the NAT for situations where the remote hosts on the Internet contact your DMZ server.
    If you want to configure Dynamic PAT for all your LAN and DMZ users which basically enable them to use the "outside" interface public IP address for Internet traffic, then you could configure this single "nat" configuration
    nat (any,outside) after-auto source dynamic any interface
    This would enable Dynamic PAT for all users behind the ASA
    I am not sure if you will run into problems since you are using a single public IP address and trying to forward TCP/443. This port is both used for SSL VPN and ASDM management of the ASA.
    If you want to change the default port of the ASDM management you can use this command
    http server enable
    If you want to change the default port of SSL VPN you can use these commands
    webvpn
    port
    Naturally before doing either of the above changes, make sure that you are not relying to them for management purposes if something was to go wrong. If you have SSH management access to the ASA then it should naturally be ok.
    I am not sure if all of the above are enough to get your setup working but it should be the basics. Naturally if there is still problems after the above suggestions it might be helpfull to see the current ASA configurations. For example NAT might not work if the ordering of NAT rules is wrong even though the actual configurations are otherwise valid.
    Hope this helps
    Please do remember to mark a reply as the correct answer if it answered your question.
    Feel free to ask more if needed
    - Jouni

  • Problem with nat / access rule for webserver in inside network asa 5505 7.2

    Hello,
    i have trouble setting up nat and access rule for webserver located in inside network.
    I have asa 5505 version 7.2 and it has to active interfaces, inside 192.168.123.0 and outside x.x.x.213
    Webserver has ip 192.168.123.11 and it needs to be accessed from outside, ip x.x.x.213.
    I have created an static nat rule with pat (as an appendix) and access rules from outside network to inside interface ip 192.168.123.11 (tcp 80) but no luck.
    What am i doing wrong?

    Command:
    packet-tracer input outside tcp 188.x.x.213 www 192.168.123.11 www detailed
    Phase: 1
    Type: FLOW-LOOKUP
    Subtype:
    Result: ALLOW
    Config:
    Additional Information:
    Found no matching flow, creating a new flow
    Phase: 2
    Type: ROUTE-LOOKUP
    Subtype: input
    Result: ALLOW
    Config:
    Additional Information:
    in   192.168.123.0   255.255.255.0   inside
    Phase: 3
    Type: ACCESS-LIST
    Subtype:
    Result: DROP
    Config:
    Implicit Rule
    Additional Information:
    Forward Flow based lookup yields rule:
    in  id=0x35418d8, priority=500, domain=permit, deny=true
        hits=1, user_data=0x6, cs_id=0x0, reverse, flags=0x0, protocol=0
        src ip=188.x.x.213, mask=255.255.255.255, port=0
        dst ip=0.0.0.0, mask=0.0.0.0, port=0
    Result:
    input-interface: outside
    input-status: up
    input-line-status: up
    output-interface: inside
    output-status: up
    output-line-status: up
    Action: drop
    Drop-reason: (acl-drop) Flow is denied by configured rule

  • How can i create link between ipad(xcode) and webserver?

    Hi, I'm a new to iPad development and i need help,
    i'm not good with english but i try to explain my question:
    how can i create link between ipad(xcode) and webserver?
    (the webserver ".NET" with driver odbc is connected with DB Oracle)
    so, how can my ipad application access to the Oracle DB?
    Create a webservice (.NET) to be place between iPad and DB, is this correct?
    how can i do it?
    which are libraries to include in the xcode's framework?
    thx

    I think the following URL will be your best answer:
    http://stackoverflow.com/questions/3510468/connecting-iphone-to-an-odbc-database

  • A Short Recipe for Creating a secure Java Webserver

    This is a short note describing how I was able to implement a Java server on a secure website. I am writing this because I hope the rest of you will be able to navigate the SSL minefield more easily than I was able to do.
    I want to thank Brad Wetmore and Sean Mullan in the Sun Microsystems Java Security group. Without their help, I would never have been successful.
    For more detailed reading, see http://java.sun.com/javase/6/docs/technotes/tools/solaris/keytool.html#EXAMPLES
    1. Generate a public/private keypair and certificate for a webserver using keytool. The name of my product is FIRMS (Fully Integrated Resort Management System). You will see "firms" a lot in what follows. Fill in your own data under the "-dname" parameter. Note that if you run keytool so that it prompts you for this information, the first thing keytool will ask you to provide is your First Name and Last Name, although this field is also referred to as the Common Name. In SSL/TLS, the Common Name is the hostname of the website you'll be setting up. It probably would have been better if keytool had prompted for "Common Name" instead of First Name and Last Name. Just keep this in mind if you go through the keytool prompts. If you use the "-dname" parameter, as I have done here, you will not have to go through keytool's prompts. Also, note that the "-dname" information I provided is for a very small business, not a larger corporation.
    keytool -genkeypair -alias firms -keyalg RSA -dname "cn=www.firmsglobal.com, ou=FIRMSGlobal, o=James Morris, l=Scottsdale, st=Arizona, c=US" -keystore foo
    2. Generate a CSR (Certificate Signing Request).
    keytool -certreq -alias firms -file firmsglobal.csr -keystore foo
    3. Send the CSR to a trusted Certificate Authority (CA). I used GoDaddy. When the CA website asks you to provide a key, open the ".csr" file, copy it, and paste it into the website text area. Be sure to copy and paste the entire ".csr" file. Depending on the CA you are using, they will ask you what kind of server you are using. In most cases, choose "other". It really doesn't matter. Be absolutely sure you save the keystore file "foo". Back it up. Whatever you do, do not modify it or delete it. Save it. Got that?
    4. Eventually the CA will provide you with one or more "reply" files ending (most likely) in ".cer" or ".crt". You might have to go into a repository to get the right "cross" files and "intermediate" files.
    5. You must import the files provided by the CA back into your original keystore file. Remember that file? That is the one you saved. Above, I called it "foo".
    6. Use the following keytool commands to import the files back into your original keystore file "foo". My CA provided me with 1 root file, 1 cross file, and 1 intermediate file, as well as my "real" certification file, which is called "www.firmsglobal.com.crt". Look again in step 1 above. Note that I used the alias "firms" to generate the public/private keypairs. You must use the same alias when you import the "real" certification reply file from the CA into the keystore file "foo". Note that I can use any alias name I wish on the first three lines below, but the fourth line is the command that will replace the self-signed certificate I generated in step 1 with the "real" certification reply file from the CA. The alias used in the fourth line must always match the alias used in step 1. Note that it might not always be necessary to perform lines one through three.
    keytool -importcert -alias root -trustcacerts -keystore foo -file valicert_class2_root.cer"
    keytool -importcert -alias cross -trustcacerts -keystore foo �file gd_cross_intermediate.cer"
    keytool -importcert -alias intermed -trustcacerts -keystore foo -file gd_intermediate.cer"
    keytool -importcert -alias firms -trustcacerts -keystore foo -file "www.firmsglobal.com.crt"
    7. Here is the Java code I use to read the keystore. The string "keystore" holds the name of the keystore file. The string "keystorepass" is a char[] that holds the keystore password. The string "keypassword" is a char[] that holds the private key password. I might have these two passwords reversed. I used the same password for the keystore and the private key, but this is not recommended.
    try {
          KeyStore ks = KeyStore.getInstance("JKS");
          ks.load(new FileInputStream(keystore), keystorepass);
          KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
          kmf.init(ks, keypassword);
          SSLContext sslcontext = SSLContext.getInstance("SSLv3");
          sslcontext.init(kmf.getKeyManagers(), null, null);
          SSLServerSocketFactory ssf = sslcontext.getServerSocketFactory();
          sslServerSocket = (SSLServerSocket) ssf.createServerSocket(securePortNumber);
    } catch (Exception e) {
          handleSocketException(e,"Server cannot listen on port ",securePortNumber);
    };

    Whenever the user selects a file, you can call the setCurrentDirectory method on the JFileChooser, with the getParentFile() method to return the directory of the selected file.
    For example :
    JFileChooser chooser = new JFileChooser();
    if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
       File f = chooser.getSelectedFile();
       if (f.isFile()) {
           chooser.setCurrentDirectory(f.getParentFile());

  • How to writing an image from my applet to my apache webserver

    hi everyone,
    i have a big problem, writing an image from my applet to my apache
    webserver. i tried three way's of writing that file. every way was
    described in forums to solve this problem, but non of them worked and
    i don't know why. i'll give you the code of my writing-methods and
    describe, what happen when i test them, in order someone of you can
    give me an usefull tip, where the problem is.
    as inputparameter i give my method a new URL referring to
    http://localhost/test.jpg (this is the same directory, where my applet
    is loaded from, so i should have reading and writing permission,
    havn't i? while i'm developing, my applet runs on the same pc as my
    webserver, just in case you're wondering about localhost) and a
    selfmade BufferedImage (i already testet if it is not null and shows
    the correct things ... all ok).
    1. try:
    private void writeImageToServer(URL fileURL,BufferedImage img){
    try {
    URLConnection urlConnection = fileURL.openConnection();
    urlConnection.setDoOutput(true);
    OutputStream urlout = urlConnection.getOutputStream();
    BufferedOutputStream out = new BufferedOutputStream(urlout);
    ImageIO.write(img,"jpg",out);
    out.close(); // i also tried without this line -> same result
    // additionally a question: do i need
    out.close()?
    catch( IOException e ){
    e.printStackTrace();
    result:
    test.jpg doesn't appear in the webroot. but some very strange messages
    in the error.log of my apacheserver:
    [Tue Jun 08 11:40:22 2004] [error] [client 127.0.0.1] File does not
    exist: c:/programme/apache
    group/apache/htdocs/meta-inf/services/javax.imageio.spi.ImageOutputStreamSpi
    [Tue Jun 08 11:40:22 2004] [error] [client 127.0.0.1] File does not
    exist: c:/programme/apache
    group/apache/htdocs/meta-inf/services/javax.imageio.spi.ImageReaderSpi
    [Tue Jun 08 11:40:22 2004] [error] [client 127.0.0.1] File does not
    exist: c:/programme/apache
    group/apache/htdocs/meta-inf/services/javax.imageio.spi.ImageInputStreamSpi
    [Tue Jun 08 11:40:22 2004] [error] [client 127.0.0.1] File does not
    exist: c:/programme/apache
    group/apache/htdocs/meta-inf/services/javax.imageio.spi.ImageWriterSpi
    [Tue Jun 08 11:40:22 2004] [error] [client 127.0.0.1] File does not
    exist: c:/programme/apache
    group/apache/htdocs/meta-inf/services/javax.imageio.spi.ImageTranscoderSpi
    i cannot explain this lines to myself, because my apache should have
    nothing to do with java. all my javacode is executed on the client
    side in the browser. do this messages mean i have to add the ImageIO
    package from the sdk to my jar-applet. the jre, used by my iexplorer,
    doesn't contain this files in the meta-inf/services directory of
    rt.jar, but that's version 1.4.2_03, the same as my sdk, and the
    rt.jar contains the corresponding classfiles at javax.imageio.spi. so
    i'm realy confused by this messages.
    2. try:
    private void writeImageToServer(URL fileURL,BufferedImage img){
    try {
    URLConnection urlConnection = fileURL.openConnection();
    urlConnection.setDoOutput(true);
    OutputStream urlout = urlConnection.getOutputStream();
    BufferedOutputStream out = new BufferedOutputStream(urlout);
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    encoder.encode(img);
    out.close(); // same comments as above
    catch( IOException e ){
    e.printStackTrace();
    result:
    nothing. no error-messages in the error.log, no exceptions in the
    java-console and no test.jpg in the webroot. i searched my whole
    harddrives for it: nothing. isn't this the way, the JPEGImageEncoder
    works?
    3. try:
    private void writeImageToServer(URL fileURL,BufferedImage img){
    try {
    File file = new File(fileURL.toString);
    file.createNewFile();
    BufferedOutputStream out = new BufferedOutputStream(new
    FileOutputStream(file));
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
    encoder.encode(img);
    out.close(); // same comments as above
    catch( Exception e ){
    e.printStackTrace();
    result:
    the SecurityManager denies this action with "access denied" while
    calling createNewFile(). well, this way was dedicated to run from an
    application, not from an applet. i'd have to sign my applet to get the
    rights to do this, or i can edit java.policy on my client, what i
    don't want, because i cannot do this on every client, the applet will
    run, when i'm finished with it. this brings me to the question: does
    anybody know's how to sign my applet and give it full access to the
    harddrive and the webserver without paying 400$ to VeriSign for a
    commercial CA? i want to do this by myself, without paying anything
    and without giving a lot of information to another company.
    i would realy appreciate, if someone could give me a hint where i am
    wrong or how to do this correct.
    thank you very much
    [email protected]

    You hold several misconceptions. The first is that an applet can write to a server without help from the server. That will never work on a real server (though it might work in testing, if the server is on the same PC as the applet). Applets cannot get a File object that points to any place on the server.
    If you write a servlet designed for accepting image uploads, the applet can communicate back to that servlet and feed it the bytes of the image. There are other technologies that can replace the servlet, of course (PHP, ASP..) but I mention that because you say you are running Apache - and that is very Java oriented.
    For more help on servlets, try the [Web Tier APIs - Java Servlet|http://forums.sun.com/forum.jspa?forumID=33] forum.

  • Need to run RemoteDesktop from JSP file, WebServer Running in Linux.

    Hi All,
    i want to run a RemoteDesktop(.RDP) from a JSP page, webserver is running on Linux.
    Like i am having abc.rdp file, when i am invoking this file from the jsp, it is displaying the content of the abc.rdp file.
    instead of that i am using MIME, following is the snippet i am using.....
    String filepath=path+objId+".rdp";
    FileInputStream fis = new FileInputStream(filepath);
    System.out.println("     filepath               "+filepath);
    byte[] bytes = new byte[fis.available()];
    response.setContentLength(bytes.length);
    fis.read(bytes,0,bytes.length);
    javax.servlet.ServletOutputStream Pout = response.getOutputStream();
    //String string = new String(bytes);
    //Pout.println(string);
    Pout.println(bytes);
    Pout.flush();
    Pout.close();
    fis.close();
    the above code is asking me to save the .rdp file. But i want to run the .rdp file directly without asking me saving option.
    Your Views and Suggestions are valuble to me....
    Thanks
    Chiranjeevi.

    you need to configure the web browser to associate that particular file type with the appropriate action

  • How to configure webserver plugin for IIS to fwd request to multiple server

    Hi,
    Have configured Sun One webserver plugin for IIS is configured as per the documentation - http://docs.sun.com/source/816-7156-10/agplugin.html
    Have a requirement to forward the request to three different servers
    Eg : http://www.host1.com/app1
    http://www.host2.com/app2
    http://www.host3.com/app3
    Getting bad gateway error when this is configured in sun-passthrough.properties file
    serverpool1.server=http://www.host1.com
    serverpool1.passthrough=/app1
    serverpool2.server=http://www.host2.com/
    serverpool2.passthrough=/app2
    Is this configuration wrong?
    Thanks

    First, set the user back to www or whatever it was. To do namebased virtual hosting, you'll need to change two things. The first is to add a NameVirtualHost directive to /etc/httpd/sites/virtualhostglobal.conf
    This is one of the VirtualHost stanzas from my Linux box, you just have to adjust the paths for your machine:
    <VirtualHost www.mydomain.com>
    ServerAlias mydomain.com
    ServerAdmin [email protected]
    DocumentRoot /usr/people/httpd/html/www
    <Directory /usr/people/httpd/html/www>
    Options Includes
    AllowOverride AuthConfig
    </Directory>
    ScriptAlias /bin /usr/people/httpd/cgi-bin/www
    ScriptAlias /cgi-bin /usr/people/httpd/cgi-bin/www
    </VirtualHost>
    Restart Apache and you should be good to go. If there are errors, could you post them from /var/log/httpd/error_log ?
    Roger

  • How can I transfer the e-mails that I have sent from my OUTBOX in a webserver to Thunderbird?

    I have an e-mail account in a webserver (STRATO Communicator), and I want to transfer all my e-mails to Thunderbird.
    I have installed Thunderbird, and I have managed to transfer all the e-mails from my INBOX from the webserver to Thunderbird.
    However, I do not know how I can also transfer all the e-mails that I have sent from my OUTBOX in the webserver (STRATO Communicator) to Thunderbird as well.
    Can anyone help me? Thank you very much in advance!

    Pop mail accounts can only access the Inbox on the server.
    So if you are using a Pop mail account then there is a workaround.
    In Thunderbird
    Move all emails out of Inbox into other suitable folders for organising.
    This makes it easy to detect the 'outbox' emails.
    Logon to webmail account and move all emails from Outbox to Inbox
    then in Thunderbird use Get Messages to download those emails.
    You can then move those emails into a suitable folder like 'Sent'.
    Please note than in Thunderbird, the account Sent folder keeps a record of what was sent by you.
    The 'Outbox' located in Local Folders, is the Outbox for all mail accounts in Thunderbird. It is not a place to store emails.
    In Thunderbird, when you select 'Send', it sends email immediately and puts copy in 'Sent' folder. However, if you use 'Send Later', it puts email in 'Outbox' ready to go when you select 'Send unsent messages', at which point copies are stored in 'Sent' folder and removed from 'Outbox'.

  • Creating a Listener on Another Machine (WebServer)

    Hi,
    How can I create a listener on a server without a database installed ?
    I have a server (name: webserver) with an Internet IP Address (ex: 141.146.8.66) and a domain (ex: www.oracle.com). On another server on my LAN (name: dbserver) I have a database server with Oracle 8i installed and a listener on it. I have a database (db01) on dbserver.
    On my machine I have a tnsnames service configured pointing to the listener on dbserver. So I can connect to db01 using:
    conn scott/tiger@db01
    I want to create a listener on my webserver pointing to db01. So I can alter tnsnames pointing to www.oracle.com or 141.146.8.66 an thus connect from any machine with Internet Connection to my oracle database.
    Is it possible ? How can I do this ?
    Thanks.

    You would need to install Oracle Connection Manager on the web server machine and configure that to proxy connections to the database server. The Net Services Administrator's Guide has a diagram of this architecture http://download-west.oracle.com/docs/cd/B10501_01/network.920/a96580/intro.htm#444468
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

Maybe you are looking for

  • Cannot delete file: The operation can't be completed because the item "DataReferences" is in use.

    I have a My Book TB Drive where all of my Time Machine backups go to. I decided to delete some older version of backups. They ended up in my trash can. When I deleted the items in my trash can, all of them erased with the exception of one file. This

  • How can I export a Keynote presentation to a text file?

    I am using Keynote to teach a course at university. One of the students is visually impaired and requires a text version of the presentation for use with his reading software. What's the easiest way to get my presentation into a text format for him?

  • Problem with concatenation, need output in a desired format

    Hi all, I have a weird problem with concatenation. I should get an output in such a way that the result would be Put C:\TEMP\test20090210.xml /FOLDER1/test20090210.xml For this first to get C:\TEMP\test20090210.xml format I said CONCATENATE  'C:\TEMP

  • Product categories for registration

    Dear all, We are going live with the Supplier registered next week. At standard, the 'self registration form' displays the categories short description under the question: "Which Product Categories can you Deliver?" Does anyone know how to change it

  • Cannot be converted in type DEC,CURR - longtext

    Dear, When we are loading the data to the targets, we are getting the errors in the Transfer rules like mentioned bellow Info source 0EC_CS_1 (Transaction Data for Consolidation) Status (tab) : Technical : Collection in source system ended Processing