Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JBoss Deployment

Status
Not open for further replies.

stanley1610

Programmer
Mar 22, 2004
42
HK
Hi forummates,

In order to learn J2EE, I am using Eclipse integrated with JBoss by a plug-in called JBoss-IDE.

I downloaded the document called "Tutorial-1.2.2.pdf" at the JBoss's download site and followed it one by one.

At the last step, which is the deployment, the console shows the following messages;

23:50:44,652 WARN [verifier] EJB spec violation:
Bean : Fibo
Section: 22.2
Warning: The Bean Provider must specify the fully-qualified name of the Java class that implements the enterprise bean's business methods in the <ejb-class> element.
Info : Class not found on 'tutorial.ejb.FiboBean': No ClassLoaders found for: tutorial.ejb.FiboBean

23:50:44,662 ERROR [MainDeployer] could not create deployment: file:/D:/jboss/server/default/tmp/deploy/tmp6161FiboApp.ear-contents/FiboEJB.jar
org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.

....

What wrong did I do? How could I solve the above problem? Please help me. Thanks.

-stan
 
Where did you get this "FiboEJB.jar" from ?
Are you sure that the EJB version of the jar is the same as JBoss ?
Is tutorial.ejb.FiboBean within the jar file ?
Is the qualified name of the bean the same as in the ejb xml descriptors ?
 
Hi JMS,

I do know what you mean clearly. I attach my Java FiboBean.java as the following. By this with XDoclet generation, Fibo.java and FiboHome.java were made automatically.

/*
* Created on 2004/4/10
*
* To change the template for this generated file go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
package tutorial.ejb;

import java.rmi.RemoteException;

import javax.ejb.CreateException;
import javax.ejb.EJBException;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;

/**
* @author cs_cwt
*
* To change the template for this generated type comment go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*
* @ejb.bean name = "Fibo"
* display-name = "Fibo EJB"
* description = "EJB that computes Fibonacci suite"
* view-type = "remote"
* jndi-name = "ejb/tutorial/Fibo"
*/
public class FiboBean implements SessionBean {

/**
*
*/
public FiboBean() {
super();
// TODO Auto-generated constructor stub
}

/**
* @author Teki Chan
* @name ejbCreate
*
* This method is without parameter as this EJB is stateless
*
* @throws CreateException
* @ejb.create-method
*/
public void ejbCreate()
throws CreateException {
}

/* (non-Javadoc)
* @see javax.ejb.SessionBean#ejbActivate()
*/
public void ejbActivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub

}

/* (non-Javadoc)
* @see javax.ejb.SessionBean#ejbPassivate()
*/
public void ejbPassivate() throws EJBException, RemoteException {
// TODO Auto-generated method stub

}

/* (non-Javadoc)
* @see javax.ejb.SessionBean#ejbRemove()
*/
public void ejbRemove() throws EJBException, RemoteException {
// TODO Auto-generated method stub

}

/* (non-Javadoc)
* @see javax.ejb.SessionBean#setSessionContext(javax.ejb.SessionContext)
*/
public void setSessionContext(SessionContext arg0)
throws EJBException, RemoteException {
// TODO Auto-generated method stub

}

/**
* @author Teki Chan
* @name compute
* @param number
* @return double[]
* @ejb.interface-method view-type = "remote"
*
* The business method of computing a Fibonacci suite
*/
public double[] compute(int number) {
if (number < 0) {
throw new EJBException("Argument should be positive");
}

double[] suite = new double[number+1];
suite[0] = 0;
if (number == 0) {
return suite;
}

suite[1] = 1;
for(int i=2; i<=number; i++) {
suite = suite[i-1] + suite[i-2];
}

return suite;
}
}

while ejb-jar.xml is

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "
<ejb-jar >

<description><![CDATA[No Description.]]></description>
<display-name>Generated by XDoclet</display-name>

<enterprise-beans>

<!-- Session Beans -->
<session >
<description><![CDATA[EJB that computes Fibonacci suite]]></description>
<display-name>Fibo EJB</display-name>

<ejb-name>Fibo</ejb-name>

<home>tutorial.interfaces.FiboHome</home>
<remote>tutorial.interfaces.Fibo</remote>
<ejb-class>tutorial.ejb.FiboBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>

</session>

<!--
To add session beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called session-beans.xml that contains
the <session></session> markup for those beans.
-->

<!-- Entity Beans -->
<!--
To add entity beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called entity-beans.xml that contains
the <entity></entity> markup for those beans.
-->

<!-- Message Driven Beans -->
<!--
To add message driven beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called message-driven-beans.xml that contains
the <message-driven></message-driven> markup for those beans.
-->

</enterprise-beans>

<!-- Relationships -->

<!-- Assembly Descriptor -->
<assembly-descriptor >
<!--
To add additional assembly descriptor info here, add a file to your
XDoclet merge directory called assembly-descriptor.xml that contains
the <assembly-descriptor></assembly-descriptor> markup.
-->

<!-- finder permissions -->

<!-- transactions -->

<!-- finder transactions -->
</assembly-descriptor>

</ejb-jar>

Please help. Thanks.

-stan
 
Hi sedj,

> Where did you get this "FiboEJB.jar" from ?
It is packaged by JBoss-IDE Automatically

> Are you sure that the EJB version of the jar is the same as JBoss ?
I think yes because the jar is done by Eclipse itself.

> Is tutorial.ejb.FiboBean within the jar file ?
Yes, I unzipped it and checked it.

> Is the qualified name of the bean the same as in the ejb xml descriptors ?
What does "qualified name"? I checked ejb-jar.xml and it looked fine.

The related codes were attached in the above message. Please help.

-stan

 
Hi forummates,

Do you think I have missed something?

-stan
 
Stanley

I've just worked through the tutorial with the same problem occurring. The problem would appear to be with the XDoclet commands. In the EJB the jndi-name is 'ejb/tutorial/Fibo', but the ejb-ref in the servlet is to 'tutorial.ejb.FiboBean' (and the package also points to tutorial/ejb)
I changed the jndi-name to 'tutorial/ejb/Fibo' and all is good.

A.J.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top