Error when applet is trying to connect to WLS server

Hello everyone,
I'm currently having problems with applets and WebLogic. Though I know, applets are not the most appreciated way to do things with weblogic (or even in general), there are no real alternatives for us.
We have a larger application consisting of several servlets, already integrated into WLS and using the data sources.
Now we want to create a small piece of applet that uses WLS to get data from the same JDBC data sources to display and navigate inside charts. These might even be updated on a regular basis while the applet is running.
So, there are two questions:
First, is it possible for the applet to be available on the server and connect to WLS by creating an initial context? I'm currently trying and i get an "java.security.AccessControlException: access denied (java.lang.RuntimePermission setContextClassLoader)". See the attached code below to see the connection example.
Second, if i can connect to the WLS, will this also be possible when the WLS is not localhost anymore, but another server? To clarify, an example:
Can an applet that is running inside a WLS at "http://theotherserver.net:7001/myapp/MyApplet.class" connect to the WLS at "theotherserver.net"?
I'd be glad if anyone could help me with that. The code I'm currently using (inside the init() function of the applet), is the following:
public void init() {
     Context ctx = null;
     Hashtable<String, String> ht = new Hashtable<String, String>();
     ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
     ht.put(Context.PROVIDER_URL, "t3://localhost:7001");
     try {
          ctx = new InitialContext(ht);
     // Use the context in your program
          System.out.println("context success");
     } catch (NamingException e) {
     System.out.println("NamingException"); // a failure occurred
     e.printStackTrace();
     } catch (AccessControlException e) {
          System.out.println("security control exception when authing"); // a failure occurred
          e.printStackTrace();
     } catch (Exception e) {
          System.out.println("other exception"); // a failure occurred
          e.printStackTrace();
     } finally {
          System.out.println("finally");
          try {
               ctx.close();
               System.out.println("close");
          } catch (Exception e) {
               System.out.println("close exception"); // a failure occurred
When the applet is run, whatever I do in start() etc get's done (for example drawing charts with jfreechart), but the java console prints the following as a result of the failed connection to WLS:
security control exception when authing
java.security.AccessControlException: access denied (java.lang.RuntimePermission setContextClassLoader)
     at java.security.AccessControlContext.checkPermission(Unknown Source)
     at java.security.AccessController.checkPermission(Unknown Source)
     at java.lang.SecurityManager.checkPermission(Unknown Source)
     at java.lang.Thread.setContextClassLoader(Unknown Source)
     at weblogic.corba.j2ee.naming.ORBHelper.createORB(ORBHelper.java:426)
     at weblogic.corba.j2ee.naming.ORBHelper.getORBReferenceWithRetry(ORBHelper.java:571)
     at weblogic.corba.j2ee.naming.ORBHelper.getORBReference(ORBHelper.java:547)
     at weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:85)
     at weblogic.corba.j2ee.naming.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:31)
     at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:41)
     at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
     at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
     at javax.naming.InitialContext.init(Unknown Source)
     at javax.naming.InitialContext.<init>(Unknown Source)
     at com.igrafx.charter.program.CharterApplet.init(CharterApplet.java:70)
     at sun.applet.AppletPanel.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
finally
close exception
Edited by: user10921034 on 11.11.2009 09:46

