Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

JBoss DeploymentException: can't find data source: java:/ZeittoolDS; NameNotFoundException: ZeittoolDS not bound

Posted on 2004-09-27
5
Medium Priority
?
344 Views
Last Modified: 2008-02-20
I use MyEclipse, JBoss Application server with SQL SERVER 2000 DB. When i try to deploy my EJB project, I get the exception:

................
................
org.jboss.deployment.DeploymentException: Error: can't find data source: java:/ZeittoolDS; - nested throwable: (javax.naming.NameNotFoundException: ZeittoolDS not bound)
................
................
Caused by: javax.naming.NameNotFoundException: Zeittoolejb not bound
...............

This is my mssql-ds.xml file (I am sure the detials here are correct):
--------------------------------------------------------------------------------

<datasources>
  <local-tx-datasource>
    <jndi-name>ZeittoolDS</jndi-name>
    <connection-url>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=zeittool</connection-url>
    <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
    <user-name>sa</user-name>
    <password></password>
  </local-tx-datasource>
</datasources>


My xdoclet-build.xml ( file which is created based on the 'Properties' of the 'Zeittoolejb' EJB Project) :
------------------------------------------------------------------------------------------------------------------

.................
................
<jboss Version="3.2"  datasource="java:/ZeittoolDS"  datasourceMapping="MS SQLSERVER2000"  createTable="true"  removeTable="false"  destDir="src/META-INF" >
</jboss>
................
................

when i see the JNDI-VIEW in my jmx-console i get:
------------------------------------------------------------

null

java:comp
GesperrteMonate

env
org.jnp.interfaces.NamingContext

.........................
........................

where "GesperrteMonate" is my entity Java class.


I have "MS SQLSERVER2000" datasourceMapping in my stabdardjboss-jdbc.xml. I am not sure what might be the other reason for my problem ?
Any help is appreciated.
0
Comment
Question by:ldbkutty
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 12166938
Does it look like it is Deploying ok in the server.log?

It should say something like:

ZeittoolDS bound to java:/ZeittoolDS

And are you trying to get to this datasource from an external client?

If so, you can't...the datasource is only available internally to jboss and the EJBs...
0
 
LVL 32

Author Comment

by:ldbkutty
ID: 12175486
Hi TimYates,

Same result in my server.log !!

and, everything is in my local system only.

I hope i miss somthing which is very basic. Could you tell me what might the reason for "Naming Exception" and "Datasource not bound" ?
0
 
LVL 32

Author Comment

by:ldbkutty
ID: 12176284
Hai Tim,

Atlast, i re-installed and re-configured JBoss with SQLSERVER and am successful. :-) I will just put the link that helped me(for future reference):
http://www.oreillynet.com/cs/user/view/cs_msg/33739
0
 
LVL 32

Author Comment

by:ldbkutty
ID: 12176376
Tim,

I hope you wont mind to clear this problem for me :-) and get the points. It was you who helped me in creating this Class: http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21134850.html

