Live Connect and Java

Hi All,
I am a student working on my thesis which is is a Firefox exntension in which users can annotate(i.e. highlight) web content on any web site. I am using Liveconnect to connect javascript and java. All my methods work well, however I noticed an issue that crops up when I create a new instance of something.
The error I get is in the Java console:
Ignored exception: java.security.PrivilegedActionException: java.lang.reflect.InvocationTargetException
the above only occurs for example:
In my jar file I created a method to send an email:
Part of the method contains the following:
public static void main(String[] args) {
       smtp.connect();
       // login using gmail account details
       smtp.login(username,password);
       // create new email message
       EmailMessage message = new EmailMessage();
       message.setTo(to);
       message.setFrom(username);
} If I comment out EmailMessage message = new EmailMessage() everything works fine, however if not, nothing in the jar file seems to work.
could you please shed some light on this?
It is pretty urgent and any input is greatly appreciated
Kind regards
Chris

What is the best way to connect a Java application to
a remote MySQL server?JDBC.
I've tried JDBC already. It works great when the
MySQL server is running on the same machine that the
application is running on. However, when I specify
the IP and port of the remote database, I can't
connect.This usually happens because you haven't configured the security properly, or haven't understood how MySQL security works. It could be something else, though, based on the details you provided.
I suppose I could have specified the wrong port. How
can I get the port which the server is running on?Ask the person who set up the server. Or run netstat on the server if it's an orphaned system.
If I am able to do this connection, are there any
major security risks? Is there a better way to link
an application to a remote database?Security risks? For the server or your program?