I have solved the above problem now. The problem was, that I only signed my own jar, but not the wlclient.jar, which also needs the rights to instantiate classes.
This also solved my second question. Yet, there is another thing, now that I am trying to use JNDI to access a JDBC shared datasource from weblogic.
The data source is accessible and working (tested from servlets). Now I'm trying to create a connection with the following code, but it does not get past the first lookup:
try {
DataSource ds = (DataSource) this.appletContext.lookup("ReportCentral");
conn = ds.getConnection();
conn.setAutoCommit(true);
The thrown exception:
java.lang.NoClassDefFoundError: weblogic/jdbc/common/internal/RemoteDataSource
     at java.lang.ClassLoader.defineClass1(Native Method)
     at java.lang.ClassLoader.defineClass(Unknown Source)
     at java.security.SecureClassLoader.defineClass(Unknown Source)
     at java.net.URLClassLoader.defineClass(Unknown Source)
     at java.net.URLClassLoader.access$000(Unknown Source)
     at java.net.URLClassLoader$1.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(Unknown Source)
     at java.lang.ClassLoader.loadClass(Unknown Source)
     at java.lang.ClassLoader.loadClass(Unknown Source)
     at java.lang.ClassLoader.loadClassInternal(Unknown Source)
     at java.lang.Class.forName0(Native Method)
     at java.lang.Class.forName(Unknown Source)
     at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
     at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
     at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
     at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
     at com.sun.corba.se.impl.util.JDKBridge.loadClassM(Unknown Source)
     at com.sun.corba.se.impl.util.JDKBridge.loadClass(Unknown Source)
     at com.sun.corba.se.impl.javax.rmi.CORBA.Util.loadClass(Unknown Source)
     at javax.rmi.CORBA.Util.loadClass(Unknown Source)
     at com.sun.corba.se.impl.presentation.rmi.StubFactoryFactoryStaticImpl.createStubFactory(Unknown Source)
     at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_Object(Unknown Source)
     at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_Object(Unknown Source)
     at com.sun.corba.se.impl.encoding.CDRInputStream.read_Object(Unknown Source)
     at com.sun.corba.se.impl.corba.TCUtility.unmarshalIn(Unknown Source)
     at com.sun.corba.se.impl.corba.AnyImpl.read_value(Unknown Source)
     at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_any(Unknown Source)
     at com.sun.corba.se.impl.encoding.CDRInputStream.read_any(Unknown Source)
     at weblogic.corba.cos.naming._NamingContextAnyStub.resolve_any(_NamingContextAnyStub.java:81)
     at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:208)
     at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:168)
     at javax.naming.InitialContext.lookup(Unknown Source)
     at com.igrafx.charter.program.CharterApplet.start(CharterApplet.java:178)
     at sun.applet.AppletPanel.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)
I cannot find the mentioned class, to include it in my jar, neither am I sure that this is the best way to get a connection to the database this way.
In the applet, it is NOT possible to create the connection by hand, as the user/password are only available to weblogic, but not the overlying J2EE applications.
If i do that on my local system, nevertheless, it works:
OracleDataSource ds = new OracleDataSource();
ds.setURL("jdbc:oracle:thin:...@localhost:1521:XE");
conn = ds.getConnection();
This creates a valid connection.
So, the major question is: How can I access the connection pool of Weblogic through an applet?

