3 Replies Latest reply on Mar 8, 2004 8:38 PM by dennislee

    ERROR [MainDeployer] could not create deployment:

    dillinger Newbie

      Hello.

      I'm new to JBoss. I'm trying to make a connection to my mssql database. I have created a EJB and use the ant compiler to compile my source code.

      I get a Class Not Found Exception as you can see in the debug.
      The Classloader fails.

      I run W2K with j2ee1.4 and jdk1.4.2_3. Jboss version: 3.2.3

      THE ERROR:
      *****************************************************************
      15:53:54,291 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss
      -3.2.3/server/default/deploy/ghem3.jar
      15:53:54,582 WARN [verifier] EJB spec violation:
      Bean : DatabaseHandlerEJB
      Section: 22.2
      Warning: The Bean Provider must specify the fully-qualified name of the Java cla
      ss that implements the enterprise bean's business methods in the <ejb-class> ele
      ment.
      Info : Class not found on 'com.ghem3.dbhandler.DatabaseHandlerBean': No ClassL
      oaders found for: com.ghem3.dbhandler.DatabaseHandlerBean

      15:53:54,582 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-3.
      2.3/server/default/deploy/ghem3.jar
      org.jboss.deployment.DeploymentException: Verification of Enterprise Beans faile
      d, see above for error messages.
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:491)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:786)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:605)
      at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
      nDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
      at $Proxy6.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymen
      tScanner.java:302)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentS
      canner.java:476)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      doScan(AbstractDeploymentScanner.java:201)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      loop(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.
      run(AbstractDeploymentScanner.java:191)
      *****************************************************************

      MY ejb-jar FILE:
      *****************************************************************

      <!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>

      <ejb-name>DatabaseHandlerEJB</ejb-name>
      ejb.interfaces.com.ghem3.dbhandler.DatabaseHandlerHome
      ejb.interfaces.com.ghem3.dbhandler.DatabaseHandlerRemote
      <ejb-class>com.ghem3.dbhandler.DatabaseHandlerBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>



      </enterprise-beans>

      <assembly-descriptor>

      <security-role>

      This role represents everyone who is allowed full access to the beans.

      <role-name>everyone</role-name>
      </security-role>

      <method-permission>
      <role-name>everyone</role-name>

      <ejb-name>DatabaseHandlerEJB</ejb-name>
      <method-name>*</method-name>

      </method-permission>

      <container-transaction>

      <ejb-name>DatabaseHandlerEJB</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      </assembly-descriptor>
      </ejb-jar>
      *****************************************************************

      MY Jboss.xml FILE:
      *****************************************************************
      <?xml version="1.0"?>


      <enterprise-beans>

      <ejb-name>DatabaseHandlerEJB</ejb-name>
      <jndi-name>DatabaseHandlerRemote</jndi-name>

      </enterprise-beans>

      *****************************************************************

      MY BEAN CLASS:
      *****************************************************************

      package com.ghem3.dbhandler;

      import javax.ejb.SessionBean;
      import javax.ejb.EJBException;
      import javax.ejb.SessionContext;
      import java.util.LinkedList;
      import java.util.Map;
      import java.util.StringTokenizer;
      import java.sql.SQLException;
      import java.sql.Connection;
      import java.util.*;
      import java.sql.*;
      import java.sql.Statement;
      import java.sql.ResultSet;
      import java.rmi.RemoteException;


      public class DatabaseHandlerBean implements SessionBean {
      private SessionContext context;
      private static DatabaseHandlerBean instance;
      private static int lockID = -1;

      public DatabaseHandlerBean ejbCreate(){}

      static {
      if (instance == null)
      instance = new DatabaseHandlerBean();
      }

      public static DatabaseHandlerBean getInstance() {
      return (instance);
      }
      /*
      * ...
      */
      *****************************************************************

      MY HOME INTERFACE:
      *****************************************************************

      package com.ghem3.dbhandler;

      import javax.ejb.EJBHome;
      import javax.ejb.CreateException;
      import java.rmi.RemoteException;

      public interface DatabaseHandlerHome extends EJBHome{
      DatabaseHandlerRemote create() throws RemoteException, CreateException;
      }
      *****************************************************************

      MY REMOTE INTERFACE:
      *****************************************************************

      package com.ghem3.dbhandler;

      import javax.ejb.EJBObject;
      import java.sql.SQLException;
      import java.util.Map;

      public interface DatabaseHandlerRemote extends EJBObject {

      public DatabaseHandlerBean getInstance();

      public DataSet select(String columns, String from, String criteria, boolean lock, Object requester) throws SQLException, DBLockException;

      public int insert(String table, String columns, String values) throws SQLException;

      public int delete(String table, String criteria) throws DBLockException;
      }

      *****************************************************************

      Anyone with a solution??