Similar Messages

  • Problem w/ a dialup connection and Java web site sessions timing out.

    Anytime a web site that uses a Java in a pop up box times out, the longer the time afterwards that there is no user response the worse the problems get.
    The page freezes, then the browser, it can't be closed w/o using task manager,
    The dialup adapter freezes (cant be disconnected).
    It doesn't seem to happen with a broadband connection.
    I have tried XP Pro w/sp2, XP Pro w/sp1a, 2000 w/ sp4 and all have the same problem.
    I have tried a different hardware modem (orginal is a software modem) and the same thing.
    I have tried older versions of Java, but the same. thing.
    This happens on two different boxes (motherboards).
    The sites involved are Yahoo card games chat sessions & Ameriatrade stock quotes sessions. The ISP is Earthlink.
    Normal surfing is unaffected. This happens with Firefox & Opera and I believe Idiot Exploiter (whichisn't used).
    One box is a Dell/Wintel and w/ the orginal setup (XP Home modified by Dell), worked w/ no issues. Dell says Java V1.5 was used (which I tried). I don't thik it is a O/S issue.
    Regarding older versions of Java, anyone suggest one that doesn't have these issues??
    BTW, no viruses and these were all fresh installs w/ the latest drivers.

    In a thread about problems with Yahoo, someone noticed that your session can prematurely time out if you have set proxy to auto-detect here:
    orange Firefox button ''or'' classic Tools menu > Options > Advanced > Network > "Settings" button
    Could you test with the setting on No proxy or Use system proxy settings and see whether it helps?

  • Doubts about HTTPS requests and Java proxy

    Hello,
    I need help about SSL connections and Java.
    I'm developing a HTTP/S proxy with Java. To test my proxy, I use Firefox. I configure the proxy option in the browser. The proxy works good with HTTP requests, but with HTTPS requests doesn't work and I don't know why.
    I explain the steps that I do for a HTTPS request:
    * The browser sends a CONNECT message to the proxy.
    I check that the proxy receives the CONNECT request correctly.
    * The proxy establish a secure connection with the content server.
    I use an SSLSocket to connect with my content server, and the SSL handshake is succesful.
    * The proxy sends a 200 HTTP response to the client:
    I send
    HTTP/1.0 200 Connection established[CRLF]
    [CRLF]
    to the application client (Firefox)
    * The proxy sends/receive data to/from Firefox/content server
    I have a Socket between Firefox and my proxy, and a SSLSocket between my proxy and my content server. I use two threads to communicate the client and the server.
    Java code:
    //Thead server-->proxy-->application(Firefox)
    ThreadComm tpa = new ThreadComm(bis_serverSSL, bos_app);
    //Thread application(Firefox)-->proxy-->server
    ThreadComm tap = new ThreadComm(bis_app, bos_serverSSL);
    The "tpa" thread reads from the SSLSocket between the proxy and the server and sends data to the Socket between the proxy and Firefox.
    The "tap" thread reads from the Socket between the proxy and Firefox and sends data to the SSLSocket between the proxy and the server.
    This is the class ThreadComm:
    public class ThreadComm extends Thread{
        private BufferedInputStream bis = null;
        private BufferedOutputStream bos = null;
        public ThreadComm(BufferedInputStream bis, BufferedOutputStream bos) {
            this.bis = bis;
            this.bos = bos;
        @Override
        public void run() {
            int b = -1;
            FileOutputStream fos = null;
              do {
                   try {
                        b = bis.read();
                        System.out.print((char) b);
                        fos.write(b);
                        bos.write(b);
                        bos.flush();
                   } catch (Exception ex) {
                        Logger.getLogger(ThreadAplicacionProxy.class.getName()).log(Level.SEVERE, null, ex);
                        //b=-1;
              } while (b != -1);
        }But this doesn't work and I don't know why.      
    I have an Apache server with the mod_ssl enabled as content server, I can send requests (with Firefox) to the port 80(HTTP request) and 443(HTTPS request) without use my proxy and it works. If I use my proxy, HTTP request works but with HTTPS request doesn't work, I look the log of Apache and I see:
    [Tue Apr 27 17:32:03 2010] [info] Initial (No.1) HTTPS request received for child 62 (server localhost:443)
    [Tue Apr 27 17:32:03 2010] [error] [client 127.0.0.1] Invalid method in request \x80\x7f\x01\x03\x01
    [Tue Apr 27 17:32:03 2010] [debug] ssl_engine_kernel.c(1770): OpenSSL: Write: SSL negotiation finished successfully
    [Tue Apr 27 17:32:03 2010] [info] [client 127.0.0.1] Connection closed to child 62 with standard shutdown (server localhost:443)
    Why it say? Invalid method in request \x80\x7f\x01\x03\x01 , my proxy sends the data that the Firefox sends.
    I think than I have follow the explanations of [1] but doesn't work, I have problems in implementation in Java but I don't know where.
    I appreciate any suggestions.
    Thanks for your time.
    [1] http://www.web-cache.com/Writings/Internet-Drafts/draft-luotonen-web-proxy-tunneling-01.txt

    ejp, I have checked the socket between the proxy and server and ... You are right! , I was using the port 80 instead of the 443 (incredible mistake!, I'm sorry). I was convinced that I was using the port 443... Well, is a little step, but I still have not won the war :)
    If I see the log files of Apache, We can see that something goes wrong.
    localhost-access.log
    >
    127.0.0.1 - - [04/May/2010:17:44:48 +0200] "\x 80\x 7f\x01\x03\x01" 501 219
    >
    localhost-error.log
    >
    [Tue May 04 17:44:48 2010] [info] Initial (No.1) HTTPS request received for child 63 (server localhost:443)
    [Tue May 04 17:44:48 2010] [error] [client 127.0.0.1] Invalid method in request \x80\x7f\x01\x03\x01
    [Tue May 04 17:44:48 2010] [debug] ssl_engine_kernel.c(1770): OpenSSL: Write: SSL negotiation finished successfully
    [Tue May 04 17:44:48 2010] [info] [client 127.0.0.1] Connection closed to child 63 with standard shutdown (server localhost:443)
    >
    I think that this happens because Apache receives the data without decrypt, this is the reason because in the log we can see the "Invalid method in request \x80\x7f\x01\x03\x01". This supposition is true?
    ejp, you say that the "Termination is quite tricky." I have changed my code following yours suggestions (using the join and the shutdownOutput) but the threads don't die.
    I explain you what I do:
    (in time 1)
    I launch the thread (threadFirefoxToApache) that reads data from Firefox and sends to Apache.
    I launch the thread (threadApacheToFirefox) that reads data from Apache and sends to Firefox.
    (in time 2)
    threadFirefoxToApache sends the firts data to the server.
    threadApacheToFirefox is waiting that the server says something.
    (in time 3)
    threadFirefoxToApache is waiting that Firefox says something.
    threadApacheToFirefox sends data to Firefox.
    (in time 4)
    threadFirefoxToApache is waiting that Firefox says something.
    threadApacheToFirefox is waiting that Firefox says something.
    and they are waiting... and never finish.
    In time 2, these first data are encrypted. The server receives these data and It doesn't understand. In time 3, the server sends a HTTP response "501 Method Not Implemented", here there is a problem because this data must be encrypt. According to the documentation that I read, the proxy cannot "understand" this data but I can "understand" this data. What's happen?
    Firefox encrypt the data and send to the proxy. This It's correct.
    The proxy encrypt the data another time, because I use the SSLSocket to send the data to the server. Then the server receives the data encrypted two times, when decrypt the data gets the data encrypted one time. And this is the reason why the server doesn't understand the data that sends Firefox. It's correct? May be.
    Then If I want that the server receives the data encrypted one time I need to use the socketToServer, It's correct?
    I will supposed that yes. If I use the socketToServer, the proxy doesn't understand nothing, because the data received from the socketToServer are encrypted (I only see simbols), but the Apache log says that there is a problem with the version? (If I use the socketToServer the threads die)
    >
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1760): OpenSSL: Loop: SSLv3 read finished A
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1760): OpenSSL: Loop: SSLv3 write change cipher spec A
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1760): OpenSSL: Loop: SSLv3 write finished A
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1760): OpenSSL: Loop: SSLv3 flush data
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1756): OpenSSL: Handshake: done
    [Tue May 04 19:55:42 2010] [info] Connection: Client IP: 127.0.0.1, Protocol: TLSv1, Cipher: RC4-MD5 (128/128 bits)
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_io.c(1817): OpenSSL: read 5/5 bytes from BIO#29bd910 [mem: 29ea0a8] (BIO dump follows)
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_io.c(1750): -------------------------------------------------------------------------
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_io.c(1789): | 0000: 80 7f 01 03 .... |
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_io.c(1793): | 0005 - <SPACES/NULS>
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_io.c(1795): ------------------------------------------------------------------------
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1770): OpenSSL: Write: SSL negotiation finished successfully
    [Tue May 04 19:55:42 2010] [info] [client 127.0.0.1] SSL library error 1 reading data
    [Tue May 04 19:55:42 2010] [info] SSL Library Error: 336130315 error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
    [Tue May 04 19:55:42 2010] [debug] ssl_engine_kernel.c(1770): OpenSSL: Write: SSL negotiation finished successfully
    [Tue May 04 19:55:42 2010] [info] [client 127.0.0.1] Connection closed to child 63 with standard shutdown (server localhost:443)
    >
    What option is the correct? I need use the SSLSocketToServer or socketToServer to send/read the data to/from the server?. Use the SSLSocket has sense because the data travel in a secure socket, but use the Socket also has sense because the data are encrypted and they are protected by this encription. It's complicated...

  • HeLp!!! The earlier version of Fifefox supports "Live Connect" but the 3.6 doesn't. I need to downgrade my FireFox to an earlier version for my online classes. I'm desperate because I was supose to start class 10 days ago and cant. Please, help....

    I looked in Firefox properties to find what I Firefox i am using and it shows the following:
    The Firefox File version is: 1.9.2.3951
    The File Name is: 1.9.2.12
    The Product Version is: 3.6.12
    My problem is this: The company I work for "Prudential R.E." has online training courses. I can't access it because I get the following message: "You cannot play the learn 2 course content with this version of netscape" because it has no live connect support"
    The training center for Prudential told me this: ""Currently the LearnCenter does not support Firefox 3.6 but does support the
    earlier versions and this could be the issue.""
    How do I get the earlier version of Firefox?
    And if I can get the earlier version of Firefox. "How do I fix this problem? Do I uninstall all of Firefox and then reinstall the earlier version if I can get access to a download of it somewhere?
    Please Help...
    Thanks

    It seems you need to update Java on your computer.
    See this
    https://jdk6.dev.java.net/plugin2/#LIVECONNECT
    You should be able to do that from the Windows control panel

  • XBOX ONE. I have the xbox one and the airport time capsule and cant connect to most xbox live games and zero parties. I have 0 experience in all this but somehow was able to change NAT to open but still wont connect. HELLLPPPP

    Okay folks, I need your help out there.
    So the nerdy side of me went and picked up the XBOX ONE on release day. Its awesome by the way, BUT..... I cant seem to connect to most xbox live games and absolutely ZERO parties. At first I just thought it was something to do with the xbox itself and would eventually fix itself, but i was wrong. After looking into it on microsoft, i found out that it had to do with my NAT settings on the airport itself. I guess apple and xbox are not compatiable for xbox live and it makes it difficult to have an open NAT setting and is a huge PAIN.
    I was able to pinpoint one that the airport time capsule was blocking the IPV6 something or another. Anyways, I unblocked that, and reset the modem and time capsule and jumped on the xbox and now have open NAT settings but still cant connect to multi-player.
    Upon further searching, i was told to uncheck the UPNP on my time capsule as well, but have no idea how to find that.
    I know it seems confusing, but thats the best i can describe it.
    tthanks all

    Be a long long time before I see an Xbox One.. but whoever told you to uncheck the upnp in the TC.. tell them their dreamin' .. upnp is not support by Apple in any computer or router, never has been.. Apple deliberately wrote their own version called NAT-PMP to do the same thing.. dynamically open ports at the request of an application or client computer.
    So there is nothing like that to uncheck.. and as a matter of interest.. there no box to check or uncheck for NAT-PMP either.. since apple do not believe in end user adjustment of settings.. they simply do not exist.
    You will have to manually forward all ports required by the Xbox via the TC. For multi-player games you probably need to open more ports than the standard to allow just xbox live. You will need to check the ports required and open them.
    OR
    Buy a standard vista UPNP compatible router.. and use that.. and simply put the TC in bridge in the network.
    I have not seen posts yet about xbox one.. but there are plenty about xbox and ps3 and the fact that Apple really doesn't give a hoot about games consoles.
    This is a good basic post for older xbox.
    https://discussions.apple.com/thread/5385065?tstart=0

  • Errror in RFC connection between SCM ABAP stack and JAVA Stack

    Hi All
    we have installed SCM Abap stack and SCM java stack on same system within single database.when i create rfc connection AI_RUNTIME_JCOSERVER from SCM Java stack to SCM Abap Stack its working fine,but when i am configuring same from SCM Abap to SCM Java using SM59 its giving error.
    Error Details     Error when opening an RFC connection
    Error Details     ERROR: failed to open file G:\usr\sap\SCD\DVEBMGS00\data\sideinfo.DAT
    Error Details     LOCATION: SAP-Gateway on host OPS20SCD1.Octal.pet / sapgw00
    Error Details     CALL: fopen
    Error Details     COMPONENT: SAP-GW-LIB (ReadSideInfo)
    Error Details     COUNTER: 1854
    Error Details     ERROR NUMBER: 2
    Error Details     ERROR TEXT: ENOENT: No such file or directory OR: The system cannot find the fi*
    Error Details     MODULE: gwxxside.c
    Error Details     LINE: 274
    Error Details     RETURN CODE: 451
    Error Details     SUBRC: 0
    Error Details     RELEASE: 701
    Is it compulsory to create RFC connection between abap and java installed on the same system.
    plese suggest.
    Regards

    to configure acceptance of the ABAP (integrated ITS / WebGUI) saplogonticket on the java stack, just log into the java stack (http://FQDN:50xxx/nwa) and select configuration  THe last item in the list is Trusted System... click.
    on the ensuing page, click on the add trusted system button --> by querying trusted sytem.
    Enter the required data on the page:
    system type: ABAP
    host name: FQDN
    System Nr: your instance number
    client (of the productive client)
    and a username and pw with superuser priveliges in the system (SAP_ALL/SAP_NEW, etc).
    the click next
    On the final screen, click finish.
    You have now SSO setup between the ABAP and Java stacks. To configure SSO to accept java saplogontickets on ABAP see:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2b0310d6-0801-0010-3185-b2371a280372
    This should resolve your question.

  • Direct Connection ABAP Proxy and Java Proxy possible ????

    Hi Folks ,
    As i read as direct connection possible between 2 SAP systems only ..
    and also i read as WS Direct Connection u2013 (Java) ..
    What it means ?? is it ABAP Proxy to Java Proxy using Direct connection ??  Like Java Client Proxy and ABAP Server proxy
    I am not clear on this.. Could you please explain or help me on this . ??
    Siva..

    Hi ,
    +You can do both for java proxies as well Abap proxies.+
    As per the following points
    1. Point-to-point connection is a new capability available with SAP NW PI 7.1. It allows applications or systems to send messages using WS-RM without going through a middleware, e.g. PI, but still using a centralized tool to design and
    configure the interfaces and connection properties.
    2. SAP XI 3.0/PI 7.00 or higher releases can be licensed based on the total volume of messages in
    gigabytes (GB) that is processed per month. The size of the payload is determined in the integration
    server. The information is then aggregated according to sender and receiver system.
    Question :
    1. If Message exchange between 2 SAP applications using direct connection .. Then dont we need to consider about licencing cost for volume of messages per month ?
    2. So if i use ABAP Client Proxy to Java Server proxy  scenario.. can i use direct connection  ? Eg., SAP ECC to java application ?
    In both the cases PI Runtime is not required  .. Am i right ?
    Please clarify..
    Siva..

  • Error while creating connection between Java and ABAP

    Experts
    I am getting the following error message when I am trying to test the connection between JAVA and ABAP systems.
    1. The system ID is valid
    2. The system was retrieved.
    3. The system object represents an SAP system
    4. The following parameters are valid: Web AS Protocol (http) Web AS Host Name (s09f71v06.svr.bankone.net:8100)
    5. The host name s09f71v06.svr.bankone.net was resolved successfully.
    6. The server s09f71v06.svr.bankone.net *could not be pinged* successfully.
    I have JAVA and ABAP on the same system. I am trying to establish a connection. I have checked all the settings and they looks fine. I have also pinged from other system to this server and the Ping works fine.
    Please do let m eknow where do I need to check for the errros or logs for the above error message.
    Appreciate your quick help.
    Mahesh

    Check the relevant services are test are active on the Backend system through SICF trransaction.
    Also make sure that default icm services are running.See note 517484.
    More important the connector test in the portal system should work properly,recheck the WAS path etc are correct.
    Regards
    Ajay

  • JCo connection between java and ABAP

    Hi,
    Any pointers for some good material on establishing JCo connection between ABAP and Java to execute ABAP FMs.
    Thanks and Regards
    Arpita Saxena

    Please find following link for your reference.
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/85a483cb-0d01-0010-2990-c5168f01ce8a?quicklink=index&overridelayout=true]

  • Testing SSL Connections, differences between ABAP and JAVA stacks

    Hello,
       I am trying to test an outbound SSL connection to a partner.   I already have multiple outbound connections to many partners, but this new one is causing an issue.   Our firewalls between the two sites are opened as required, I verified that I can telnet to the 443 port of their sever.   I then attempted to connect to their URL, via a Java SOAP message, and it is rejected.  Some kind of error regarding our handshake.
       In an attempt to troubleshoot the issue I entered their URL in SM59 as a HTTPS connection, tested it, it worked fine.   Which indicates to me that the ABAP side works fine.
       I do the same on the Java stack, via the SOA Manager: Destinations, and it fails.
    "Error during ping operation: Error while silently connecting org.w3c.www.protocol.http.Http.Eception: Peer sent alert: Alert Fatal: unexpected message"
      I was thinking that maybe the remote partner only allows specific types of SSL version connection, and the Java side is too low.  i.e. the partner only allows TLS v1, and we are attempting to use SSL v2.    Is there a place to set this on the Java side?  I know I can set inbound parameters on ICM via SMICM.
      Any help or assistance would be most appreciated.
    Thanks,
    Michael Montone

    Hi,
    I suggest that you verify if you use the same release of the SAP Cryptolib  for the ABAP and the Java stack.
    This could explain a difference of support for SSL or TLS.
    Regards,
    Olivier

  • How to connect separated ABAP and Java stacks ?

    Hi,
    I have installed two separate ABAP and Java Stacks and trying to connect both the stacks together.
    As per my understanding, only JCO RFC is the mean of communication between ABAP and Java stacks.
    But still even after configuring the JCO RFC successfully, I am unable to view, configure or control 
    J2EE stack's status from smicm (ABAP).
    Would you please suggest me, if there is any more configuration to be done on abap or Java stack side.
    Thanks,
    Cheers !!!
    Ashish

    Hi Sunny,
    JCO RFC is tested and it is working fine. So no issues from JCO RFC side. Hope you would have read carefully.
    >
    Ashish Mishra wrote:
    >  But still even after configuring the JCO RFC successfully, I am unable to view, configure or control 
    > J2EE stack's status from smicm (ABAP).

    ========================================================
    Hi Anil ,
    Thanks for your reply. but
    >
    Ashish Mishra wrote:
    >
    > I have installed two separate ABAP and Java Stacks and trying to connect both the stacks together.

    Hope I am able to clear your doubt. Java is completely separated stack and not add-on.
    Suggest me how can I proceed further on this connectivity.
    =========================================================
    Hi Olivier,
    I am grateful to you for your reply. I understood your point but now except a successful JCO RFC test,
    is there any mean to check and ensure that both the stacks are connected properly and ready to use.
    Regards,
    Ashish

  • Java.lang.NullPointerException when using DataSource connection and executing CallableStatement

    Hi Guys
    I am having some problem as I am using a DataSource for connections and randomly
    the CallableStatements and PreparedStatements created from this DataSource becomes
    null and everytime I get NullPointerException with this message.
    java.sql.SQLException: java.lang.NullPointerException
         at weblogic.jdbc.rmi.SerialPreparedStatement.setString(SerialPreparedStatement.java:210)
         at .........
    Help will be appreciated..

    Hi Guys
    I am having some problem as I am using a DataSource for connections and randomly
    the CallableStatements and PreparedStatements created from this DataSource becomes
    null and everytime I get NullPointerException with this message.
    java.sql.SQLException: java.lang.NullPointerException
         at weblogic.jdbc.rmi.SerialPreparedStatement.setString(SerialPreparedStatement.java:210)
         at .........
    Help will be appreciated..

  • Socket connection between Java and C

    I want to establish socket connection between Java client and C server (on Unix). Can anybody tell how to do it? Will the socket created in client be available in server. I tried out but there was no response from the server.

    We too can't connect the daemon server written by "c". The phenomena is below.
    << Execution of this Question1.class >> ---------------------------------------
    [kazuyuki@CryptOne tmp]$ java Question1 E 1.2.3.4 MFrame.java 195.211.1.1 15021
    << Output message >> ----------------------------------------------------------
    Quetion1 : flg_ = E
    Quetion1 : key_ = 1.2.3.4
    Quetion1 : fn_ = MFrame.java
    Quetion1 : adr_ = CryptOne.localhost/195.211.1.1
    Quetion1 : port_ = 15021
    java.net.ConnectException: Connection refused
         at java.net.PlainSocketImpl.socketConnect(Native Method)
         at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:350)
         at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:137)
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:124)
         at java.net.Socket.<init>(Socket.java:268)
         at java.net.Socket.<init>(Socket.java:122)
         at Question1.UPLOAD(Question1.java:65)
         at Question1.main(Question1.java:155)
    << Question >> ----------------------------------------------------------------
    Why the event "java.net.ConnectException: Connection refused" has occured ?
    The server to connect from Question1 can accept the connection request from
    the client program coded by "c" program. We have written down the daemon server
    program by "c" code tcp/ip socket functions (socket, bind, listen, accept).
    Security manager admits the access from this Question1.class, we have checked.
    Would you like please answer this Connction refuse occurrence ?
                                                                     2002.05.18 11:50:00.0(JST)
                                                                     K.Masuda
    << Java client code>> -------------------------------------------------
         (c)Copyright     All rights reserved.
              K.Masuda     2002.05.18
                   << Question1.java >>
    import     java.lang.String;
    import     java.io.InputStream;
    import     java.io.OutputStream;
    import     java.io.DataInputStream;
    import     java.io.DataOutputStream;
    import     java.io.FileInputStream;
    import     java.io.FileOutputStream;
    import     java.io.IOException;
    import     java.io.FileNotFoundException;
    import     java.net.Socket;
    import     java.net.InetAddress;
    import     java.net.UnknownHostException;
    import     java.net.ConnectException;
    import     java.net.NoRouteToHostException;
    class Question1 {
         char               flg_;
         String               key_;
         String               fn_;
         InetAddress          adr_;
         int                    port_;
         Socket               sock_;
         Question1(
              char          flg,
              String          key,
              String          fn,
              String          adr,
              int               port
              flg_     = flg;     
              key_     = key;
              fn_          = fn;
              try{
                   adr_     = InetAddress.getByName( adr );
              catch( UnknownHostException e ){
                   e.printStackTrace();
              port_     = port;
    System.out.println( "Quetion1 : flg_ = " + flg_ );
    System.out.println( "Quetion1 : key_ = " + key_ );
    System.out.println( "Quetion1 : fn_ = " + fn_ );
    System.out.println( "Quetion1 : adr_ = " + adr_ );
    System.out.println( "Quetion1 : port_ = " + port_ );
         public void UPLOAD(
              try{
                   sock_     = new Socket( adr_, port_ );
                   UpLoad();
                   DnLoad();
                   sock_.close();
              catch( UnknownHostException e ){
                   e.printStackTrace();
              catch( ConnectException e ){
                   e.printStackTrace();
              catch( NoRouteToHostException e ){
                   e.printStackTrace();
              catch( IOException e ){
                   e.printStackTrace();
         public void UpLoad(
              byte[]                         buf          = new byte[ 512 ];
              int                              rlen;
              int                              wlen;
              try {
                   OutputStream          sos          = sock_.getOutputStream();
                   FileInputStream          fis          = new FileInputStream( fn_ );
                   DataInputStream          dis          = new DataInputStream( fis );
                   DataOutputStream     dos          = new DataOutputStream( sos );
                   while( ( rlen =     dis.read( buf, 0, buf.length ) ) >= 0 ){
                        dos.write( buf, 0, rlen );
                   dis.close();
                   dos.close();
                   fis.close();
                   sos.close();
              catch( IOException e ){
                   e.printStackTrace();
         public void DnLoad(
              byte[]                         buf          = new byte[ 512 ];
              int                              rlen;
              int                              wlen;
              try {
                   InputStream               sis          = sock_.getInputStream();
                   FileOutputStream     fos          = new FileOutputStream( fn_ + ".cry" );
                   DataInputStream          dis          = new DataInputStream( sis );
                   DataOutputStream     dos          = new DataOutputStream( fos );
                   while( ( rlen =     dis.read( buf, 0, buf.length ) ) >= 0 ){
                        dos.write( buf, 0, rlen );
                   dis.close();
                   dos.close();
                   fos.close();
                   sis.close();
              catch( IOException e ){
                   e.printStackTrace();
         public static void main(
              String[] args
              char[]     chrs     = ( new String( args[ 0 ] ) ).toCharArray();
              Question1     clnt     = new Question1(
                                                                     // E or D
                                            chrs[ 0 ],
                                            args[ 1 ],               // key string
                                            args[ 2 ],               // file to be processed
                                            args[ 3 ],               // IP address
                                                                     // port
                                            Integer.parseInt( args[ 4 ] )
              clnt.UPLOAD();
    }

  • Accessing connection from java and generated code

    In JDeveloper 10.1.2.x I set up a connection and selected a stored procedure and generated java to call the stored proc. All good.
    Now, in a web service application I want to call the method in that class that was generated.
    So, the generated class has setConnectionContext(), getConnectionContext(), etc methods. I don't know how to use them. What is a ConnectionContext?
    How do I provide the database connection information and call the method in the generated code that I need?
    My Oracle AS server has a datasource configured that is the one I would like to use, but I don't know how to 'access' it via java in the context of this generated class.
    I am deploying to Oracle AS 10.1.2,
    thanks

    Hi, well CSV is not currently an Excel file, it is a Comma Separated Values
    file which can be read through Excel.
    Now, if you wish to remove the header, I would purpose that you develop an
    application that reads the CSV file, as it is mere text, and that it also reads
    another file (lets call it confirguration.txt) in which you determine the pattern
    you want to remove, then you just read your report and if a string line
    matches the pattern you defined in the configuration.txt file, then you simply
    erase it.
    And if you keep interested in reading real Excel files (xls), I would
    recommend you use POI-HSSF API from Apache.org
    http://jakarta.apache.org/poi/hssf/index.html
    Hope this helps, cya around.

  • Unable to connect to CMC and Java Infoview

    Hi
    I am unable to connect to CMC and Java Infoview. When I am attempting to connect, then the following message is displayed.
    "Oops! Internet Explorer could not connect to <web server>:<port number>"
    Please give me some suggestions.
    Thanks!

    Hi Stratos
    I uninstalled the designer and repaired Crystal Reports Server. But it did not help.
    The CMS is running now. But I cannot find all the other services and I am getting the same error when I try to open CMC or InfoView.
    I found some of these errors in my system's event viewer:
    NT Service message: NT Service Initialization Problem.
    The root server reported an error Initialization Failure.
    The source for both these errors is BusinessObjects_CMS.
    Please suggest something
    Thanks

Maybe you are looking for

  • Set tolerance limits in invoice block

    We have the following tolerances:                                                                                 Lower limit                                     Upper limit                                                                             

  • How to get prompt value in Financial Reporting and use it as header

    Hi Oracle Gurus, I have Hyperion Financial Reporting 11.1.1.3. I created a report. I have Products dimension on rows. And I also have prompt for Products. Let's say there is 3 products, Product A, B, and C, with each has its own level 0 item (for exa

  • How do i get an internet connection from my Mac to my iPad using a usb cable?

    I have a Mac connected to the internet through a modem. However, i also want my iPad to share this connection through the usb cable. Is this possible? If not, is there any other way i can get my iPad to share the internet connection from my Mac?

  • No DBLinks in the the generated code

    Hi guys, I am facing a strange problem. The code generated for my mapping does NOT have the dblinks. My OWB version is 10.1.0.4 This is my problem in brief. I have installed OWB recently and started to do a sample task. I created a very simple one to

  • HT201250 Time Machine taking forever...???

    I am backing up 230GB from my local drive to a new external drive using Time Machine.  I am now 24hrs into the process and only 25GB along...should it take this long?