Similar Messages

  • Keep getting an Error Code 403 for trying to connect to FTP server

    I am trying to access a friend of mine's ftp server so I can upload some pictures of a recent event. I keep getting an error code 403 "FORBIDDEN, You do not have permission to access this server". At first I was trying to connect through Safari. Then after a quick google search, I found out I should be connecting through my Finder by selecting GO then Connect to Server. When I did that it says Connection Failed - "They could be a problem with the server or it could be down".
    Now a friend of mine who has a PC told me he was able to access the server and upload his pictures with no problem!
    So why am I getting all these error codes and he was able to access the server? Yes, I was giving permission by the owner of the server to upload my pictures!!!

    In the Finder->Go->Go to Server->this should do the job:
    *ftp://ftp."URL to server"*
    where it's something like: ftp.xyz.yyy.com
    In the Terminal app, all you need to use is:
    *ftp "URL to server"*

  • Keep getting time out connection error when my macair tries to connect to Internet, but my iPad, phone and PC connect straight away. It happens on and off what could be the problem?

    Having trouble connecting to Internet with my MacBook Air. It can be fine for a few hours thins goes off and all I get it the message couldn't connect due to time out error connection. It can't be my broadband because I don't have the same problem with my other devices. Is my mac air breaking down?

    looks like this is your network connection settings problem, you'd better only keep one network adaptor online and linked, if you do not understand how to setup windows routing, this is completely not firefox problem. buddy. wish you goodluck.

  • Exception when trying to Connect to JMS Server Remotely

    Hi,
    I get the following error when i am trying to connect to a JMS server over the network. Please help.
    Aug 7, 2009 12:58:10 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
    org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
    at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImp
    l.java:130)
    at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl
    .java:192)
    at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
    at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
    at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
    at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
    at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:127)
    at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:182)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:339)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at com.splwg.mpl.server.jms.JNDIJMSConnectionFactoryFactory.getConnectionFactory(JNDIJMSConnectionFactoryFactory
    .java:56)
    at com.splwg.mpl.server.jms.JMSUtilImpl.getConnectionFactory(JMSUtilImpl.java:75)
    at com.splwg.mpl.jms.queue.JMSSender.init(JMSSender.java:80)
    at com.splwg.mpl.sending.NewSenderManager.init(NewSenderManager.java:108)
    at com.splwg.mpl.sending.SameThreadSendingManager.initSenderManager(SameThreadSendingManager.java:353)
    at com.splwg.mpl.sending.SameThreadSendingManager.init(SameThreadSendingManager.java:154)
    at com.splwg.mpl.server.async.AsyncServer.init(AsyncServer.java:193)
    at com.splwg.mpl.server.MPLServer.init(MPLServer.java:386)
    at com.splwg.mpl.server.MPLServer.run(MPLServer.java:547)
    at com.splwg.mpl.server.MPLServer.runMPL(MPLServer.java:535)
    at com.splwg.mpl.server.MPLServer.main(MPLServer.java:524)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
    at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
    ... 22 more
    Caused by: java.net.ConnectException: Connection refused: connect
    at sun.nio.ch.Net.connect(Native Method)
    at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:464)
    at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
    at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
    ... 23 more
    Aug 7, 2009 12:58:16 PM com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl <init>
    WARNING: "IOP00410201: (COMM_FAILURE) Connection failure: socketType: IIOP_CLEAR_TEXT; hostname: localhost; port: 3700"
    org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2690)
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.connectFailure(ORBUtilSystemException.java:2711)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:261)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:274)
    at com.sun.corba.ee.impl.transport.SocketOrChannelContactInfoImpl.createConnection(SocketOrChannelContactInfoImp
    l.java:130)
    at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.beginRequest(CorbaClientRequestDispatcherImpl
    .java:192)
    at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.request(CorbaClientDelegateImpl.java:181)
    at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.is_a(CorbaClientDelegateImpl.java:325)
    at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
    at org.omg.CosNaming.NamingContextHelper.narrow(NamingContextHelper.java:69)
    at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:127)
    at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:182)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:339)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at com.splwg.mpl.server.jms.JNDIJMSConnectionFactoryFactory.getConnectionFactory(JNDIJMSConnectionFactoryFactory
    .java:56)
    at com.splwg.mpl.server.jms.JMSUtilImpl.getConnectionFactory(JMSUtilImpl.java:75)
    at com.splwg.mpl.jms.queue.JMSSender.init(JMSSender.java:80)
    at com.splwg.mpl.sending.NewSenderManager.init(NewSenderManager.java:108)
    at com.splwg.mpl.sending.SameThreadSendingManager.initSenderManager(SameThreadSendingManager.java:353)
    at com.splwg.mpl.sending.SameThreadSendingManager.init(SameThreadSendingManager.java:154)
    at com.splwg.mpl.server.async.AsyncServer.init(AsyncServer.java:193)
    at com.splwg.mpl.server.MPLServer.init(MPLServer.java:386)
    at com.splwg.mpl.server.MPLServer.run(MPLServer.java:547)
    at com.splwg.mpl.server.MPLServer.runMPL(MPLServer.java:535)
    at com.splwg.mpl.server.MPLServer.main(MPLServer.java:524)
    Caused by: java.lang.RuntimeException: java.net.ConnectException: Connection refused: connect
    at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:347)
    at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.<init>(SocketOrChannelConnectionImpl.java:244)
    ... 22 more
    Caused by: java.net.ConnectException: Connection refused: connect
    at sun.nio.ch.Net.connect(Native Method)
    at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:464)
    at com.sun.corba.ee.impl.orbutil.ORBUtility.openSocketChannel(ORBUtility.java:105)
    at com.sun.enterprise.iiop.IIOPSSLSocketFactory.createSocket(IIOPSSLSocketFactory.java:332)
    ... 23 more

    The googleapi.jar contains copies of some javamail classes. Here a few I found in my output:
    javax.mail.event.MessageCountListener from googleapi.jar
    javax.mail.Session from googleapi.jar
    javax.mail.MessagingException from googleapi.jar
    javax.mail.NoSuchProviderException from googleapi.jar
    This particular google api is the old SOAP google service that is no longer allowing new registrations, but still has support for existing API key holders, like me :-). Thought this might be a common jar in most libraries, so worth mentioning.
    Don't forget, you can debug your loaded classes with java -verbose MyApp to find those rogue libraries.

  • HT4436 When trying to sign in I keep getting the error message, "iCloud encounterd a error while trying to connect to the server". How can I get signed in?

    When trying to sign in to iCloud, I always get the message, iCloud has encountered a error while trying to connect to the server. How do I get in????

    Hello,
    Try following step and check if issue gets resolved or not.
    Find Acrobat.exe on your computer.  Right click the program and click 'Troubleshoot Compatibility'.  Set the compatibility to Windows XP service pack 3.
    Regards,
    Anoop

  • HT204053 I have come across following error when accessing my icloud account " icloud encountered an error while trying to connect to the server" please help...

    Please help with below error...
    I have been trying to access my icloud account in laptop with windows 7 operating, but I couldn't able to log in to icloud which show following error " icloud encountered an error while trying to connect to the server".
    I have icloud icloud control panel.
    But I can access my same icloud account in another laptop with windows xp operating.

    My recommendation is to download Apple’s Safari version 5.1.7 for Windows to access iCloud.com. It consistently works for me!!!! To make things easier with Safari, I made iCloud.com its Homepage. I’m using it to access iCloud.com from all of my PCs.
    On my Windows 7 systems it appears that some add-ons are causing problems when you try to access iCloud.com with the 32-bit version of IE9, but the 64-bit version seems to work fine, more than likely because there are few add-ons that are 64-bit and the 64-bit version of IE9 can't be the default browser in Windows 7.

  • HT204053 How to resolve "error while trying to connect to the server."

    Receive "error while trying to connect to the server" on my PC when using iCloud. How to resolve?

    check the below link.
    /people/stephen.johannes/blog/2005/08/18/external-data-loads-for-crm-40-using-xif-adapter

  • TS3988 I can't sign in to iCloud, message pops up stating that "iCloud encountered an error while trying to connect to the server". How do I sign in to iCloud now?

    Was using iCloud just fine on Mac and iPad and suddenly can't access it from either devices.
    When reviewing the settings on iPad a "verification failed, could not communicate with the server" message pops up.
    When trying to access iCloud account on icloud.com a "iCloud encountered an error while trying to connect to the server" message pops up.
    Meanwhile iCloud no longer works on both devices. (Apple ID works fine on Manage my Account)
    I don't remember changing any iCloud settings but I was working on email account settings when this happened....Any ideas??

    I have the same problem. This happens multiple times a day. I answer some questions and then unlock my account and then before long it all happens again. Extremely frustrating as I don't have a clue how to solve the problem.

  • Connection Error iCloud encountered an error while trying to connect to the server

    Hi iCloud users
    For the first time I have experienced errors while attempting to connect to iCloud via my PC.  Never had any problems previously.
    The first error I received was:
         "Connection Error - iCloud encountered an error while trying to connect to the server"
    After a few attempts I was able to connect to iCloud.  However I was unable to access my Calendar and Contacts.  I received the following error messages:
         "Can't load Calendar - There was a problem loading the application"
         "Can't load Contacts - There was a problem loading the application"
    Has anyone out there experienced this?  If so could you offer an solutions/suggestions?  Is iCloud not working properly today?
    Many thanks & cheers,
    Sue

    Hi
    I am sorry can't help you because I have same problem when login to icloude.com and try insert to Contacts!
    Many times happen.
    what is issues ?

  • Chat gives error" Error trying to connect to the Server. The Server is not available, please try again later"

    I have installed the chat vu and the chat portal server. All the VU's are but still when i start the chat (ip address on the usl) and fill all the credintials, i get the error "Error trying to connect to the Server. The Server is not available, please try again later"
    I have tested the connection in the IIS ChatVU  and it is ok.
    Please guide !!!
    Thanks and Regards
    Rohit

    Hi Rohit,
    Did you change the \ChatAS\web.config file with the right IP address of you Chat Portal VU?
    For your referente check page 116 (Internal Chat Client) from "SAP BCM 7 SP5 Basic Installation Example" document.
    Regards,
    Heber Olivar

  • Icloud encountered an error trying to connect to the server.

    When I try to sign in to my iCloud through iCloud.com I get this error: "icloud encountered an error trying to connect to the server.". However, at the same time I can  login with my different Apple IDs. It seems to me the problem is with this account. For sure I have already verified my account and I enter the correct password
    For further info, My iMac also cannot sync anything with the cloud. Meaning that, Also Im not able to manage my iCloud in system preference neither.
    Does anyone have any idea?! Could you please help me out if you know whats wrong?

    If it only does it at work, then the most likely reason is that your work network is blocking it, or one of the servers iCloud connects to.
    Have you asked the IT people at work? Checked it on another computer at work?

  • Error trying to validate app using Xcode: "An SSL error has occured and a secure connection to the server cannot be made."

    After I have done a last Apple Updated on my computer, can't anymore validate or submit apps usign Xcode, everytime I received this message: "An SSL error has occured and a secure connection to the server cannot be made"
    Any ideas?

    I had this happen a while ago too when I switched development machines, but I was able to submit it from a friend's house, so I'm pretty sure it is my ISP but this should not be a problem. I am trying to push out another update and I'm having the same problem again. I would be very happy if there was a permanent solution to this problem.

  • HT4759 iCloud encountered an error while trying to connect to the server.

    When I try to log into my iCloud account this message props out "iCloud encountered an error while trying to connect to the server," what should I do?

    Smae issue here.
    Started today June 20, any ideas?

  • TS3988 I get a "Connection Error - iCloud encountered an error while trying to connect to the server" message; I have been getting this error message for months, on any device I try to login with.

    I get a "Connection Error - iCloud encountered an error while trying to connect to the server" message; I have been getting this error message for months, on any device I try to login with.

    Hi
    I am sorry can't help you because I have same problem when login to icloude.com and try insert to Contacts!
    Many times happen.
    what is issues ?

  • I want to access my Icloud account through my office computer but every time I get a message saying ''iCloud encountered an error while trying to connect to the server''

    I want to access my Icloud account through my office computer but every time I get a message saying ''iCloud encountered an error while trying to connect to the server''

    My recommendation is to download Apple’s Safari version 5.1.7 for Windows to access iCloud.com. It consistently works for me!!!! To make things easier with Safari, I made iCloud.com its Homepage. I’m using it to access iCloud.com from all of my PCs.
    On my Windows 7 systems it appears that some add-ons are causing problems when you try to access iCloud.com with the 32-bit version of IE9, but the 64-bit version seems to work fine, more than likely because there are few add-ons that are 64-bit and the 64-bit version of IE9 can't be the default browser in Windows 7.

Maybe you are looking for