Probleme mit Datenbankkommunikation (EJB, JBoss, Eclipse)

Eiswolf0815

Grünschnabel
Hallo,

ich habe folgendes Problem: Ich möchte mittels Persistence API (bzw. Hibernate) eine Bean in einer mySQL Datenbank speichern.

Ich benutze Eclipse 3.4, JBoss 5.0.1GA (+Hibernate) und mySQL 5.1. In Eclipse habe ich ein EJB Project erstellt, was ich auch aufrufen kann. Einzig die Speicherung in der Datenbank funktioniert nicht. Mittels Rechtsklick aufs Project / JPA Tools / Generate DDL... kann ich automatisch die entsprechenden Tabellen in der Datenbank anlegen. Automatisch beim Serverstart funktioniert das nicht, es kommt jedoch auch keine Fehlermeldung. Starte ich den Server und rufe die Bean auf kommt folgendes:

Code:
16:18:36,251 INFO  [ServerImpl] Starting JBoss (Microcontainer)...
16:18:36,251 INFO  [ServerImpl] Release ID: JBoss [Morpheus] 5.0.1.GA (build: SVNTag=JBoss_5_0_1_GA date=200902231221)
16:18:36,251 INFO  [ServerImpl] Bootstrap URL: null
16:18:36,251 INFO  [ServerImpl] Home Dir: D:\JBoss\Java5\jboss-5.0.1.GA
16:18:36,251 INFO  [ServerImpl] Home URL: file:/D:/JBoss/Java5/jboss-5.0.1.GA/
16:18:36,251 INFO  [ServerImpl] Library URL: file:/D:/JBoss/Java5/jboss-5.0.1.GA/lib/
16:18:36,251 INFO  [ServerImpl] Patch URL: null
16:18:36,251 INFO  [ServerImpl] Common Base URL: file:/D:/JBoss/Java5/jboss-5.0.1.GA/common/
16:18:36,251 INFO  [ServerImpl] Common Library URL: file:/D:/JBoss/Java5/jboss-5.0.1.GA/common/lib/
16:18:36,251 INFO  [ServerImpl] Server Name: default
16:18:36,251 INFO  [ServerImpl] Server Base Dir: D:\JBoss\Java5\jboss-5.0.1.GA\server
16:18:36,251 INFO  [ServerImpl] Server Base URL: file:/D:/JBoss/Java5/jboss-5.0.1.GA/server/
16:18:36,251 INFO  [ServerImpl] Server Config URL: file:/D:/JBoss/Java5/jboss-5.0.1.GA/server/default/conf/
16:18:36,251 INFO  [ServerImpl] Server Home Dir: D:\JBoss\Java5\jboss-5.0.1.GA\server\default
16:18:36,251 INFO  [ServerImpl] Server Home URL: file:/D:/JBoss/Java5/jboss-5.0.1.GA/server/default/
16:18:36,251 INFO  [ServerImpl] Server Data Dir: D:\JBoss\Java5\jboss-5.0.1.GA\server\default\data
16:18:36,251 INFO  [ServerImpl] Server Library URL: file:/D:/JBoss/Java5/jboss-5.0.1.GA/server/default/lib/
16:18:36,251 INFO  [ServerImpl] Server Log Dir: D:\JBoss\Java5\jboss-5.0.1.GA\server\default\log
16:18:36,251 INFO  [ServerImpl] Server Native Dir: D:\JBoss\Java5\jboss-5.0.1.GA\server\default\tmp\native
16:18:36,251 INFO  [ServerImpl] Server Temp Dir: D:\JBoss\Java5\jboss-5.0.1.GA\server\default\tmp
16:18:36,251 INFO  [ServerImpl] Server Temp Deploy Dir: D:\JBoss\Java5\jboss-5.0.1.GA\server\default\tmp\deploy
16:18:36,704 INFO  [ServerImpl] Starting Microcontainer, bootstrapURL=file:/D:/JBoss/Java5/jboss-5.0.1.GA/server/default/conf/bootstrap.xml
16:18:37,187 INFO  [VFSCacheFactory] Initializing VFSCache [org.jboss.virtual.plugins.cache.CombinedVFSCache]
16:18:37,187 INFO  [VFSCacheFactory] Using VFSCache [CombinedVFSCache[real-cache: null]]
16:18:37,391 INFO  [CopyMechanism] VFS temp dir: D:\JBoss\Java5\jboss-5.0.1.GA\server\default\tmp
16:18:37,391 INFO  [ZipEntryContext] VFS force nested jars copy-mode is enabled.
16:18:38,078 INFO  [ServerInfo] Java version: 1.6.0_13,Sun Microsystems Inc.
16:18:38,078 INFO  [ServerInfo] Java Runtime: Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
16:18:38,078 INFO  [ServerInfo] Java VM: Java HotSpot(TM) Client VM 11.3-b02,Sun Microsystems Inc.
16:18:38,078 INFO  [ServerInfo] OS-System: Windows Vista 6.0,x86
16:18:38,124 INFO  [JMXKernel] Legacy JMX core initialized
16:18:39,357 INFO  [ProfileServiceImpl] Loading profile: default from: org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository@a0c486(root=D:\JBoss\Java5\jboss-5.0.1.GA\server, key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default])
16:18:39,357 INFO  [ProfileImpl] Using repository:org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository@a0c486(root=D:\JBoss\Java5\jboss-5.0.1.GA\server, key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default])
16:18:39,357 INFO  [ProfileServiceImpl] Loaded profile: ProfileImpl@8eed76{key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default]}
16:18:40,309 INFO  [WebService] Using RMI server codebase: http://127.0.0.1:8083/
16:18:44,646 INFO  [NativeServerConfig] JBoss Web Services - Stack Native Core
16:18:44,646 INFO  [NativeServerConfig] 3.0.5.GA
16:18:49,998 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@30044132{vfszip:/D:/JBoss/Java5/jboss-5.0.1.GA/server/default/deploy/LASAD.ear/LASADServer.jar/}
16:18:49,998 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@30044132{vfszip:/D:/JBoss/Java5/jboss-5.0.1.GA/server/default/deploy/LASAD.ear/LASADServer.jar/}
16:18:49,998 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@30044132{vfszip:/D:/JBoss/Java5/jboss-5.0.1.GA/server/default/deploy/LASAD.ear/LASADServer.jar/}
16:18:49,998 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@30044132{vfszip:/D:/JBoss/Java5/jboss-5.0.1.GA/server/default/deploy/LASAD.ear/LASADServer.jar/}
16:18:52,932 INFO  [JMXConnectorServerService] JMX Connector server: service:jmx:rmi://127.0.0.1/jndi/rmi://127.0.0.1:1090/jmxconnector
16:18:53,074 INFO  [MailService] Mail Service bound to java:/Mail
16:18:54,260 WARN  [JBossASSecurityMetadataStore] WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component which sucks messages from one node to another has not had its password changed from the installation default. Please see the JBoss Messaging user guide for instructions on how to do this.
16:18:54,276 WARN  [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.annotation.ManagementComponent
16:18:54,448 INFO  [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
16:18:54,448 INFO  [TransactionManagerService] Setting up property manager MBean and JMX layer
16:18:54,635 INFO  [TransactionManagerService] Initializing recovery manager
16:18:54,838 INFO  [TransactionManagerService] Recovery manager configured
16:18:54,838 INFO  [TransactionManagerService] Binding TransactionManager JNDI Reference
16:18:54,869 INFO  [TransactionManagerService] Starting transaction recovery manager
16:18:55,743 INFO  [Http11Protocol] Initializing Coyote HTTP/1.1 on http-127.0.0.1-8080
16:18:55,743 INFO  [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-127.0.0.1-8009
16:18:55,743 INFO  [StandardService] Starting service jboss.web
16:18:55,744 INFO  [StandardEngine] Starting Servlet Engine: JBoss Web/2.1.2.GA
16:18:55,806 INFO  [Catalina] Server startup in 104 ms
16:18:55,822 INFO  [TomcatDeployment] deploy, ctxPath=/jbossws
16:18:56,259 INFO  [TomcatDeployment] deploy, ctxPath=/invoker
16:18:56,305 INFO  [TomcatDeployment] deploy, ctxPath=/web-console
16:18:56,633 INFO  [RARDeployment] Required license terms exist, view vfszip:/D:/JBoss/Java5/jboss-5.0.1.GA/server/default/deploy/jboss-local-jdbc.rar/META-INF/ra.xml
16:18:56,649 INFO  [RARDeployment] Required license terms exist, view vfszip:/D:/JBoss/Java5/jboss-5.0.1.GA/server/default/deploy/jboss-xa-jdbc.rar/META-INF/ra.xml
16:18:56,680 INFO  [RARDeployment] Required license terms exist, view vfszip:/D:/JBoss/Java5/jboss-5.0.1.GA/server/default/deploy/jms-ra.rar/META-INF/ra.xml
16:18:56,695 INFO  [RARDeployment] Required license terms exist, view vfszip:/D:/JBoss/Java5/jboss-5.0.1.GA/server/default/deploy/mail-ra.rar/META-INF/ra.xml
16:18:56,727 INFO  [RARDeployment] Required license terms exist, view vfszip:/D:/JBoss/Java5/jboss-5.0.1.GA/server/default/deploy/quartz-ra.rar/META-INF/ra.xml
16:18:56,805 INFO  [SimpleThreadPool] Job execution threads will use class loader of thread: main
16:18:56,837 INFO  [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
16:18:56,837 INFO  [RAMJobStore] RAMJobStore initialized.
16:18:56,837 INFO  [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
16:18:56,837 INFO  [StdSchedulerFactory] Quartz scheduler version: 1.5.2
16:18:56,837 INFO  [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
16:18:57,788 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
16:18:58,178 INFO  [ServerPeer] JBoss Messaging 1.4.1.GA server [0] started
16:18:58,242 WARN  [ConnectionFactoryJNDIMapper] supportsFailover attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support failover
16:18:58,242 WARN  [ConnectionFactoryJNDIMapper] supportsLoadBalancing attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support load balancing
16:18:58,304 INFO  [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
16:18:58,304 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@7fb9e2 started
16:18:58,320 INFO  [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
16:18:58,320 INFO  [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
16:18:58,320 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@1f6015 started
16:18:58,320 INFO  [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
16:18:58,320 INFO  [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@1aa610e started
16:18:58,320 INFO  [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
16:18:58,429 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
16:18:58,491 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=MySqlDS' to JNDI name 'java:MySqlDS'
16:18:58,523 INFO  [TomcatDeployment] deploy, ctxPath=/
16:18:58,569 INFO  [TomcatDeployment] deploy, ctxPath=/jmx-console
16:18:59,225 INFO  [JBossASKernel] Created KernelDeployment for: LASADServer.jar
16:18:59,225 INFO  [JBossASKernel] installing bean: jboss.j2ee:ear=LASAD.ear,jar=LASADServer.jar,name=LASADServerBean,service=EJB3
16:18:59,225 INFO  [JBossASKernel]   with dependencies:
16:18:59,225 INFO  [JBossASKernel]   and demands:
16:18:59,225 INFO  [JBossASKernel] 	jboss.ejb:service=EJBTimerService
16:18:59,225 INFO  [JBossASKernel] 	persistence.unit:unitName=LASAD.ear/LASADServer.jar#LASADServer
16:18:59,225 INFO  [JBossASKernel]   and supplies:
16:18:59,225 INFO  [JBossASKernel] 	Class:lasad.ejb.LASADServerRemote
16:18:59,226 INFO  [JBossASKernel] 	jndi:LASAD/LASADServerBean/remote
16:18:59,226 INFO  [JBossASKernel] 	jndi:LASAD/LASADServerBean/local-lasad.ejb.LASADServerLocal
16:18:59,226 INFO  [JBossASKernel] 	jndi:LASAD/LASADServerBean/local
16:18:59,226 INFO  [JBossASKernel] 	Class:lasad.ejb.LASADServerLocal
16:18:59,226 INFO  [JBossASKernel] 	jndi:LASAD/LASADServerBean/remote-lasad.ejb.LASADServerRemote
16:18:59,226 INFO  [JBossASKernel] Added bean(jboss.j2ee:ear=LASAD.ear,jar=LASADServer.jar,name=LASADServerBean,service=EJB3) to KernelDeployment of: LASADServer.jar
16:18:59,272 INFO  [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=LASAD.ear/LASADServer.jar#LASADServer
16:18:59,319 INFO  [Version] Hibernate Annotations 3.4.0.GA
16:18:59,335 INFO  [Environment] Hibernate 3.3.1.GA
16:18:59,350 INFO  [Environment] hibernate.properties not found
16:18:59,350 INFO  [Environment] Bytecode provider name : javassist
16:18:59,366 INFO  [Environment] using JDK 1.4 java.sql.Timestamp handling
16:18:59,990 INFO  [Version] Hibernate Commons Annotations 3.1.0.GA
16:18:59,990 INFO  [Version] Hibernate EntityManager 3.4.0.GA
16:19:00,037 WARN  [Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
16:19:00,177 INFO  [AnnotationBinder] Binding entity from annotated class: lasad.ejb.entity.Box
16:19:00,224 INFO  [EntityBinder] Bind entity lasad.ejb.entity.Box on table BOXES
16:19:00,271 INFO  [AnnotationBinder] Binding entity from annotated class: lasad.ejb.entity.Action
16:19:00,271 INFO  [EntityBinder] Bind entity lasad.ejb.entity.Action on table ACTION_LOG
16:19:00,272 INFO  [AnnotationBinder] Binding entity from annotated class: lasad.ejb.entity.Map
16:19:00,272 INFO  [EntityBinder] Bind entity lasad.ejb.entity.Map on table MAPS
16:19:00,272 INFO  [AnnotationBinder] Binding entity from annotated class: lasad.ejb.entity.Relation
16:19:00,272 INFO  [EntityBinder] Bind entity lasad.ejb.entity.Relation on table RELATIONS
16:19:00,303 INFO  [Version] Hibernate Validator 3.1.0.GA
16:19:00,350 INFO  [HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
16:19:00,443 INFO  [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
16:19:00,443 INFO  [InjectedDataSourceConnectionProvider] Using provided datasource
16:19:00,443 INFO  [SettingsFactory] RDBMS: HSQL Database Engine, version: 1.8.0
16:19:00,443 INFO  [SettingsFactory] JDBC driver: HSQL Database Engine Driver, version: 1.8.0
16:19:00,490 INFO  [Dialect] Using dialect: org.hibernate.dialect.HSQLDialect
16:19:00,490 INFO  [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
16:19:00,506 INFO  [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
16:19:00,506 INFO  [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
16:19:00,506 INFO  [SettingsFactory] Automatic flush during beforeCompletion(): disabled
16:19:00,506 INFO  [SettingsFactory] Automatic session close at end of transaction: disabled
16:19:00,506 INFO  [SettingsFactory] JDBC batch size: 15
16:19:00,506 INFO  [SettingsFactory] JDBC batch updates for versioned data: disabled
16:19:00,506 INFO  [SettingsFactory] Scrollable result sets: enabled
16:19:00,506 INFO  [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
16:19:00,506 INFO  [SettingsFactory] Connection release mode: auto
16:19:00,506 INFO  [SettingsFactory] Default batch fetch size: 1
16:19:00,506 INFO  [SettingsFactory] Generate SQL with comments: disabled
16:19:00,506 INFO  [SettingsFactory] Order SQL updates by primary key: disabled
16:19:00,506 INFO  [SettingsFactory] Order SQL inserts for batching: disabled
16:19:00,506 INFO  [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
16:19:00,506 INFO  [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
16:19:00,506 INFO  [SettingsFactory] Query language substitutions: {}
16:19:00,506 INFO  [SettingsFactory] JPA-QL strict compliance: enabled
16:19:00,506 INFO  [SettingsFactory] Second-level cache: enabled
16:19:00,506 INFO  [SettingsFactory] Query cache: disabled
16:19:00,521 INFO  [SettingsFactory] Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
16:19:00,521 INFO  [RegionFactoryCacheProviderBridge] Cache provider: org.hibernate.cache.HashtableCacheProvider
16:19:00,521 INFO  [SettingsFactory] Optimize cache for minimal puts: disabled
16:19:00,521 INFO  [SettingsFactory] Cache region prefix: persistence.unit:unitName=LASAD.ear/LASADServer.jar#LASADServer
16:19:00,521 INFO  [SettingsFactory] Structured second-level cache entries: disabled
16:19:00,521 INFO  [SettingsFactory] Echoing all SQL to stdout
16:19:00,521 INFO  [SettingsFactory] Statistics: disabled
16:19:00,521 INFO  [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
16:19:00,521 INFO  [SettingsFactory] Default entity-mode: pojo
16:19:00,521 INFO  [SettingsFactory] Named query checking : enabled
16:19:00,584 INFO  [SessionFactoryImpl] building session factory
16:19:00,818 INFO  [SessionFactoryObjectFactory] Factory name: persistence.unit:unitName=LASAD.ear/LASADServer.jar#LASADServer
16:19:00,818 INFO  [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
16:19:00,818 INFO  [NamingHelper] Creating subcontext: persistence.unit:unitName=LASAD.ear
16:19:00,818 INFO  [SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.unit:unitName=LASAD.ear/LASADServer.jar#LASADServer
16:19:00,818 WARN  [SessionFactoryObjectFactory] InitialContext did not implement EventContext
16:19:00,833 INFO  [SchemaExport] Running hbm2ddl schema export
16:19:00,833 INFO  [SchemaExport] exporting generated schema to database
16:19:00,849 INFO  [SchemaExport] schema export complete
16:19:00,849 INFO  [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
16:19:00,911 INFO  [SessionSpecContainer] Starting jboss.j2ee:ear=LASAD.ear,jar=LASADServer.jar,name=LASADServerBean,service=EJB3
16:19:00,927 INFO  [EJBContainer] STARTED EJB: lasad.ejb.LASADServerBean ejbName: LASADServerBean
16:19:00,989 INFO  [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:

	LASAD/LASADServerBean/remote - EJB3.x Default Remote Business Interface
	LASAD/LASADServerBean/remote-lasad.ejb.LASADServerRemote - EJB3.x Remote Business Interface
	LASAD/LASADServerBean/local - EJB3.x Default Local Business Interface
	LASAD/LASADServerBean/local-lasad.ejb.LASADServerLocal - EJB3.x Local Business Interface

16:19:01,145 INFO  [DefaultEndpointRegistry] register: jboss.ws:context=LASAD-LASADServer,endpoint=LASADServerBean
16:19:02,549 INFO  [WSDLFilePublisher] WSDL published to: file:/D:/JBoss/Java5/jboss-5.0.1.GA/server/default/data/wsdl/LASAD.ear/LASADServer.jar/LASADServerBeanService6781154282673061144.wsdl
16:19:02,675 INFO  [TomcatDeployment] deploy, ctxPath=/LASAD-LASADServer
16:19:02,706 WARN  [config] Unable to process deployment descriptor for context '/LASAD-LASADServer'
16:19:03,299 INFO  [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
16:19:03,315 INFO  [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
16:19:03,315 INFO  [ServerImpl] JBoss (Microcontainer) [5.0.1.GA (build: SVNTag=JBoss_5_0_1_GA date=200902231221)] Started in 27s:64ms
16:20:12,672 WARN  [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
16:20:12,672 WARN  [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
16:20:12,672 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public java.lang.String lasad.ejb.LASADServerBean.doAction()
16:20:12,672 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public java.lang.String lasad.ejb.LASADServerBean.doAction()
16:20:12,798 INFO  [STDOUT] Hibernate: insert into ACTION_LOG (ID, ACTION_XML) values (null, ?)
16:20:12,798 INFO  [STDOUT] Hibernate: call identity()


Die persistence.xml sieht wie folgt aus:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" 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">
	<persistence-unit name="LASADServer">
	<jta-data-source>java:/DefaultDS</jta-data-source>
	<class>lasad.ejb.entity.Action</class>
	<class>lasad.ejb.entity.Box</class>
	<class>lasad.ejb.entity.Map</class>
	<class>lasad.ejb.entity.Relation</class>
		<properties>
			<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
			<property name="hibernate.show_sql" value="true"/>
		</properties>
	</persistence-unit>
</persistence>

Die weiteren Klassen sehen wie folgt aus:
Code:
package lasad.ejb;

import javax.ejb.Stateless;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import lasad.ejb.entity.Action;

@Stateless
@WebService (name="LASADdoAction")
public class LASADServerBean implements LASADServerLocal, LASADServerRemote {

	@PersistenceContext(unitName="LASADServer")
	private EntityManager em;
	
	@WebMethod
	public String doAction() {

		Action myAction = new Action("Hallo");				
		em.persist(myAction);
	
		return "Action Confirmation from EJB in JBoss!";
	}
	
	public LASADServerBean() {
		
	}
	
}


Und die Actionklasse:

Code:
package lasad.ejb.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

@SuppressWarnings("serial")
@Entity
@Table(name="ACTION_LOG")
public class Action implements Serializable {
	
	private int id;
	private String actionString;
	
	public Action() {
		
	}
	
	public Action(String actionString) {
		this.actionString = actionString;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name="ID")
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column(name="ACTION_XML")
	public String getActionString() {
		return actionString;
	}

	public void setActionString(String actionString) {
		this.actionString = actionString;
	}
}


Mein Problem ist dabei, wie gesagt, es kommt nichts in der Datenbank an. Was mache ich verkehrt? Hat irgendwer eine Idee, was ich falsch mache? Schon mal vielen Dank...
 
Hallo,

der Server fährt richtig hoch und er erzeugt auch Tabellen. Allerdings sieht das Log dannach aus, dass du die default - DataSource im JBoss nicht auf die MySQL umgestellt hast - der benutzt nämlich weiterhin die voreingestellte HSQLDB.

Am besten du richtest Dir eine entsprechende mysql-DataSource ein (Beispiele dafür liegen im docs/examples/jca - Ordner des JBoss) und referenzierst die dann in deiner persistence.xml

hth
THMD
 
Du hattest Recht. Vielen Dank. :)

Sollten mich eigentlich diese Warnungen beunruhigen?

Code:
16:20:12,672 WARN  [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
16:20:12,672 WARN  [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
16:20:12,672 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public java.lang.String lasad.ejb.LASADServerBean.doAction()
16:20:12,672 WARN  [InterceptorRegistry] applicable interceptors is non-existent for public java.lang.String lasad.ejb.LASADServerBean.doAction()
 
Zurück