Results 1 to 16 of 16
- 10-03-2012, 04:51 PM #1
Member
- Join Date
- Oct 2012
- Posts
- 8
- Rep Power
- 0
Applet embedded in html code not able to communicate with DB
For a test project that I am doing, I have a Japplet embedded in a piece of HTML code. The applet has a form which takes some user input through a text box. The data captured needs to be updated into a MySQL table.
- The applet is displayed properly when the html page is opened in a browser.
- The codes throws no error on submitting the user entered info.
- But the table is not getting updated with the data.
Code used to embed the applet in the html page is as shown below.
**********************
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<applet code="OBSPackage.UserHome" archive="OBSLibrary.jar" width="1500" height="600"></applet>
</body>
</html>
**********************
The code inside the applet that updates the data into the table is as shown below.
**********************
int rs1=d.putData("insert into reg(uname,address,phno,email)values('"+name+"','"+ address+"','"+ph+"','"+email+"')");
int rs2=d.putData("insert into login(username,password)values('"+username+"','"+p ass+"')");
JOptionPane.showMessageDialog(this,"Registered Successfully");
**********************
NOTE: The data insertion is working properly when the applet is run independently in the applet viewer. The issue is only when it is accessed through a browser.
What can i do to resolve the situation? I am using Netbeans.
- 10-03-2012, 05:02 PM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: Applet embedded in html code not able to communicate with DB
Please use [code] tags [/code] when posting code.
Most people won't bother with unformatted code.
Please show your JDBC code.
Where is your MySQL database?Please do not ask for code as refusal often offends.
- 10-03-2012, 05:56 PM #3
Member
- Join Date
- Oct 2012
- Posts
- 8
- Rep Power
- 0
Re: Applet embedded in html code not able to communicate with DB
Thanks Casper for the swift response and the etiquette suggestions.
- Here is my jdbc code
- I am using Netbeans to create the applets. The MySQL DB is in the same machine, in the default location (programfiles/mysql/data). The netbeans project is saved in 'My Documents'. I am able to access the DB when I run the applet through appletviewer, but not when called through a browser.Java Code:public DBcon() { try { Class.forName("com.mysql.jdbc.Driver"); Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/db", "root", "deepak"); st = con.createStatement(); } catch (Exception e) { System.out.println("Error" + e); } }
Thanks again for your time!
- 10-03-2012, 06:24 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: Applet embedded in html code not able to communicate with DB
"Casper"?
I see no ghost, friendly or otherwise.
:)
I'm going to guess at security restrictions.
Get that connection code to throw a runtime exception in that catch block and see what happens.Please do not ask for code as refusal often offends.
- 10-03-2012, 06:44 PM #5
Member
- Join Date
- Oct 2012
- Posts
- 8
- Rep Power
- 0
Re: Applet embedded in html code not able to communicate with DB
My Mistake 'Friendly ghost' !!

I have already enabled an exception clause as you see from the code i posted. This process is executed without any error when i run on applet viewer.
On browser also it is getting executed without throwing any exception.
Did I get your suggestion wrong??
- 10-04-2012, 09:50 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: Applet embedded in html code not able to communicate with DB
Applet viewer does not have security restrictions, there is no sandbox, so you will not get any access problems with it.
It cannot be used to check permissions are correctly set.
Change that catch block to:
I don't know, for an applet, where sysout goes to, but the above will register quite clearly if there is an exception.Java Code:} catch (Exception e) { throw new RuntimeException("All gone wrong"); }
I'm not saying this is the problem, but it's nice to rule things out.Please do not ask for code as refusal often offends.
- 10-04-2012, 10:12 AM #7
Re: Applet embedded in html code not able to communicate with DB
Why do they call it rush hour when nothing moves? - Robin Williams
- 10-04-2012, 01:29 PM #8
Member
- Join Date
- Oct 2012
- Posts
- 8
- Rep Power
- 0
Re: Applet embedded in html code not able to communicate with DB
I did embed that throw statement and enabled the console as well. Below is the output copied from the console.
Java Code:Java Plug-in 10.7.2.11 Using JRE version 1.7.0_07-b11 Java HotSpot(TM) Client VM User home directory = C:\Documents and Settings\szachari ---------------------------------------------------- c: clear console window f: finalize objects on finalization queue g: garbage collect h: display this help message l: dump classloader list m: print memory usage o: trigger logging q: hide console r: reload policy configuration s: dump system and deployment properties t: dump thread list v: dump thread stack x: clear classloader cache 0-5: set trace level to <n> ---------------------------------------------------- cache: Initialize resource manager: com.sun.deploy.cache.ResourceProviderImpl@98b13b security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils. security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp security: property package.definition value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils. security: property package.definition new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws security: property package.definition value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws security: property package.definition new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy security: property package.definition value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy security: property package.definition new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss security: property package.definition value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp security: property package.definition new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.org.apache.xerces.internal.utils.,com.sun.org.apache.xalan.internal.utils.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss basic: Added progress listener: sun.plugin.util.ProgressMonitorAdapter@d5b111 basic: Plugin2ClassLoader.addURL parent called for http://localhost:8080/OBSWeb/OBSLibrary.jar security: Blacklist revocation check is enabled security: Trusted libraries list check is enabled network: Cache entry found [url: http://localhost:8080/OBSWeb/OBSLibrary.jar, version: null] prevalidated=false/0 cache: Resource http://localhost:8080/OBSWeb/OBSLibrary.jar has expired. network: Connecting http://localhost:8080/OBSWeb/OBSLibrary.jar.pack.gz with proxy=DIRECT network: Connecting http://localhost:8080/ with proxy=DIRECT network: Connecting http://localhost:8080/OBSWeb/OBSLibrary.jar with proxy=DIRECT network: ResponseCode for http://localhost:8080/OBSWeb/OBSLibrary.jar : 200 network: Encoding for http://localhost:8080/OBSWeb/OBSLibrary.jar : null network: Disconnect connection to http://localhost:8080/OBSWeb/OBSLibrary.jar CacheEntry[http://localhost:8080/OBSWeb/OBSLibrary.jar]: updateAvailable=true,lastModified=Thu Oct 04 16:36:14 IST 2012,length=157898 network: Connecting http://localhost:8080/OBSWeb/OBSLibrary.jar with proxy=DIRECT network: Downloading resource: http://localhost:8080/OBSWeb/OBSLibrary.jar Content-Length: 157,996 Content-Encoding: null network: Wrote URL http://localhost:8080/OBSWeb/OBSLibrary.jar to File C:\Documents and Settings\szachari\Local Settings\Application Data\Sun\Java\Deployment\cache\6.0\53\326206b5-309a84d9-temp security: Trusted libraries list file not found cache: Replacing MemoryCache entry (cnt=0) for http://localhost:8080/OBSWeb/OBSLibrary.jarwas=com.sun.deploy.cache.CacheEntry (12545731) now=com.sun.deploy.cache.CacheEntry (59518) security: Accessing keys and certificate in Mozilla user profile: null security: Loading Deployment certificates from C:\Documents and Settings\szachari\Application Data\Sun\Java\Deployment\security\trusted.certs security: Loaded Deployment certificates from C:\Documents and Settings\szachari\Application Data\Sun\Java\Deployment\security\trusted.certs security: Loading certificates from Deployment session certificate store security: Loaded certificates from Deployment session certificate store security: Validate the certificate chain using CertPath API security: Loading Root CA certificates from C:\Program Files\Java\jre7\lib\security\cacerts security: Loaded Root CA certificates from C:\Program Files\Java\jre7\lib\security\cacerts security: Obtain certificate collection in Root CA certificate store security: Obtain certificate collection in Root CA certificate store security: Obtain certificate collection in Root CA certificate store security: Obtain certificate collection in Root CA certificate store Ignored exception: java.security.cert.CertificateException: Your security configuration will not allow granting permission to self signed certificates basic: Dialog type is not candidate for embedding security: Certificate revocation enabled. Disable security validation optimizations. network: CleanupThread used 6756339 us security: Validate the certificate chain using CertPath API java.security.cert.CertificateException: Your security configuration will not allow granting permission to self signed certificates at com.sun.deploy.security.TrustDecider.validateChain(Unknown Source) at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.isTrustedByTrustDecider(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.getPermissions(Unknown Source) at java.security.SecureClassLoader.getProtectionDomain(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.defineClassHelper(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.access$100(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source) at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) network: Cache entry not found [url: http://localhost:8080/OBSWeb/lib/mysql-connector-java-5.1.18-bin.jar, version: null] network: Connecting http://localhost:8080/OBSWeb/lib/mysql-connector-java-5.1.18-bin.jar with proxy=DIRECT network: Connecting http://localhost:8080/ with proxy=DIRECT java.io.FileNotFoundException: http://localhost:8080/OBSWeb/lib/mysql-connector-java-5.1.18-bin.jar at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at sun.plugin.PluginURLJarFileCallBack.downloadJAR(Unknown Source) at sun.plugin.PluginURLJarFileCallBack.access$000(Unknown Source) at sun.plugin.PluginURLJarFileCallBack$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source) at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source) at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source) at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source) at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source) at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source) at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFileInternal(Unknown Source) at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source) at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at Database.DBcon.<init>(DBcon.java:23) at OBSPackage.Test.<init>(Test.java:12) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter$1.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$200(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) network: Cache entry not found [url: http://localhost:8080/OBSWeb/lib/mysql-connector-java-5.1.18-bin.jar, version: null] network: Connecting http://localhost:8080/OBSWeb/lib/mysql-connector-java-5.1.18-bin.jar with proxy=DIRECT network: Cache entry not found [url: http://localhost:8080/OBSWeb/lib/mysql-connector-java-5.1.18-bin.jar, version: null] network: Connecting http://localhost:8080/OBSWeb/lib/mysql-connector-java-5.1.18-bin.jar with proxy=DIRECT java.io.FileNotFoundException: http://localhost:8080/OBSWeb/lib/mysql-connector-java-5.1.18-bin.jar at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source) at sun.plugin.PluginURLJarFileCallBack.downloadJAR(Unknown Source) at sun.plugin.PluginURLJarFileCallBack.access$000(Unknown Source) at sun.plugin.PluginURLJarFileCallBack$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source) at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source) at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source) at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source) at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source) at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source) at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFileInternal(Unknown Source) at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source) at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source) at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source) at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at Database.DBcon.<init>(DBcon.java:23) at OBSPackage.Test.<init>(Test.java:12) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter$1.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$200(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) network: Cache entry not found [url: http://localhost:8080/OBSWeb/lib/mysql-connector-java-5.1.18-bin.jar, version: null] network: Connecting http://localhost:8080/OBSWeb/lib/mysql-connector-java-5.1.18-bin.jar with proxy=DIRECT network: Cache entry not found [url: http://localhost:8080/OBSWeb/, version: null] network: Cache entry not found [url: http://localhost:8080/OBSWeb/com/mysql/jdbc/Driver.class, version: null] network: Connecting http://localhost:8080/OBSWeb/com/mysql/jdbc/Driver.class with proxy=DIRECT basic: exception: java.lang.reflect.InvocationTargetException. java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.runOnEDTAndWait(Unknown Source) at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.instantiateApplet(Unknown Source) at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source) at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.reflect.InvocationTargetException at com.sun.deploy.uitoolkit.impl.awt.OldPluginAWTUtil.invokeAndWait(Unknown Source) ... 5 more Caused by: java.lang.RuntimeException: All gone wrong at Database.DBcon.<init>(DBcon.java:27) at OBSPackage.Test.<init>(Test.java:12) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter$1.run(Unknown Source) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$200(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) Ignored exception: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException basic: Dialog type is not candidate for embedding basic: Removed progress listener: sun.plugin.util.ProgressMonitorAdapter@d5b111 basic: Loading Java Applet Failed... security: Reset deny session certificate store
- 10-04-2012, 01:32 PM #9
Member
- Join Date
- Oct 2012
- Posts
- 8
- Rep Power
- 0
Re: Applet embedded in html code not able to communicate with DB
@DarrylBurke
Thanks much ! That helped.
- 10-04-2012, 02:32 PM #10
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: Applet embedded in html code not able to communicate with DB
Several things (and a mistake from me):
java.security.cert.CertificateException: Your security configuration will not allow granting permission to self signed certificates
Pretty self explanatory...your self signed certificate had no effect on the security permissions for your applet.
java.io.FileNotFoundException: http://localhost:8080/OBSWeb/lib/mys...5.1.18-bin.jar
Your driver jar file is not on your server.
Finally my one, where I made a boo boo on the exception by forgetting to include the causing exception:
That should tell you the ultimate cause of the exception (apologies).Java Code:} catch (Exception e) { throw new RuntimeException("All gone wrong", e); }
Though I expect it's an Exception about not being able to find the driver.Please do not ask for code as refusal often offends.
- 10-04-2012, 04:02 PM #11
Member
- Join Date
- Oct 2012
- Posts
- 8
- Rep Power
- 0
Re: Applet embedded in html code not able to communicate with DB
I changed the security configuration and the certificate issue is now resolved.
But the file not found error is still coming up as shown below. What can I do about that?
Java Code:network: Cache entry not found [url: http://localhost:8080/OBSWeb/lib/mysql-connector-java-5.1.22-bin.jar, version: null] network: Connecting http://localhost:8080/OBSWeb/lib/mysql-connector-java-5.1.22-bin.jar with proxy=DIRECT network: Cache entry not found [url: http://localhost:8080/OBSWeb/lib/mysql-connector-java-5.1.22-bin.jar, version: null] network: Connecting http://localhost:8080/OBSWeb/lib/mysql-connector-java-5.1.22-bin.jar with proxy=DIRECT java.io.FileNotFoundException: http://localhost:8080/OBSWeb/lib/mysql-connector-java-5.1.22-bin.jar
- 10-04-2012, 05:53 PM #12
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: Applet embedded in html code not able to communicate with DB
Well, is that where the jar file is located on your server?
Please do not ask for code as refusal often offends.
- 10-04-2012, 07:02 PM #13
Member
- Join Date
- Oct 2012
- Posts
- 8
- Rep Power
- 0
Re: Applet embedded in html code not able to communicate with DB
Yes, thats where it is !
- 10-05-2012, 09:39 AM #14
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: Applet embedded in html code not able to communicate with DB
I'm afraid you might have to prove it, because that error is disagreeing with you.
Please do not ask for code as refusal often offends.
- 10-06-2012, 12:57 PM #15
Member
- Join Date
- Oct 2012
- Posts
- 8
- Rep Power
- 0
Re: Applet embedded in html code not able to communicate with DB
My index.jsp is at "C:\Documents and Settings\szachari\Desktop\OBSWeb\web" and it come up fine when i run it from netbeans. the browser url comes up as "http://localhost:8080/OBSWeb/index.jsp"
I have the "mysql-connector-java-5.1.22-bin.jar" file also inside the same folder at the physical location "C:\Documents and Settings\szachari\Desktop\OBSWeb\lib". But unfortunately this is not recognized!
Have even added the classpath correct. Attached is the screenshot.
- 10-08-2012, 11:23 AM #16
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Similar Threads
-
My Applet is giving error with I communicate with servlet.
By ganesh.gothi@gmail.com in forum Java AppletsReplies: 3Last Post: 05-30-2012, 06:13 PM -
Interaction with embedded java applet
By veggieCoder in forum New To JavaReplies: 10Last Post: 01-12-2012, 07:20 PM -
Getting Focus in an embedded applet? And strange error reports
By Reskaillev in forum New To JavaReplies: 12Last Post: 07-25-2011, 03:25 PM -
Embedded applet in jsp its not working.
By charmi in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 06-17-2011, 11:22 AM -
To communicate an Applet with an application that uses struts
By Eric in forum Web FrameworksReplies: 1Last Post: 07-06-2007, 05:21 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks