Bonjour,

J'essaye actuellement d'intégrer mon Applet JAVA utilisant Spring / Hibernate / JPA.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<html>
 
	<head>
		<title></title>
	</head>
 
	<body style = "background-color : #dcdcdc">
 
		<center>
 
			<applet 
 
			code    = "client.Api.class" 
			archive = 
			"
			Buggup8.jar,
			lib\divers\derbyclient.jar,
			lib\divers\ehcache-1.2.4.jar,
			lib\divers\ehcache-spring-annotations-1.1.0.jar,
			lib\divers\geronimo-jpa_2.0_spec-1.1.jar,
			lib\divers\hsqldb.jar,
			lib\divers\jaybird-full-2.1.1.jar,
			lib\divers\jcl-over-slf4j-1.7.5-sources.jar,
			lib\divers\jcl-over-slf4j-1.7.5.jar,
			lib\divers\jul-to-slf4j-1.7.5-sources.jar,
			lib\divers\jul-to-slf4j-1.7.5.jar,
			lib\divers\log4j-1.2.13.jar,
			lib\divers\log4j-over-slf4j-1.7.5-sources.jar,
			lib\divers\log4j-over-slf4j-1.7.5.jar,
			lib\divers\logback-core-0.9.29.jar,
			lib\divers\mysql-connector-java-5.0.5-bin.jar,
			lib\divers\ojdbc14.jar,
			lib\divers\postgresql-8.2-505.jdbc4.jar,
			lib\divers\slf4j-api-1.7.5.jar,
			lib\divers\slf4j-simple-1.7.5.jar,
			lib\divers\sqljdbc.jar,
			lib\divers\testng-5.5-jdk15.jar,
			lib\hibernate\antlr-2.7.6.jar,
			lib\hibernate\asm-attrs.jar,
			lib\hibernate\asm.jar,
			lib\hibernate\c3p0-0.9.0.jar,
			lib\hibernate\cglib-2.1.3.jar,
			lib\hibernate\commons-collections-2.1.1.jar,
			lib\hibernate\commons-logging-1.0.4.jar,
			lib\hibernate\dom4j-1.6.1.jar,
			lib\hibernate\ejb3-persistence.jar,
			lib\hibernate\hibernate-annotations.jar,
			lib\hibernate\hibernate-entitymanager.jar,
			lib\hibernate\hibernate-tools.jar,
			lib\hibernate\hibernate3.jar,
			lib\hibernate\javassist.jar,
			lib\hibernate\jboss-archive-browsing.jar,
			lib\hibernate\jta.jar,
			lib\jbossejb3\hibernate-all.jar,
			lib\jbossejb3\jboss-ejb3-all.jar,
			lib\jbossejb3\thirdparty-all.jar,
			lib\spring\aopalliance.jar,
			lib\spring\com.springsource.org.aopalliance-sources-1.0.0.jar,
			lib\spring\commons-codec-1.6-javadoc.jar,
			lib\spring\commons-codec-1.6-sources.jar,
			lib\spring\commons-codec-1.6-tests.jar,
			lib\spring\commons-codec-1.6.jar,
			lib\spring\commons-collections-2.1.1.jar,
			lib\spring\commons-dbcp.jar,
			lib\spring\commons-logging-1.0.4.jar,
			lib\spring\commons-pool.jar,
			lib\spring\org.springframework.aop-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.aop-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.asm-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.asm-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.aspects-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.aspects-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.beans-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.beans-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.context-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.context-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.context.support-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.context.support-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.core-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.core-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.expression-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.expression-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.instrument-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.instrument-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.instrument.tomcat-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.instrument.tomcat-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.jdbc-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.jdbc-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.jms-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.jms-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.orm-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.orm-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.oxm-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.oxm-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.test-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.test-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.transaction-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.transaction-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.web-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.web-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.web.portlet-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.web.portlet-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.web.servlet-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.web.servlet-sources-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.web.struts-3.1.0.RELEASE.jar,
			lib\spring\org.springframework.web.struts-sources-3.1.0.RELEASE.jar,
			lib\toplink\toplink-essentials-agent.jar,
			lib\toplink\toplink-essentials.jar
			" 
			width   = "1200" 
			height  = "800" 
 
			>
 
				  <param name="folderNameOfRacine" value = "GraineHabitat" />
				  <param name="isHeight" value = "800" />
				  <param name="isWidth" value = "1200" />
 
			 </applet>
 
		 </center>
 
	</body>
 
