Do not use on any
shared computer
May 17, 2008 04:33am pdt
01.31.2008 at 07:57AM PST, ID: 23126638 | Points: 500
[x]
Attachment Details
javax.naming.NameAlreadyBoundException: UserTransaction is already bound; - Error when trying to deploy EAR file
I get the following error when deploying my ear file to WebLogic 8.1 server.

[EJB:011026]The EJB container failed while creating the java:/comp/env namespace for this EJB deployment.
javax.naming.NameAlreadyBoundException: UserTransaction is already bound; remaining name 'app/ejb/sample_app-ejb/jar#MyServiceBean/comp'
        at weblogic.jndi.internal.BasicNamingNode.bindHere(BasicNamingNode.java:333)
        at weblogic.jndi.internal.BasicNamingNode.bind(BasicNamingNode.java:291)
        at weblogic.jndi.internal.BasicNamingNode.bind(BasicNamingNode.java:298)
        at weblogic.jndi.internal.WLEventContextImpl.bind(WLEventContextImpl.java:279)
        at weblogic.ejb20.deployer.EnvironmentBuilder.addUserTransaction(EnvironmentBuilder.java:663)
        at weblogic.ejb20.deployer.EJBDeployer.setupEnvironmentContext(EJBDeployer.java:385)
        at weblogic.ejb20.deployer.EJBDeployer.setupEnvironmentFor(EJBDeployer.java:1172)
        at weblogic.ejb20.deployer.EJBDeployer.setupBeanInfos(EJBDeployer.java:943)
        at weblogic.ejb20.deployer.EJBDeployer.prepare(EJBDeployer.java:1345)
        at weblogic.ejb20.deployer.EJBModule.prepare(EJBModule.java:498)
        at weblogic.j2ee.J2EEApplicationContainer.prepareModule(J2EEApplicationContainer.java:3142)
        at weblogic.j2ee.J2EEApplicationContainer.prepareModules(J2EEApplicationContainer.java:1583)
        at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1227)
        at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1070)
        at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2513)
        at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2463)
        at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2379)
        at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:866)
        at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:594)
        at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:508)
        at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)




        at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2467)
        at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2379)
        at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:866)
        at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:594)
        at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:508)
        at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
        at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
--------------- nested within: ------------------
weblogic.management.ManagementException:  - with nested exception:
[weblogic.management.ApplicationException:
Exception:weblogic.management.ApplicationException: prepare failed for sample_app-ejb.jar2
        Module: sample_app-ejb.jar2        Error: Exception preparing module: EJBModule(sample_app-ejb.jar2,status=NEW)


Unable to deploy EJB: MyServiceBean from sample_app-ejb.jar:
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: amjava
Question Asked On: 01.31.2008
Participating Experts: 3
Points: 500
Views: 0
Translate:
Loading Advertisement...
01.31.2008 at 12:41PM PST, ID: 20790848

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.31.2008 at 02:35PM PST, ID: 20792045

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.31.2008 at 03:04PM PST, ID: 20792330

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.31.2008 at 03:21PM PST, ID: 20792478

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
01.31.2008 at 08:10PM PST, ID: 20794141

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
02.01.2008 at 07:29AM PST, ID: 20797317

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
01.31.2008 at 12:41PM PST, ID: 20790848
You are trying to bind Usertransaction to the weblogic JNDI  tree. But name "UserTransaction" bound to a javax.transaction.UserTransaction object. So you need to edit your ejb-jar.xml of MyServiceBean and change the name Usertransaction to something else.
 
01.31.2008 at 02:35PM PST, ID: 20792045
change the name of ur JNDI resouce
 
01.31.2008 at 03:04PM PST, ID: 20792330
I don't have anything named 'Usertransaction'  in my ejb-jar.xml file. (see below)

<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

<ejb-jar>

  <enterprise-beans>

    <session>
      <description>My Service</description>
      <ejb-name>MyServiceBean</ejb-name>
      <local-home>
        com.app.ejb.MyServiceHomeLocal
      </local-home>
      <local>
        com.app.ejb.MyServiceLocal
      </local>
      <ejb-class>
        com.app.ejb.MyServiceBean
      </ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
    </session>

  </enterprise-beans>

  <assembly-descriptor>

    <container-transaction>
      <method>
        <ejb-name>MyServiceBean</ejb-name>
        <method-name>*</method-name>
      </method>
      <trans-attribute>Supports</trans-attribute>
    </container-transaction>

  </assembly-descriptor>

</ejb-jar>
 
01.31.2008 at 03:21PM PST, ID: 20792478
Can u post the piece of code in my ejb where you use user transaction. you can go to your weblogic browser and right click on servers and do a view JNDI tree to see the list of JNDI names bound to the server. check for usertransaction and give us that info.
 
01.31.2008 at 08:10PM PST, ID: 20794141
Can you post your weblogic.xml too? (I hope I named it correctly. This is the weblogic specific deployment descriptor that you would find co-located with ejb-jar.xml)
The names that get bound to a jndi tree of the application server is present in the app server specific deployment descriptor. The ejb-jar.xml merely contains the references.
 
02.01.2008 at 07:29AM PST, ID: 20797317
Here is my weblogic-ejb-jar.xml -

<weblogic-ejb-jar>

  <weblogic-enterprise-bean>
    <ejb-name>
      MyServiceBean
    </ejb-name>
    <local-jndi-name>
      ejb.local.MyService
    </local-jndi-name>
  </weblogic-enterprise-bean>

</weblogic-ejb-jar>

Here is the ejb

package com.app.ejb;


import javax.ejb.SessionBean;
import javax.ejb.SessionContext;

import org.apache.log4j.Logger;

import com.util.Util;


public class MyServiceBean implements SessionBean {

  public String reflect(String string) {

    StringBuffer reflection = new StringBuffer();
    Util.showTime();

    for (int i = (string.length() - 1); i >= 0; i--) {
      reflection.append(string.charAt(i));
    }

    return reflection.toString();
  }


  public void ejbCreate() {
  }

 
  public void ejbRemove() { }

 
  public void ejbActivate() { }

 
  public void ejbPassivate() { }


  public void setSessionContext(SessionContext aContext) {
    this.context = aContext;
  }


  private SessionContext context;

 
  static final Logger LOGGER = Logger.getLogger(MyServiceBean.class);
}

I'm not referencing 'UserTransaction' anywhere in my code so this is driving me crazy!
 
 
20080206-EE-VQP-25 / EE_QW_2_20070628