Different results in eclipse and in browser

  • (5 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »

69 Replies - 2868 Views - Last Post: 06 February 2013 - 04:52 AM Rate Topic: -----

#1 novakasss  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 352
  • Joined: 11-July 12

Different results in eclipse and in browser

Posted 29 January 2013 - 10:45 AM

I made some gui in my applet program. and if user's login success, it should change panel to another one. In Eclipse everything works fine. But why when I do the same thing inside my browser it doesn't work. Login panel still chilling on the screen.
Is This A Good Question/Topic? 0
  • +

Replies To: Different results in eclipse and in browser

#2 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2728
  • View blog
  • Posts: 11,470
  • Joined: 20-September 08

Re: Different results in eclipse and in browser

Posted 29 January 2013 - 11:00 AM

http://technojeeves....-applet-console

Post errors
Was This Post Helpful? 1
  • +
  • -

#3 novakasss  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 352
  • Joined: 11-July 12

Re: Different results in eclipse and in browser

Posted 29 January 2013 - 11:54 AM

View Postg00se, on 29 January 2013 - 11:00 AM, said:



There isn't java icon inside my control pane.
Posted Image
I'm using Windows XP and by the turorial, this is the way where I can find java control panel.

EDIT: I found it. I will add what I get little bit later.

This post has been edited by novakasss: 29 January 2013 - 12:07 PM

Was This Post Helpful? 0
  • +
  • -

#4 novakasss  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 352
  • Joined: 11-July 12

Re: Different results in eclipse and in browser

Posted 29 January 2013 - 12:52 PM

I got this error:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
	at sun.applet.AppletClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.applet.AppletClassLoader.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 kurybinis.Pagrindine.prisijungtiPrieBazes(Pagrindine.java:49)
	at kurybinis.Pagrindine$1.run(Pagrindine.java:34)
	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)


I guess that it can't find mysql connector. In eclipse, I added it as external jar. So, now, when my project jar file is inside FTP, where should I put that connector.jar ? Or maybe here is another problem?
Was This Post Helpful? 0
  • +
  • -

#5 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2728
  • View blog
  • Posts: 11,470
  • Joined: 20-September 08

Re: Different results in eclipse and in browser

Posted 29 January 2013 - 12:57 PM

Add the jar in the same place as your applet class file and include it in the archive attribute of your applet tag
http://www.w3.org/TR...cts.html#h-13.4

archive="whatever-the-connector-jar-is-called.jar"

Was This Post Helpful? 1
  • +
  • -

#6 novakasss  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 352
  • Joined: 11-July 12

Re: Different results in eclipse and in browser

Posted 29 January 2013 - 01:01 PM

View Postg00se, on 29 January 2013 - 12:57 PM, said:

Add the jar in the same place as your applet class file and include it in the archive attribute of your applet tag
http://www.w3.org/TR...cts.html#h-13.4

archive="whatever-the-connector-jar-is-called.jar"


Now my appled code looks like this:
<APPLET code="kurybinis.Pagrindine" archive="mysql-connector-java-5.1.22-bin.jar" WIDTH="600" HEIGHT="600" ARCHIVE="game.jar"></applet>


It is possible to have two archive tags? By the way, with this code I get same error.
Was This Post Helpful? 0
  • +
  • -

#7 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2728
  • View blog
  • Posts: 11,470
  • Joined: 20-September 08

Re: Different results in eclipse and in browser

Posted 29 January 2013 - 01:15 PM

Quote

It is possible to have two archive tags?
Read the docs:

Quote

This attribute specifies a comma-separated list of URIs for archives containing classes and other resources

archive="mysql-connector-java-5.1.22-bin.jar,game.jar" WIDTH="600" HEIGHT="600"></applet>

Quote

By the way, with this code I get same error.

When you're still troubleshooting, make sure you clear the applet cache with the correct option on the Console

This post has been edited by g00se: 29 January 2013 - 01:16 PM
Reason for edit:: example

Was This Post Helpful? 1
  • +
  • -

#8 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3490
  • View blog
  • Posts: 11,902
  • Joined: 12-December 12

Re: Different results in eclipse and in browser

Posted 29 January 2013 - 01:18 PM

I believe there should be only one archive attribute, separating the archiveList with commas:
archive="mysql-connector-java-5.1.22-bin.jar,game.jar"

Was This Post Helpful? 0
  • +
  • -

#9 novakasss  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 352
  • Joined: 11-July 12

Re: Different results in eclipse and in browser

Posted 30 January 2013 - 08:09 AM

View Postg00se, on 29 January 2013 - 01:15 PM, said:

Quote

It is possible to have two archive tags?
Read the docs:

Quote

