IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JPA Java Discussion :

Ne sauve pas en base


Sujet :

JPA Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti Avatar de mmathieu
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Février 2005
    Messages
    35
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Suisse

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Février 2005
    Messages : 35
    Par défaut Ne sauve pas en base
    Bonjour à tous!
    je suis en train d'essayer JPA au lieu d'utiliser directement Hibernate.

    J'ai un souci: après l'appel de la méthode persist(), rien n'est sauvé en base.
    Pourtant aucun message d'erreur n'est affiché..

    Mon code est tout bête: style HelloWorld. Je vous met les logs du serveur où l'on peut voir que le binding se passe bien.. Mais ne maîtrisant pas tous les paramètres, peut-être que j'ai loupé un config dans mon fichier de config.

    Merci d'avance pour votre aide!

    persistence.xml
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     
    <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
        <persistence-unit name = "TestJPA">
    		<provider>org.hibernate.ejb.HibernatePersistence</provider>
    		<jta-data-source>java:/testJPA</jta-data-source>
    		<class>ch.clio.ejb3.jpa.WebSite</class>
    		<properties>
    		    <property name="hibernate.show_sql" value="true" />
    		    <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup" />
    		</properties>
    	</persistence-unit>
    </persistence>
    L'Entity à sauver
    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
     
    package ch.clio.ejb3.jpa;
     
    import javax.persistence.Entity;
    import javax.persistence.Id;
    import javax.persistence.Table;
     
    @Entity
    @Table(name="WebSite")
    public class WebSite {
     
    	private Integer id;
     
    	private String url;
     
    	@Id
    	public Integer getId() {
    		return id;
    	}
     
    	public void setId(Integer id) {
    		this.id = id;
    	}
     
    	public String getUrl() {
    		return url;
    	}
     
    	public void setUrl(String url) {
    		this.url = url;
    	}
     
    	public String toString() {
    		return "ID = " + id + "; URL = " + url;
    	}
    }
    L'appel à la persistence JPA (depuis un EJB stateless)
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("TestJPA");
    EntityManager em = emf.createEntityManager();
    em.persist(webSite);
    Les logs du serveur
    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
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
     
    11:35:30,871 INFO  [Server] Starting JBoss (MX MicroKernel)...
    11:35:30,871 INFO  [Server] Release ID: JBoss [Zion] 4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)
    11:35:30,871 INFO  [Server] Home Dir: C:\jboss-4.0.5.GA
    11:35:30,871 INFO  [Server] Home URL: file:/C:/jboss-4.0.5.GA/
    11:35:30,871 INFO  [Server] Patch URL: null
    11:35:30,871 INFO  [Server] Server Name: default
    11:35:30,871 INFO  [Server] Server Home Dir: C:\jboss-4.0.5.GA\server\default
    11:35:30,871 INFO  [Server] Server Home URL: file:/C:/jboss-4.0.5.GA/server/default/
    11:35:30,871 INFO  [Server] Server Log Dir: C:\jboss-4.0.5.GA\server\default\log
    11:35:30,871 INFO  [Server] Server Temp Dir: C:\jboss-4.0.5.GA\server\default\tmp
    11:35:30,871 INFO  [Server] Root Deployment Filename: jboss-service.xml
    11:35:31,933 INFO  [ServerInfo] Java version: 1.6.0_12,Sun Microsystems Inc.
    11:35:31,933 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Client VM 11.2-b01,Sun Microsystems Inc.
    11:35:31,933 INFO  [ServerInfo] OS-System: Windows XP 5.1,x86
    11:35:32,777 INFO  [Server] Core system initialized
    11:35:43,105 INFO  [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
    11:35:44,839 INFO  [SocketServerInvoker] Invoker started for locator: InvokerLocator [socket://192.168.1.119:3873/]
    11:35:51,948 INFO  [ServiceEndpointManager] WebServices: jbossws-1.0.3.SP1 (date=200609291417)
    11:35:53,948 INFO  [SnmpAgentService] SNMP agent going active
    11:35:54,370 INFO  [WebService] Using RMI server codebase: http://HP17077253031:8083/
    11:35:55,714 INFO  [CorbaNamingService] Naming: [IOR:000000000000002B49444C3A6F6D672E6F72672F436F734E616D696E672F4E616D696E67436F6E746578744578743A312E3000000000000200000000000000E8000102000000000E3139322E3136382E312E313139000DC8000000114A426F73732F4E616D696E672F726F6F74000000000000050000000000000008000000004A414300000000010000001C00000000000100010000000105010001000101090000000105010001000000210000006000000000000000010000000000000024000000200000007E00000000000000010000000E3139322E3136382E312E313139000DC900400000000000000000001004010008060667810201010100000000000000000000000000000000000000000000002000000004000000000000001F0000000400000003000000010000002000000000000000020000002000000004000000000000001F0000000400000003]
    11:35:55,870 INFO  [CorbaTransactionService] TransactionFactory: [IOR:000000000000003049444C3A6F72672F6A626F73732F746D2F69696F702F5472616E73616374696F6E466163746F72794578743A312E30000000000200000000000000E8000102000000000E3139322E3136382E312E313139000DC8000000144A426F73732F5472616E73616374696F6E732F46000000050000000000000008000000004A414300000000010000001C00000000000100010000000105010001000101090000000105010001000000210000006000000000000000010000000000000024000000200000007E00000000000000010000000E3139322E3136382E312E313139000DC900400000000000000000001004010008060667810201010100000000000000000000000000000000000000000000002000000004000000000000001F0000000400000003000000010000002000000000000000020000002000000004000000000000001F0000000400000003]
    11:35:57,417 INFO  [Embedded] Catalina naming disabled
    11:35:57,463 INFO  [ClusterRuleSetFactory] Unable to find a cluster rule set in the classpath. Will load the default rule set.
    11:35:57,463 INFO  [ClusterRuleSetFactory] Unable to find a cluster rule set in the classpath. Will load the default rule set.
    11:35:57,885 INFO  [Http11BaseProtocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
    11:35:57,885 INFO  [Catalina] Initialization processed in 422 ms
    11:35:57,885 INFO  [StandardService] Starting service jboss.web
    11:35:57,901 INFO  [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.5.20
    11:35:57,917 INFO  [StandardHost] XML validation disabled
    11:35:57,932 INFO  [Catalina] Server startup in 47 ms
    11:35:58,338 INFO  [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=.../deploy/http-invoker.sar/invoker.war/
    11:35:58,760 INFO  [WebappLoader] Dual registration of jndi stream handler: factory already defined
    11:35:59,229 INFO  [TomcatDeployer] deploy, ctxPath=/, warUrl=.../deploy/jbossweb-tomcat55.sar/ROOT.war/
    11:35:59,479 INFO  [TomcatDeployer] deploy, ctxPath=/jbossws, warUrl=.../tmp/deploy/tmp5956490981702238967jbossws-context-exp.war/
    11:35:59,745 INFO  [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=.../deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
    11:35:59,917 INFO  [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=.../deploy/management/console-mgr.sar/web-console.war/
    11:36:00,260 INFO  [[/web-console]] JSR77 J2EE Apps: Failed to init plugin, null
    11:36:00,260 INFO  [[/web-console]] JMS Message: Failed to init plugin, null
    11:36:00,260 INFO  [[/web-console]] SystemFolder: Failed to init plugin, null
    11:36:00,260 INFO  [[/web-console]] JSR77 EJBModules and EJBs: Failed to init plugin, null
    11:36:00,260 INFO  [[/web-console]] MonitorsFolder: Failed to init plugin, null
    11:36:00,276 INFO  [[/web-console]] JSR77 WebModule: Failed to init plugin, null
    11:36:00,276 INFO  [[/web-console]] JSR77 Domains and Servers: Failed to init plugin, null
    11:36:00,292 INFO  [[/web-console]] J2EEFolder: Failed to init plugin, null
    11:36:00,292 INFO  [[/web-console]] UCLs: Failed to init plugin, null
    11:36:00,292 INFO  [[/web-console]] MBeans: Failed to init plugin, null
    11:36:00,292 INFO  [[/web-console]] AOPFolder: Failed to init plugin, null
    11:36:01,541 INFO  [MailService] Mail Service bound to java:/Mail
    11:36:02,245 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-local-jdbc.rar
    11:36:02,354 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-xa-jdbc.rar
    11:36:02,385 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-local-jdbc.rar
    11:36:02,416 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-xa-jdbc.rar
    11:36:02,588 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jms/jms-ra.rar
    11:36:02,635 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/mail-ra.rar
    11:36:02,713 INFO  [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/quartz-ra.rar
    11:36:02,729 INFO  [QuartzResourceAdapter] start quartz!!!
    11:36:03,010 INFO  [SimpleThreadPool] Job execution threads will use class loader of thread: main
    11:36:03,026 INFO  [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
    11:36:03,026 INFO  [RAMJobStore] RAMJobStore initialized.
    11:36:03,026 INFO  [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
    11:36:03,026 INFO  [StdSchedulerFactory] Quartz scheduler version: 1.5.2
    11:36:03,026 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
    11:36:04,416 INFO  [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
    11:36:04,838 INFO  [A] Bound to JNDI name: queue/A
    11:36:04,838 INFO  [B] Bound to JNDI name: queue/B
    11:36:04,838 INFO  [C] Bound to JNDI name: queue/C
    11:36:04,838 INFO  [D] Bound to JNDI name: queue/D
    11:36:04,838 INFO  [ex] Bound to JNDI name: queue/ex
    11:36:04,870 INFO  [testTopic] Bound to JNDI name: topic/testTopic
    11:36:04,870 INFO  [securedTopic] Bound to JNDI name: topic/securedTopic
    11:36:04,870 INFO  [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
    11:36:04,870 INFO  [testQueue] Bound to JNDI name: queue/testQueue
    11:36:04,916 INFO  [UILServerILService] JBossMQ UIL service available at : /0.0.0.0:8093
    11:36:04,948 INFO  [DLQ] Bound to JNDI name: queue/DLQ
    11:36:04,948 INFO  [MyMessageQueue] Bound to JNDI name: jms/MyMessageQueue
    11:36:05,088 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
    11:36:05,151 INFO  [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=testJPA' to JNDI name 'java:testJPA'
    11:36:05,260 INFO  [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
    11:36:05,635 INFO  [EARDeployer] Init J2EE application: file:/C:/jboss-4.0.5.GA/server/default/deploy/SameJBMTestEJB3EAR.ear
    11:36:05,854 INFO  [Ejb3Deployment] EJB3 deployment time took: 110
    11:36:06,010 INFO  [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=SameJBMTestEJB3EAR.ear,jar=SameJBMTestEJB3.jar,name=MicTimeBean,service=EJB3 with dependencies:
    11:36:06,119 INFO  [EJBContainer] STARTED EJB: ch.clio.ejb3.MicTimeBean ejbName: MicTimeBean
    11:36:06,135 INFO  [EJB3Deployer] Deployed: file:/C:/jboss-4.0.5.GA/server/default/tmp/deploy/tmp4092848612758772540SameJBMTestEJB3EAR.ear-contents/SameJBMTestEJB3.jar
    11:36:06,135 INFO  [EARDeployer] Started J2EE application: file:/C:/jboss-4.0.5.GA/server/default/deploy/SameJBMTestEJB3EAR.ear
    11:36:06,198 INFO  [Http11BaseProtocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
    11:36:06,244 INFO  [ChannelSocket] Port busy 8009 java.net.BindException: Address already in use: JVM_Bind
    11:36:06,244 INFO  [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8010
    11:36:06,260 INFO  [JkMain] Jk running ID=1 time=0/31  config=null
    11:36:06,276 INFO  [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)] Started in 35s:390ms
    11:36:21,213 INFO  [EARDeployer] Undeploying J2EE application, destroy step: file:/C:/jboss-4.0.5.GA/server/default/deploy/SameJBMTestEJB3EAR.ear
    11:36:21,213 INFO  [EARDeployer] Undeployed J2EE application: file:/C:/jboss-4.0.5.GA/server/default/deploy/SameJBMTestEJB3EAR.ear
    11:36:21,228 INFO  [EARDeployer] Init J2EE application: file:/C:/jboss-4.0.5.GA/server/default/deploy/SameJBMTestEJB3EAR.ear
    11:36:21,260 INFO  [Ejb3Deployment] EJB3 deployment time took: 16
    11:36:21,260 INFO  [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=SameJBMTestEJB3EAR.ear,jar=SameJBMTestEJB3.jar,name=MicTimeBean,service=EJB3 with dependencies:
    11:36:21,260 INFO  [EJBContainer] STARTED EJB: ch.clio.ejb3.MicTimeBean ejbName: MicTimeBean
    11:36:21,275 INFO  [EJB3Deployer] Deployed: file:/C:/jboss-4.0.5.GA/server/default/tmp/deploy/tmp6680025626630677015SameJBMTestEJB3EAR.ear-contents/SameJBMTestEJB3.jar
    11:36:21,291 INFO  [EARDeployer] Started J2EE application: file:/C:/jboss-4.0.5.GA/server/default/deploy/SameJBMTestEJB3EAR.ear
    11:36:36,400 INFO  [EARDeployer] Init J2EE application: file:/C:/jboss-4.0.5.GA/server/default/deploy/MicTestEJB3EAR.ear
    11:36:36,665 INFO  [Ejb3Deployment] EJB3 deployment time took: 250
    11:36:36,665 INFO  [JmxKernelAbstraction] installing MBean: persistence.units:ear=MicTestEJB3EAR.ear,jar=MicTestEJB3.jar,unitName=TestJPA with dependencies:
    11:36:36,681 INFO  [JmxKernelAbstraction] 	jboss.jca:name=testJPA,service=DataSourceBinding
    11:36:36,806 INFO  [Version] Hibernate EntityManager 3.2.0.GA
    11:36:36,962 INFO  [Version] Hibernate Annotations 3.2.0.GA
    11:36:36,993 INFO  [Environment] Hibernate 3.2.0.ga
    11:36:37,009 INFO  [Environment] hibernate.properties not found
    11:36:37,009 INFO  [Environment] Bytecode provider name : javassist
    11:36:37,009 INFO  [Environment] using JDK 1.4 java.sql.Timestamp handling
    11:36:37,384 INFO  [Ejb3Configuration] found EJB3 Entity bean: ch.clio.ejb3.jpa.WebSite
    11:36:37,384 WARN  [Ejb3Configuration] Persistence provider caller does not implements the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
    11:36:37,556 INFO  [Configuration] Reading mappings from resource: META-INF/orm.xml
    11:36:37,556 INFO  [Ejb3Configuration] [PersistenceUnit: TestJPA] no META-INF/orm.xml found
    11:36:37,775 INFO  [AnnotationBinder] Binding entity from annotated class: ch.clio.ejb3.jpa.WebSite
    11:36:37,822 INFO  [EntityBinder] Bind entity ch.clio.ejb3.jpa.WebSite on table WebSite
    11:36:38,009 INFO  [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
    11:36:38,009 INFO  [InjectedDataSourceConnectionProvider] Using provided datasource
    11:36:38,290 INFO  [SettingsFactory] RDBMS: MySQL, version: 5.1.34-community
    11:36:38,290 INFO  [SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.7 ( Revision: ${svn.Revision} )
    11:36:38,368 INFO  [Dialect] Using dialect: org.hibernate.dialect.MySQLDialect
    11:36:38,384 INFO  [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
    11:36:38,384 INFO  [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
    11:36:38,384 INFO  [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
    11:36:38,384 INFO  [SettingsFactory] Automatic flush during beforeCompletion(): disabled
    11:36:38,384 INFO  [SettingsFactory] Automatic session close at end of transaction: disabled
    11:36:38,384 INFO  [SettingsFactory] JDBC batch size: 15
    11:36:38,384 INFO  [SettingsFactory] JDBC batch updates for versioned data: disabled
    11:36:38,400 INFO  [SettingsFactory] Scrollable result sets: enabled
    11:36:38,400 INFO  [SettingsFactory] JDBC3 getGeneratedKeys(): enabled
    11:36:38,400 INFO  [SettingsFactory] Connection release mode: auto
    11:36:38,415 INFO  [SettingsFactory] Maximum outer join fetch depth: 2
    11:36:38,415 INFO  [SettingsFactory] Default batch fetch size: 1
    11:36:38,415 INFO  [SettingsFactory] Generate SQL with comments: disabled
    11:36:38,415 INFO  [SettingsFactory] Order SQL updates by primary key: disabled
    11:36:38,415 INFO  [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
    11:36:38,447 INFO  [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
    11:36:38,447 INFO  [SettingsFactory] Query language substitutions: {}
    11:36:38,447 INFO  [SettingsFactory] JPA-QL strict compliance: enabled
    11:36:38,447 INFO  [SettingsFactory] Second-level cache: enabled
    11:36:38,447 INFO  [SettingsFactory] Query cache: disabled
    11:36:38,447 INFO  [SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider
    11:36:38,447 INFO  [SettingsFactory] Optimize cache for minimal puts: disabled
    11:36:38,447 INFO  [SettingsFactory] Structured second-level cache entries: disabled
    11:36:38,447 INFO  [SettingsFactory] Echoing all SQL to stdout
    11:36:38,447 INFO  [SettingsFactory] Statistics: disabled
    11:36:38,447 INFO  [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
    11:36:38,447 INFO  [SettingsFactory] Default entity-mode: pojo
    11:36:38,493 INFO  [SessionFactoryImpl] building session factory
    11:36:38,947 INFO  [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
    11:36:38,947 INFO  [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
    11:36:38,962 INFO  [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=MicTestEJB3EAR.ear,jar=MicTestEJB3.jar,name=MicTestBean,service=EJB3 with dependencies:
    11:36:38,962 INFO  [JmxKernelAbstraction] 	jboss.j2ee:ear=SameJBMTestEJB3EAR.ear,jar=SameJBMTestEJB3.jar,name=MicTimeBean,service=EJB3
    11:36:38,962 INFO  [EJBContainer] STARTED EJB: ch.clio.ejb3.MicTestBean ejbName: MicTestBean
    11:36:38,993 INFO  [EJB3Deployer] Deployed: file:/C:/jboss-4.0.5.GA/server/default/tmp/deploy/tmp3997098147468546088MicTestEJB3EAR.ear-contents/MicTestEJB3.jar
    11:36:39,025 INFO  [EARDeployer] Started J2EE application: file:/C:/jboss-4.0.5.GA/server/default/deploy/MicTestEJB3EAR.ear
    Logs après l'appel à la méthode persist()
    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
     
    11:42:29,170 INFO  [STDOUT] INTERCEPTOR CLASS
    11:42:29,170 INFO  [STDOUT] INTERCEPTOR METHOD
    11:42:29,435 INFO  [AnnotationBinder] Binding entity from annotated class: ch.clio.ejb3.jpa.WebSite
    11:42:29,435 INFO  [EntityBinder] Bind entity ch.clio.ejb3.jpa.WebSite on table WebSite
    11:42:29,435 INFO  [NamingHelper] JNDI InitialContext properties:{}
    11:42:29,451 INFO  [DatasourceConnectionProvider] Using datasource: java:/testJPA
    11:42:29,451 INFO  [SettingsFactory] RDBMS: MySQL, version: 5.1.34-community
    11:42:29,451 INFO  [SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.7 ( Revision: ${svn.Revision} )
    11:42:29,451 INFO  [Dialect] Using dialect: org.hibernate.dialect.MySQLDialect
    11:42:29,451 INFO  [TransactionFactoryFactory] Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
    11:42:29,451 INFO  [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
    11:42:29,451 INFO  [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
    11:42:29,451 INFO  [SettingsFactory] Automatic flush during beforeCompletion(): disabled
    11:42:29,451 INFO  [SettingsFactory] Automatic session close at end of transaction: disabled
    11:42:29,451 INFO  [SettingsFactory] JDBC batch size: 15
    11:42:29,451 INFO  [SettingsFactory] JDBC batch updates for versioned data: disabled
    11:42:29,451 INFO  [SettingsFactory] Scrollable result sets: enabled
    11:42:29,451 INFO  [SettingsFactory] JDBC3 getGeneratedKeys(): enabled
    11:42:29,451 INFO  [SettingsFactory] Connection release mode: auto
    11:42:29,451 INFO  [SettingsFactory] Maximum outer join fetch depth: 2
    11:42:29,451 INFO  [SettingsFactory] Default batch fetch size: 1
    11:42:29,451 INFO  [SettingsFactory] Generate SQL with comments: disabled
    11:42:29,451 INFO  [SettingsFactory] Order SQL updates by primary key: disabled
    11:42:29,451 INFO  [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
    11:42:29,451 INFO  [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
    11:42:29,451 INFO  [SettingsFactory] Query language substitutions: {}
    11:42:29,451 INFO  [SettingsFactory] JPA-QL strict compliance: enabled
    11:42:29,451 INFO  [SettingsFactory] Second-level cache: enabled
    11:42:29,451 INFO  [SettingsFactory] Query cache: disabled
    11:42:29,451 INFO  [SettingsFactory] Cache provider: org.hibernate.cache.NoCacheProvider
    11:42:29,451 INFO  [SettingsFactory] Optimize cache for minimal puts: disabled
    11:42:29,451 INFO  [SettingsFactory] Structured second-level cache entries: disabled
    11:42:29,451 INFO  [SettingsFactory] Echoing all SQL to stdout
    11:42:29,451 INFO  [SettingsFactory] Statistics: disabled
    11:42:29,451 INFO  [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
    11:42:29,451 INFO  [SettingsFactory] Default entity-mode: pojo
    11:42:29,451 INFO  [SessionFactoryImpl] building session factory
    11:42:29,451 INFO  [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
    11:42:29,451 INFO  [NamingHelper] JNDI InitialContext properties:{}

  2. #2
    Membre averti Avatar de mmathieu
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Février 2005
    Messages
    35
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Suisse

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Février 2005
    Messages : 35
    Par défaut
    La solution: se faire injecter le PersistenceContext

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    @PersistenceContext private EntityManager em;

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. RMAN ne se connecte pas à la base cible fermée
    Par big1 dans le forum Recovery Manager
    Réponses: 2
    Dernier message: 19/02/2007, 13h14
  2. [Cookies] Pas de base en secu et pourtant
    Par gretch dans le forum Langage
    Réponses: 3
    Dernier message: 18/07/2006, 16h34
  3. MySQL ne trouve pas la base de données
    Par alfigor dans le forum Outils
    Réponses: 3
    Dernier message: 26/06/2006, 13h42
  4. je trouve pas ma base !
    Par MIKKA dans le forum PostgreSQL
    Réponses: 12
    Dernier message: 09/03/2006, 15h19
  5. DBListBox n'affiche pas ma base de données !
    Par vins91 dans le forum C++Builder
    Réponses: 3
    Dernier message: 15/03/2005, 22h35

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo