Ajouter un commentaire

maxlegrand

J'ai résussi à établir une connection en utilisant le driver sql server.
L'arborescence de mon projet est maitenant le suivant :
http://cjoint.com/data/gCpnNZCh70.htm

Le fichier sqljdbc_auth.dll est nécessaire car sinon j'obtenais une exception.
Le programme fonctionne normalement avec Eclipse mais ça se gâte encore avec Java Web Start.

Tous les fichiers et jar sont placés ici :
http://cjoint.com/data/gCpqhYq3rt.htm

J'ai mis le fichier sqljdbc_auth.dll dans l'archive testNtiveLib.jar

test.jnlp :

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost/Local-Site-A/" href="test.jnlp">

	<information>
		<title>Mon Logiciel par JNLP</title>
		<vendor>Pierre Sylvestre</vendor>
		
	</information>

	<security>
		<all-permission/>
	</security>

	<resources>
		<j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se"/>
		<jar href="http://localhost/Local-Site-A/test.jar"/>
		<jar href="http://localhost/Local-Site-A/lib/jfreechart-1.0.5.jar"/>
		<jar href="http://localhost/Local-Site-A/lib/junit.jar"/">
		<jar href="http://localhost/Local-Site-A/lib/itext-2.0.1.jar"/>
		<jar href="http://localhost/Local-Site-A/lib/jfreechart-1.0.5.jar"/>
		<jar href="http://localhost/Local-Site-A/lib/jfreechart-1.0.5-experimental.jar"/>
		<jar href="http://localhost/Local-Site-A/lib/servlet.jar"/>
		<jar href="http://localhost/Local-Site-A/lib/jcommon-1.0.9.jar"/>
		<jar href="http://localhost/Local-Site-A/lib/jfreechart-1.0.5-swt.jar"/>
		<jar href="http://localhost/Local-Site-A/lib/swtgraphics2d.jar"/>
		<jar href="http://localhost/Local-Site-A/sqljdbc.jar"/>
		<jar href="http://localhost/Local-Site-A/testNativeLib.jar"/>
	</resources>

	<application-desc main-class="MonMenu" />

</jnlp>

Ensuite je lance JWS, et j'obtiens :
Je mets toutes les étapes :
http://cjoint.com/data/gCpuOEZfYj.htm
http://cjoint.com/data/gCpwrohVRe.htm
http://cjoint.com/data/gCpxEgtlXM.htm
http://cjoint.com/data/gCpyYfLQYX.htm
et pour l'exception, c'est :

java.lang.reflect.InvocationTargetException
	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 com.sun.javaws.Launcher.executeApplication(Unknown Source)
	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
	at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
	at com.sun.javaws.Launcher.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ExceptionInInitializerError
	at com.microsoft.sqlserver.jdbc.SQLServerConnection$1LogonProcessor.<init>(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendLogon(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.logon(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.access$000(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection$LogonCommand.doExecute(Unknown Source)
	at com.microsoft.sqlserver.jdbc.TDSCommand.execute(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
	at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at java.sql.DriverManager.getConnection(Unknown Source)
	at MonMenu.main(MonMenu.java:605)
	... 9 more
Caused by: java.security.AccessControlException: access denied (java.lang.RuntimePermission loadLibrary.sqljdbc_auth)
	at java.security.AccessControlContext.checkPermission(Unknown Source)
	at java.security.AccessController.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkLink(Unknown Source)
	at java.lang.Runtime.loadLibrary0(Unknown Source)
	at java.lang.System.loadLibrary(Unknown Source)
	at com.microsoft.sqlserver.jdbc.AuthenticationJNI.<clinit>(Unknown Source)
	... 23 more

Filtered HTML

Plain text

CAPTCHA
Cette question permet de vérifier que vous n'êtes pas un robot spammeur :-)
 EEEE  RRRR   PPPP   DDD   RRRR  
E R R P P D D R R
EEE RRRR PPPP D D RRRR
E R R P D D R R
EEEE R RR P DDD R RR