Ok.. I have this 'Entity' Class now ... sorry for the length :-( :

------------------------------------------------------------------------------------------------------------------------
package de.grassgmbh.zeittool.entity.ejb;

import javax.ejb.CreateException;
import javax.ejb.EJBException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.RemoveException;

import de.grassgmbh.zeittool.entity.interfaces.AufgabeLocal;
import de.grassgmbh.zeittool.entity.interfaces.MitarbeiterLocal;
import de.grassgmbh.zeittool.entity.interfaces.FavoritenPK;

/**
 *
 * @ejb.bean name = "Favoriten"
 *           type = "CMP"
 *           cmp-version = "2.x"
 *           display-name = "Favoriten"
 *           description = "Favoriten EJB"
 *           view-type = "both"
 *           jndi-name = "ejb/FavoritenHome"
 *           local-jndi-name = "ejb/FavoritenLocalHome"
 *
 * @ejb.pk generate = "true"    
 * @ejb:util
 * @ejb.persistence  table-name = "tfavoriten"
 * @ejb.util generate="physical"
 *
 * @ejb.finder
 *       signature = "java.util.Collection findAll()"
 *       query = "select object(c) from Favoriten as c "
 *  
 * @ejb.value-object match = "*" name="Favoriten"
 * @jboss.persistence remove-table = "false"
 * @jboss.entity-command name = "mssql-fetch-key"
 *
 */

public abstract class Favoriten implements EntityBean {

      /**
       * @author bj 17.09.2004
       * Priorität
       *
       * @ejb.interface-method view-type = "both"
       * @ejb.persistence column-name = "fprioritaet"
       * @return
       */
      public abstract Integer getPrioritaet();

      /**
       * @ejb.interface-method view-type = "both"
       * @param prioritaet
       */
      public abstract void setPrioritaet(Integer prioritaet);
      
      /**
       * @author bj 17.09.2004
       * BenutzerId
       *
       * @ejb.interface-method view-type = "both"
       * @ejb.pk-field
       *
       * @return
       */
      public abstract Integer getBenutzerId();

      /**
       * @ejb.interface-method view-type = "both"
       * @param benutzerId      
       */
      public abstract void setBenutzerId(Integer benutzerId);
      
      /**
       * @author bj 17.09.2004
       * AufgabenId
       *
       * @ejb.interface-method view-type = "both"
       * @ejb.pk-field
       *
       * @return
       */
      public abstract Integer getAufgabenId();

      /**
       * @ejb.interface-method view-type = "both"
       * @param aufgabeId      
       */
      public abstract void setAufgabenId(Integer aufgabeId);
      
      /**
       * @author bj 17.09.2004
       * Favoriten Aufgabe Relation
       *
       * @ejb.interface-method
       *       view-type = "local"
       *
       * @ejb.relation
       *       name = "favoriten_aufgabe"
       *  role-name = "favoriten from aufgaben"
       *  
       * @jboss.relation
       *       fk-column = "faufgaben_id"
       *       related-pk-field = "id"
       *       fk-constraint = "true"
       */
      public abstract AufgabeLocal getAufgabe();

      /**
       * @ejb.interface-method view-type = "local"
       * @param aufgabe
       */
      public abstract void setAufgabe(AufgabeLocal aufgabe);
      
      /**
       * @author bj 17.09.2004
       * Favoriten Mitarbeiter Relation
       *
       * @ejb.interface-method
       *       view-type = "local"
       *
       * @ejb.relation
       *       name = "favoriten_mitarbeiter"
       *  role-name = "favoriten from mitarbeiter"
       *  
       * @jboss.relation
       *       fk-column = "fmitarbeiter_id"
       *       related-pk-field = "id"
       *       fk-constraint = "true"
       */
      public abstract MitarbeiterLocal getMitarbeiter();

      /**
       * @ejb.interface-method view-type = "local"
       * @param mitarbeiter
       */
      public abstract void setMitarbeiter(MitarbeiterLocal mitarbeiter);
      
      
      /** The EntityContext */
      private EntityContext context;

      public FavoritenPK ejbCreate() throws CreateException {
            return null;
      }

      public void ejbPostCreate() throws CreateException {
      }

      public void ejbActivate() throws EJBException {
      }

      public void ejbPassivate() throws EJBException {
      }

      public void ejbLoad() throws EJBException {
      }

      public void ejbStore() throws EJBException {
      }

      public void ejbRemove() throws EJBException, RemoveException {
      }

      public void setEntityContext(EntityContext newContext) throws EJBException {
            context = newContext;
      }

      public void unsetEntityContext() throws EJBException {
            context = null;
      }
}

------------------------------------------------------------------------------------------------------------------------

The only problem is My 'XDoclet' creates two times same method in the 'FavoritenPK.java' Class. Like this:

public class FavoritenPK
   extends java.lang.Object
   implements java.io.Serializable
{
   private int _hashCode = 0;
   private StringBuffer _toStringValue = null;

   public FavoritenPK()
   {
   }

   public FavoritenPK(  )
   {
   }

// and so on.

Everytime, i re-XDoclet my EJB project, i need to delete one of FavoritenPK( ) method and delpoy.

Any suggestion !?
0
 
LVL 35

Accepted Solution

by:
TimYates earned 1500 total points
ID: 12177606
It's probably getting confused over the two "* @ejb.pk-field" tags, so creating the constructor twice...

Hmmmm

Instead of:

     /**
      * @author bj 17.09.2004
      * BenutzerId
      *
      * @ejb.interface-method view-type = "both"
      * @ejb.pk-field
      *
      * @return
      */
     public abstract Integer getBenutzerId();

     /**
      * @ejb.interface-method view-type = "both"
      * @param benutzerId    
      */
     public abstract void setBenutzerId(Integer benutzerId);
     
     /**
      * @author bj 17.09.2004
      * AufgabenId
      *
      * @ejb.interface-method view-type = "both"
      * @ejb.pk-field
      *
      * @return
      */
     public abstract Integer getAufgabenId();

     /**
      * @ejb.interface-method view-type = "both"
      * @param aufgabeId    
      */
     public abstract void setAufgabenId(Integer aufgabeId);

can't you just have:

     /**
      * @author bj 17.09.2004
      * BenutzerId
      *
      * @ejb.interface-method view-type = "both"
      * @ejb.pk-field
      *
      * @return
      */
     public abstract FavoritenPK getKey();

     /**
      * @ejb.interface-method view-type = "both"
      * @param pk    
      */
     public abstract void setKey( FavoritenPK pk );
     
?

Not sure...hopefully that will fix it...  My XDoclet experience is slight :-(  But I am learning ;-)

Hope it does fix it....the XDoclet documentation on the web is (ironically) rubbish ;-)

Tim
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question