This attribute specifies a comma-separated list of URIs for archives containing classes and other resources

archive="mysql-connector-java-5.1.22-bin.jar,game.jar" WIDTH="600" HEIGHT="600"></applet>

Quote

By the way, with this code I get same error.

When you're still troubleshooting, make sure you clear the applet cache with the correct option on the Console

I did everything just like you said, cleared cache. Now I'm getting this error:
createGUI didn't complete successfully
java.lang.reflect.InvocationTargetException
	at java.awt.EventQueue.invokeAndWait(Unknown Source)
	at javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
	at kurybinis.Pagrindine.init(Pagrindine.java:31)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError


There is lots more. But I think this is the main one.
Was This Post Helpful? 0
  • +
  • -

#10 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2728
  • View blog
  • Posts: 11,470
  • Joined: 20-September 08

Re: Different results in eclipse and in browser

Posted 30 January 2013 - 08:54 AM

Please clear the console. Clear the cache. Reload the page and copy and paste contents of console
Was This Post Helpful? 1
  • +
  • -

#11 novakasss  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 352
  • Joined: 11-July 12

Re: Different results in eclipse and in browser

Posted 30 January 2013 - 09:12 AM

View Postg00se, on 30 January 2013 - 08:54 AM, said:

Please clear the console. Clear the cache. Reload the page and copy and paste contents of console


As I said before. I did everything. After reading this post I also did this again and the same error:
createGUI didn't complete successfully
java.lang.reflect.InvocationTargetException
	at java.awt.EventQueue.invokeAndWait(Unknown Source)
	at javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
	at kurybinis.Pagrindine.init(Pagrindine.java:31)
	at sun.applet.AppletPanel.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.mysql.jdbc.StringUtils
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:315)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at kurybinis.Pagrindine.prisijungtiPrieBazes(Pagrindine.java:53)
	at kurybinis.Pagrindine$1.run(Pagrindine.java:34)
	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)
java.net.MalformedURLException: no protocol: 
	at java.net.URL.<init>(Unknown Source)
	at java.net.URL.<init>(Unknown Source)
	at java.net.URL.<init>(Unknown Source)
	at sun.plugin.liveconnect.SecureInvocation.checkLiveConnectCaller(Unknown Source)
	at sun.plugin.liveconnect.SecureInvocation.access$000(Unknown Source)
	at sun.plugin.liveconnect.SecureInvocation$2.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source)



I don't know if you will also see this console. But you can take a look. http://sportoviktorina.lt/testas.html

This post has been edited by novakasss: 30 January 2013 - 09:15 AM

Was This Post Helpful? 0
  • +
  • -

#12 novakasss  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 352
  • Joined: 11-July 12

Re: Different results in eclipse and in browser

Posted 30 January 2013 - 11:57 AM

Maybe I'm not a expert, but I saw in the error this line:
Caused by: java.lang.ExceptionInInitializerError
	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:315)



Is that mean that I have problems with that Driver?
I used this code:
String drive = "com.mysql.jdbc.Driver";
			Class.forName(drive);
con = DriverManager.getConnection(url, userName, password);

Was This Post Helpful? 0
  • +
  • -

#13 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2728
  • View blog
  • Posts: 11,470
  • Joined: 20-September 08

Re: Different results in eclipse and in browser

Posted 30 January 2013 - 12:39 PM

Are you absolutely sure that the db is on the same host as the applet? If so, try a different version of the driver jar
Was This Post Helpful? 1
  • +
  • -

#14 novakasss  Icon User is offline

  • D.I.C Regular

Reputation: 4
  • View blog
  • Posts: 352
  • Joined: 11-July 12

Re: Different results in eclipse and in browser

Posted 30 January 2013 - 12:44 PM

View Postg00se, on 30 January 2013 - 12:39 PM, said:

Are you absolutely sure that the db is on the same host as the applet? If so, try a different version of the driver jar

Hmmm. I'm not 100 percent sure, because maybe two last weeks showed that my knowledge about MySQL, hosts and etc is quite poor.

So I will explain situation. I ordered a hosting it gives me FTP and MYSQL. I uploaded my jar files, html file inside the ftp public_html directory. That's it. I think it is on the same host.

So, if the answer is yes, what other driver would you recommend?
Was This Post Helpful? 0
  • +
  • -

#15 g00se  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2728
  • View blog
  • Posts: 11,470
  • Joined: 20-September 08

Re: Different results in eclipse and in browser

Posted 30 January 2013 - 01:14 PM

Yes, it's the same host.

Don't call start() from init() - the browser will call start automatically

Try it again after that change before changing the driver
Was This Post Helpful? 1
  • +
  • -

  • (5 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »