2 Replies Latest reply on Jan 12, 2009 8:39 AM by Omer Gillani

    Deployment Exception ----- is already register

    Omer Gillani Newbie

      15:14:31,059 INFO [ServerImpl] Starting JBoss (Microcontainer)...
      15:14:31,060 INFO [ServerImpl] Release ID: JBoss [Morpheus] 5.0.0.GA (build: SVNTag=JBoss_5_0_0_GA date=200812042120)
      15:14:31,061 INFO [ServerImpl] Bootstrap URL: null
      15:14:31,061 INFO [ServerImpl] Home Dir: D:\Workspace\Final Project\HR Module Final\Workspace\Application Server\jboss-5.0.0.GA-jdk6\jboss-5.0.0.GA
      15:14:31,061 INFO [ServerImpl] Home URL: file:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/
      15:14:31,062 INFO [ServerImpl] Library URL: file:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/lib/
      15:14:31,106 INFO [ServerImpl] Patch URL: null
      15:14:31,107 INFO [ServerImpl] Common Base URL: file:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/common/
      15:14:31,107 INFO [ServerImpl] Common Library URL: file:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/common/lib/
      15:14:31,107 INFO [ServerImpl] Server Name: default
      15:14:31,107 INFO [ServerImpl] Server Base Dir: D:\Workspace\Final Project\HR Module Final\Workspace\Application Server\jboss-5.0.0.GA-jdk6\jboss-5.0.0.GA\server
      15:14:31,107 INFO [ServerImpl] Server Base URL: file:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/
      15:14:31,107 INFO [ServerImpl] Server Config URL: file:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/conf/
      15:14:31,107 INFO [ServerImpl] Server Home Dir: D:\Workspace\Final Project\HR Module Final\Workspace\Application Server\jboss-5.0.0.GA-jdk6\jboss-5.0.0.GA\server\default
      15:14:31,107 INFO [ServerImpl] Server Home URL: file:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/
      15:14:31,108 INFO [ServerImpl] Server Data Dir: D:\Workspace\Final Project\HR Module Final\Workspace\Application Server\jboss-5.0.0.GA-jdk6\jboss-5.0.0.GA\server\default\data
      15:14:31,108 INFO [ServerImpl] Server Library URL: file:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/lib/
      15:14:31,108 INFO [ServerImpl] Server Log Dir: D:\Workspace\Final Project\HR Module Final\Workspace\Application Server\jboss-5.0.0.GA-jdk6\jboss-5.0.0.GA\server\default\log
      15:14:31,108 INFO [ServerImpl] Server Native Dir: D:\Workspace\Final Project\HR Module Final\Workspace\Application Server\jboss-5.0.0.GA-jdk6\jboss-5.0.0.GA\server\default\tmp\native
      15:14:31,108 INFO [ServerImpl] Server Temp Dir: D:\Workspace\Final Project\HR Module Final\Workspace\Application Server\jboss-5.0.0.GA-jdk6\jboss-5.0.0.GA\server\default\tmp
      15:14:31,108 INFO [ServerImpl] Server Temp Deploy Dir: D:\Workspace\Final Project\HR Module Final\Workspace\Application Server\jboss-5.0.0.GA-jdk6\jboss-5.0.0.GA\server\default\tmp\deploy
      15:14:32,398 INFO [ServerImpl] Starting Microcontainer, bootstrapURL=file:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/conf/bootstrap.xml
      15:14:33,110 INFO [VFSCacheFactory] Initializing VFSCache [org.jboss.virtual.plugins.cache.IterableTimedVFSCache]
      15:14:33,200 INFO [VFSCacheFactory] Using VFSCache [IterableTimedVFSCache{lifetime=1800, resolution=60}]
      15:14:33,636 INFO [CopyMechanism] VFS temp dir: D:\Workspace\Final Project\HR Module Final\Workspace\Application Server\jboss-5.0.0.GA-jdk6\jboss-5.0.0.GA\server\default\tmp
      15:14:33,657 INFO [ZipEntryContext] VFS force nested jars copy-mode is enabled.
      15:14:35,150 INFO [ServerInfo] Java version: 1.6.0,Sun Microsystems Inc.
      15:14:35,150 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.6.0-b105,Sun Microsystems Inc.
      15:14:35,150 INFO [ServerInfo] OS-System: Windows Vista 6.0,x86
      15:14:35,298 INFO [JMXKernel] Legacy JMX core initialized
      15:14:37,721 INFO [ProfileServiceImpl] Loading profile: default from: org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository@3cfaab(root=D:\Workspace\Final Project\HR Module Final\Workspace\Application Server\jboss-5.0.0.GA-jdk6\jboss-5.0.0.GA\server, key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default])
      15:14:37,723 INFO [ProfileImpl] Using repository:org.jboss.system.server.profileservice.repository.SerializableDeploymentRepository@3cfaab(root=D:\Workspace\Final Project\HR Module Final\Workspace\Application Server\jboss-5.0.0.GA-jdk6\jboss-5.0.0.GA\server, key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default])
      15:14:37,724 INFO [ProfileServiceImpl] Loaded profile: ProfileImpl@1a37fac{key=org.jboss.profileservice.spi.ProfileKey@143b82c3[domain=default,server=default,name=default]}
      15:14:40,156 INFO [WebService] Using RMI server codebase: http://127.0.0.1:8083/
      15:14:48,738 INFO [NativeServerConfig] JBoss Web Services - Stack Native Core
      15:14:48,738 INFO [NativeServerConfig] 3.0.4.SP1
      15:15:00,114 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@12234408{vfsfile:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/deploy/HR.ear/}
      15:15:00,115 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@12234408{vfsfile:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/deploy/HR.ear/}
      15:15:00,116 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@29318887{vfsfile:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/deploy/HR.ear/HREJB.jar/}
      15:15:00,116 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@29318887{vfsfile:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/deploy/HR.ear/HREJB.jar/}
      15:15:00,116 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@29318887{vfsfile:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/deploy/HR.ear/HREJB.jar/}
      15:15:00,116 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@29318887{vfsfile:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/deploy/HR.ear/HREJB.jar/}
      15:15:03,937 INFO [JMXConnectorServerService] JMX Connector server: service:jmx:rmi://127.0.0.1/jndi/rmi://127.0.0.1:1090/jmxconnector
      15:15:05,039 INFO [MailService] Mail Service bound to java:/Mail
      15:15:07,136 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.
      15:15:07,164 WARN [AnnotationCreator] No ClassLoader provided, using TCCL: org.jboss.managed.api.annotation.ManagementComponent
      15:15:07,433 INFO [TransactionManagerService] JBossTS Transaction Service (JTA version) - JBoss Inc.
      15:15:07,433 INFO [TransactionManagerService] Setting up property manager MBean and JMX layer
      15:15:07,801 INFO [TransactionManagerService] Initializing recovery manager
      15:15:08,054 INFO [TransactionManagerService] Recovery manager configured
      15:15:08,054 INFO [TransactionManagerService] Binding TransactionManager JNDI Reference
      15:15:08,089 INFO [TransactionManagerService] Starting transaction recovery manager
      15:15:09,500 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-127.0.0.1-8080
      15:15:09,502 INFO [AjpProtocol] Initializing Coyote AJP/1.3 on ajp-127.0.0.1-8009
      15:15:09,503 INFO [StandardService] Starting service jboss.web
      15:15:09,506 INFO [StandardEngine] Starting Servlet Engine: JBoss Web/2.1.1.GA
      15:15:09,583 INFO [Catalina] Server startup in 161 ms
      15:15:09,609 INFO [TomcatDeployment] deploy, ctxPath=/jbossws, vfsUrl=jbossws.sar/jbossws-management.war
      15:15:10,480 INFO [TomcatDeployment] deploy, ctxPath=/web-console, vfsUrl=management/console-mgr.sar/web-console.war
      15:15:10,938 INFO [TomcatDeployment] deploy, ctxPath=/invoker, vfsUrl=http-invoker.sar/invoker.war
      15:15:11,178 INFO [RARDeployment] Required license terms exist, view vfszip:/D:/Workspace/Final Project/HR Module Final/Workspace/Application Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/deploy/jboss-local-jdbc.rar/META-INF/ra.xml
      15:15:11,206 INFO [RARDeployment] Required license terms exist, view vfszip:/D:/Workspace/Final Project/HR Module Final/Workspace/Application Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/deploy/jboss-xa-jdbc.rar/META-INF/ra.xml
      15:15:11,259 INFO [RARDeployment] Required license terms exist, view vfszip:/D:/Workspace/Final Project/HR Module Final/Workspace/Application Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/deploy/jms-ra.rar/META-INF/ra.xml
      15:15:11,286 INFO [RARDeployment] Required license terms exist, view vfszip:/D:/Workspace/Final Project/HR Module Final/Workspace/Application Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/deploy/mail-ra.rar/META-INF/ra.xml
      15:15:11,322 INFO [RARDeployment] Required license terms exist, view vfszip:/D:/Workspace/Final Project/HR Module Final/Workspace/Application Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/deploy/quartz-ra.rar/META-INF/ra.xml
      15:15:11,461 INFO [SimpleThreadPool] Job execution threads will use class loader of thread: main
      15:15:11,498 INFO [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
      15:15:11,503 INFO [RAMJobStore] RAMJobStore initialized.
      15:15:11,503 INFO [StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
      15:15:11,503 INFO [StdSchedulerFactory] Quartz scheduler version: 1.5.2
      15:15:11,504 INFO [QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
      15:15:13,249 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
      15:15:13,780 WARN [QuartzTimerServiceFactory] sql failed: CREATE TABLE QRTZ_JOB_DETAILS(JOB_NAME VARCHAR(80) NOT NULL, JOB_GROUP VARCHAR(80) NOT NULL, DESCRIPTION VARCHAR(120) NULL, JOB_CLASS_NAME VARCHAR(128) NOT NULL, IS_DURABLE VARCHAR(1) NOT NULL, IS_VOLATILE VARCHAR(1) NOT NULL, IS_STATEFUL VARCHAR(1) NOT NULL, REQUESTS_RECOVERY VARCHAR(1) NOT NULL, JOB_DATA BINARY NULL, PRIMARY KEY (JOB_NAME,JOB_GROUP))
      15:15:13,865 INFO [SimpleThreadPool] Job execution threads will use class loader of thread: main
      15:15:13,867 INFO [QuartzScheduler] Quartz Scheduler v.1.5.2 created.
      15:15:13,867 INFO [JobStoreCMT] Using db table-based data access locking (synchronization).
      15:15:13,879 INFO [JobStoreCMT] Removed 0 Volatile Trigger(s).
      15:15:13,879 INFO [JobStoreCMT] Removed 0 Volatile Job(s).
      15:15:13,879 INFO [JobStoreCMT] JobStoreCMT initialized.
      15:15:13,880 INFO [StdSchedulerFactory] Quartz scheduler 'JBossEJB3QuartzScheduler' initialized from an externally provided properties instance.
      15:15:13,880 INFO [StdSchedulerFactory] Quartz scheduler version: 1.5.2
      15:15:13,889 INFO [JobStoreCMT] Freed 0 triggers from 'acquired' / 'blocked' state.
      15:15:13,895 INFO [JobStoreCMT] Recovering 0 jobs that were in-progress at the time of the last shut-down.
      15:15:13,896 INFO [JobStoreCMT] Recovery complete.
      15:15:13,896 INFO [JobStoreCMT] Removed 0 'complete' triggers.
      15:15:13,896 INFO [JobStoreCMT] Removed 0 stale fired job entries.
      15:15:13,906 INFO [QuartzScheduler] Scheduler JBossEJB3QuartzScheduler_$_NON_CLUSTERED started.
      15:15:14,126 INFO [ServerPeer] JBoss Messaging 1.4.1.GA server [0] started
      15:15:14,277 INFO [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
      15:15:14,286 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
      15:15:14,286 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
      15:15:14,375 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
      15:15:14,375 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@bc8d97 started
      15:15:14,377 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
      15:15:14,377 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@1905258 started
      15:15:14,380 INFO [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
      15:15:14,383 INFO [ConnectionFactory] Connector bisocket://127.0.0.1:4457 has leasing enabled, lease period 10000 milliseconds
      15:15:14,383 INFO [ConnectionFactory] org.jboss.jms.server.connectionfactory.ConnectionFactory@1d385f4 started
      15:15:14,557 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
      15:15:14,623 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=mySQLDS' to JNDI name 'java:mySQLDS'
      15:15:14,657 INFO [TomcatDeployment] deploy, ctxPath=/, vfsUrl=ROOT.war
      15:15:14,738 INFO [TomcatDeployment] deploy, ctxPath=/jmx-console, vfsUrl=jmx-console.war
      15:15:17,333 ERROR [AbstractKernelController] Error installing to Real: name=vfsfile:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/deploy/HR.ear/ state=PreReal mode=Manual requiredState=Real
      org.jboss.deployers.spi.DeploymentException: Error deploying HR.ear: Error creating ejb container OperationServiceBean: Container jboss.j2ee:ear=HR.ear,jar=HR.ear,name=OperationServiceBean,service=EJB3,VMID=11d1def534ea1be0:36a69e8c:11eca560046:-7ff9 + is already registered
      at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:203)
      at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:104)
      at org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer.internalDeploy(AbstractVFSRealDeployer.java:45)
      at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
      at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
      at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
      at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
      at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
      at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
      at org.jboss.Main.boot(Main.java:209)
      at org.jboss.Main$1.run(Main.java:547)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: org.jboss.deployers.spi.DeploymentException: Error creating ejb container OperationServiceBean: Container jboss.j2ee:ear=HR.ear,jar=HR.ear,name=OperationServiceBean,service=EJB3,VMID=11d1def534ea1be0:36a69e8c:11eca560046:-7ff9 + is already registered
      at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:682)
      at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:628)
      at org.jboss.ejb3.Ejb3Deployment.deployUrl(Ejb3Deployment.java:610)
      at org.jboss.ejb3.Ejb3Deployment.deploy(Ejb3Deployment.java:573)
      at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:488)
      at org.jboss.ejb3.deployers.Ejb3Deployer.deploy(Ejb3Deployer.java:189)
      ... 22 more
      Caused by: java.lang.IllegalStateException: Container jboss.j2ee:ear=HR.ear,jar=HR.ear,name=OperationServiceBean,service=EJB3,VMID=11d1def534ea1be0:36a69e8c:11eca560046:-7ff9 + is already registered
      at org.jboss.ejb3.Ejb3Registry.register(Ejb3Registry.java:128)
      at org.jboss.ejb3.Ejb3Deployment.deployElement(Ejb3Deployment.java:678)
      ... 27 more
      15:15:17,377 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

      *** CONTEXTS IN ERROR: Name -> Error

      vfsfile:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/deploy/HR.ear/ -> java.lang.IllegalStateException: Container jboss.j2ee:ear=HR.ear,jar=HR.ear,name=OperationServiceBean,service=EJB3,VMID=11d1def534ea1be0:36a69e8c:11eca560046:-7ff9 + is already registered


      15:15:17,396 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
      15:15:17,419 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
      15:15:17,427 INFO [ServerImpl] JBoss (Microcontainer) [5.0.0.GA (build: SVNTag=JBoss_5_0_0_GA date=200812042120)] Started in 46s:317ms



      Code:

      jboss.xml

      <?xml version="1.0" encoding="UTF-8"?>


      <!-- All bean containers use this security manager by default -->
      <security-domain>java:/jaas/HRAuth</security-domain>



      ////////////////////////

      persistence.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <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="HRPU" transaction-type="JTA">
      <jta-data-source>java:/mySQLDS</jta-data-source>





      </persistence-unit>



      //////////////

      mysql-ds.xml

      <?xml version="1.0" encoding="UTF-8"?>

      <local-tx-datasource>
      <jndi-name>mySQLDS</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/Hr</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>root</user-name>

      <valid-connection-checker-class-name>
      org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker
      </valid-connection-checker-class-name>

      <type-mapping>mySQL</type-mapping>

      </local-tx-datasource>


      /////////////////////////

      Operation.java

      package org.wingz.hr.model.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="OPERATION")
      public class Operation implements Serializable {

      @Id
      @Column(name="OPERATIONID")
      @GeneratedValue(strategy = GenerationType.AUTO)
      private Long id;
      @Column(name="CODE")
      private String code;

      @Column(name="NAME")
      private String name;

      @Column(name="DESCRIPTION")
      private String description;

      @Column(name="operationProcedure")
      private String operationProcedure;

      public String getCode() {
      return code;
      }

      public void setCode(String code) {
      this.code = code;
      }

      public String getName() {
      return name;
      }

      public void setName(String name) {
      this.name = name;
      }

      public String getDescription() {
      return description;
      }

      public void setDescription(String description) {
      this.description = description;
      }

      public String getOperationProcedure() {
      return operationProcedure;
      }

      public void setOperationProcedure(String operationProcedure) {
      this.operationProcedure = operationProcedure;
      }

      public Operation() {
      }

      public Long getId() {
      return this.id;
      }

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

      public int hashCode() {
      return (this.id == null) ? 0 : this.id.hashCode();
      }

      public boolean equals(Object object) {
      if (object instanceof Operation) {
      final Operation obj = (Operation) object;
      return (this.id != null) ? this.id.equals(obj.id)
      : (obj.id == null);
      }
      return false;
      }

      }


      ///////////////////////////////////

      OperationService.java


      package org.wingz.hr.model.service;

      import javax.ejb.Local;

      import org.wingz.hr.model.entity.Operation;

      @Local
      public interface OperationService {
      public Operation createOperation(Operation operation);
      public Operation createOperation(String code, String name, String description);
      public void removeOperation(Long id);
      public Operation findOperationById(Long id);
      }


      ////////////////

      OperationServiceBean.java

      package org.wingz.hr.model.service;

      import javax.ejb.Stateless;
      import javax.ejb.TransactionAttribute;
      import javax.ejb.TransactionAttributeType;
      import javax.ejb.TransactionManagement;
      import javax.ejb.TransactionManagementType;
      import javax.persistence.EntityManager;
      import javax.persistence.PersistenceContext;

      import org.wingz.hr.model.entity.Operation;

      @Stateless
      @TransactionManagement(value=TransactionManagementType.CONTAINER)
      public class OperationServiceBean implements OperationServiceRemote, OperationService {

      @PersistenceContext(unitName="HRPU")
      private EntityManager entityManager;

      @Override
      @TransactionAttribute(TransactionAttributeType.REQUIRED)
      public Operation createOperation(Operation operation) {
      try {
      entityManager.persist(operation);
      } catch (Exception e) {
      e.printStackTrace();
      }

      return operation;
      }

      @Override
      @TransactionAttribute(TransactionAttributeType.REQUIRED)
      public Operation createOperation(String code, String name, String description) {
      Operation op = new Operation();
      try {
      op.setCode(code);
      op.setName(name);
      op.setDescription(description);
      entityManager.persist(op);
      } catch (Exception e) {
      e.printStackTrace();
      }
      return op;
      }

      @Override
      public void removeOperation(Long id) {
      Operation operation = entityManager.find(Operation.class, id);
      if(operation != null) {
      entityManager.remove(operation);
      }
      }

      @Override
      public Operation findOperationById(Long id) {
      Operation op = null;
      op = entityManager.find(Operation.class, id);
      return op;
      }

      }


      /////


      WebClient Servlet doGet method


      public void doGet(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {

      response.setContentType("text/html");
      PrintWriter out = response.getWriter();
      try {

      InitialContext ic = new InitialContext();
      OperationService myBean = (OperationService) ic.lookup("HR/OperationServiceBean/local");
      /* Operation op = new Operation();
      op.setCode("WEBCODE");
      op.setName("WEBName");
      op.setDescription("WEBDescripiton");
      op.setOperationProcedure("WEB Procedure");
      myBean.createOperation("WEBCODE", "WEBName", "WEBDescripiton");*/
      Operation op = myBean.findOperationById(new Long(14));
      out.println("Id: " + op.getId() + "");
      out.println("Code: " + op.getCode() + "");
      out.println("Name: " + op.getName() + "");
      out.println("Description: " + op.getDescription() );
      out.close();
      } catch(Exception e) {
      e.printStackTrace();
      }
      }


      ///////////////////////////////////

      It is working in jboss4.2.2GA but deployement error in jboss5






        • 1. Re: Deployment Exception ----- is already register
          jaikiran pai Master

          First

          15:15:00,116 INFO [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@29318887{vfsfile:/D:/Workspace/Final%20Project/HR%20Module%20Final/Workspace/Application%20Server/jboss-5.0.0.GA-jdk6/jboss-5.0.0.GA/server/default/deploy/HR.ear/HREJB.jar/}


          and then

          org.jboss.deployers.spi.DeploymentException: Error deploying HR.ear: Error creating ejb container OperationServiceBean: Container jboss.j2ee:ear=HR.ear,jar=HR.ear,name=OperationServiceBean,service=EJB3,VMID=11d1def534ea1be0:36a69e8c:11eca560046:-7ff9 + is already registered


          The jar=HR.ear looks suspicious to me. Please post more details about your packaging. Post the output of:

          jar -tf HR.ear


          Also post the contents of your application.xml.

          And while posting logs or xml content or code, please remember to wrap it in a code block by using the Code button in the message editor window. Please use the Preview button to ensure that your post is correctly formatted.

          • 2. Re: Deployment Exception ----- is already register
            Omer Gillani Newbie

            Thanks Man

            I have got the problem. Actually i was using myeclipse for the development and for test deployment of my HR.ear by using myeclipse deploy option. MyEclipse deployer deploy HR.ear content two time one time in packaged archive and second time expended which was the problem for jboss.