</html>
Mon applet tourne comme il faut sur Eclipse, mais une fois lancée dans l'environnement du navigateur Web, j'ai cette erreur finale :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0' defined in class path resource [spring-config.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [spring-config.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: error trying to scan <jar-file>: http://localhost/buggup/Buggup8.jar
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:728)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:449)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
	at client.Api.init(Api.java:80)
	at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source)
	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [spring-config.xml]: Invocation of init method failed; nested exception is java.lang.RuntimeException: error trying to scan <jar-file>: http://localhost/buggup/Buggup8.jar
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:400)
	at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:275)
	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.detectPersistenceExceptionTranslators(PersistenceExceptionTranslationInterceptor.java:139)
	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.<init>(PersistenceExceptionTranslationInterceptor.java:79)
	at org.springframework.dao.annotation.PersistenceExceptionTranslationAdvisor.<init>(PersistenceExceptionTranslationAdvisor.java:70)
	at org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor.setBeanFactory(PersistenceExceptionTranslationPostProcessor.java:103)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeAwareMethods(AbstractAutowireCapableBeanFactory.java:1475)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.access$0(AbstractAutowireCapableBeanFactory.java:1466)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$5.run(AbstractAutowireCapableBeanFactory.java:1437)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1435)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	... 13 more
Caused by: java.lang.RuntimeException: error trying to scan <jar-file>: http://localhost/buggup/Buggup8.jar
	at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:597)
	at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:341)
	at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:126)
	at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:257)
	at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:310)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$6.run(AbstractAutowireCapableBeanFactory.java:1504)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1502)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
	... 31 more
Caused by: java.lang.RuntimeException: NOT IMPLEMENTED
	at org.jboss.util.file.ArchiveBrowser.getBrowser(Unknown Source)
	at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:588)
	... 39 more
Sachant que la ligne 80 de Api.class est celle-ci :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
ApplicationContext ctx = new ClassPathXmlApplicationContext("spring-config.xml");
et que mon fichier de configuration Spring nommé "spring-config.xml" est celui-ci :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
 
<?xml version="1.0" encoding="UTF-8"?>
<beans 
	xmlns="http://www.springframework.org/schema/beans" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:ehcache="http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring"
    xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="
		http://www.springframework.org/schema/beans 
     	http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
     	http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring
     	http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.2.xsd
     	http://www.springframework.org/schema/tx 
		http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">
 
	<!--  Cache de second niveau : ehcache -->
	<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
	  <property name="configLocation">
	    <value>classpath:ehcache.xml</value>
	  </property>
	</bean>
 
	<bean id="methodCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
	  <property name="cacheManager">
	    <ref local="cacheManager"/>
	  </property>
	  <property name="cacheName">
	    <value>elementCache</value>
	  </property>
	</bean>
 
	<bean id="methodCache2" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
	  <property name="cacheManager">
	    <ref local="cacheManager"/>
	  </property>
	  <property name="cacheName">
	    <value>personneCache</value>
	  </property>
	</bean>
 
	<!-- couches applicatives -->
	<bean id="dao" class="dao.Dao" />
	<bean id="service" class="service.Service">
		<property name="dao" ref="dao" />
	</bean>
 
	<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
		<property name="dataSource" ref="dataSource" />
		<property name="jpaVendorAdapter">
			<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
				<!-- 
					<property name="showSql" value="true" />
				-->
				<property name="databasePlatform" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
				<property name="generateDdl" value="true" />
			</bean>
		</property>
		<property name="loadTimeWeaver">
			<bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" />
		</property>
 
	</bean>
 
	<!-- la source de donnéees DBCP -->
	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
		<property name="driverClassName" value="com.mysql.jdbc.Driver" />
		<property name="url" value="jdbc:mysql://localhost:3306/jpaTest" />
		<property name="username" value="root" />
		<property name="password" value="" />
	</bean>
 
	<!-- le gestionnaire de transactions -->
	<tx:annotation-driven transaction-manager="txManager" />
	<bean id="txManager" class="org.springframework.orm.jpa.JpaTransactionManager">
		<property name="entityManagerFactory" ref="entityManagerFactory" />
	</bean>
 
	<!-- traduction des exceptions -->
	<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
 
	<!-- persistence -->
	<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
 
</beans>
Quelqu'un pourrais m'aider, s'il vous plait, à résoudre ce problème ? Merci d'avance.