-
1. Re: JBoss Deployment
jmspaggi Apr 11, 2004 8:08 PM (in response to stanley1610)Ho, very simple ;)
You are wrong somewhere. Simply look to the declaration of your EJB, or everythink else.
I have got many time this error, but each time, solve by seing a mistake on somethink.
One more think, please be sure to do not use accent caracteres (likes éà èïô, etc.) on description.
If your not able to solve your probleme, you can post your xml files here or the javadoc of your ejb...
JMS -
2. Re: JBoss Deployment
stanley1610 Apr 12, 2004 12:29 AM (in response to stanley1610)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>Preferences>Java>Code Generation>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>Preferences>Java>Code Generation>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" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar >
<![CDATA[No Description.]]>
<display-name>Generated by XDoclet</display-name>
<enterprise-beans>
<!-- Session Beans -->
<![CDATA[EJB that computes Fibonacci suite]]>
<display-name>Fibo EJB</display-name>
<ejb-name>Fibo</ejb-name>
tutorial.interfaces.FiboHome
tutorial.interfaces.Fibo
<ejb-class>tutorial.ejb.FiboBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<!--
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 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 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 -
3. Re: JBoss Deployment
jmspaggi Apr 12, 2004 10:14 AM (in response to stanley1610)Hum... Strange...
Your .xml file is really different than mine...
Here is mine :<?xml version="1.0" encoding="UTF-8"?> <!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 > <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>RemoteFiboJMS</ejb-name> <home>tutorialjms.interfaces.RemoteFiboJMSHome</home> <remote>tutorialjms.interfaces.RemoteFiboJMS</remote> <ejb-class>tutorialjms.ejb.TestRemoteBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> </session> <session > <description>[CDATA[EJB that computes Fibonacci suite]]</description> <display-name>Fibo EJB</display-name> <ejb-name>FiboJMS</ejb-name> <home>tutorialjms.interfaces.FiboJMSHome</home> <remote>tutorialjms.interfaces.FiboJMS</remote> <ejb-class>tutorialjms.ejb.FiboJMSBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type> </session> <!-- Entity Beans --> <!-- Message Driven Beans --> </enterprise-beans> <!-- Relationships --> <!-- Assembly Descriptor --> <assembly-descriptor > <!-- finder permissions --> <!-- finder permissions --> <!-- transactions --> <!-- finder transactions --> </assembly-descriptor> </ejb-jar>
I have remove comments for keep it human readable... As you can see in the session section, each string is as parameter in my xml file. In yours,<!-- Session Beans --> [CDATA[EJB that computes Fibonacci suite]] <display-name>Fibo EJB</display-name> <ejb-name>Fibo</ejb-name> tutorial.interfaces.FiboHome tutorial.interfaces.Fibo <ejb-class>tutorial.ejb.FiboBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Container</transaction-type>
There is many tag missing.
Is it because you haven't past it as {code}? Or is theres really missing on your xml file?
JMS -
4. Re: JBoss Deployment
stanley1610 Apr 12, 2004 11:36 AM (in response to stanley1610)Let me recapture the code as the following;
<?xml version="1.0" encoding="UTF-8"?> <!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 > <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>
But this code should be autogenerated by JBoss-IDE. What I wrote myself are
1. FiboBean.java/* * Created on 2004/4/10 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>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>Preferences>Java>Code Generation>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; } }
2. application.xml<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd"> <application> <display-name>Sum Application</display-name> <module> <ejb>FiboEJB.jar</ejb> </module> <module> <web> <web-uri>FiboWeb.war</web-uri> <context-root>/fibo</context-root> </web> </module> </application>
What's wrong? Please help.
-stan -
5. Re: JBoss Deployment
jmspaggi Apr 13, 2004 1:31 PM (in response to stanley1610)Humm... All seems to be good. Have you take a look on your deploy parameters?
-
6. Re: JBoss Deployment
stanley1610 Apr 14, 2004 3:06 AM (in response to stanley1610)Hi jmspaggi,
Which parameters do you mean? I just follow the instructions of the PDF. Is there any tricky?
Thanks,
-stan -
7. Re: JBoss Deployment
jayganesh786 Apr 14, 2004 9:58 AM (in response to stanley1610)Hi guys,
I am not here to comment anything particular on this specific topic, but I have just posted my question on another thread, but I thought it may be quicker to raise it here. My question is, I got stuck in "Generating EJB related Files" section of tutorial. My problem is I can not see "XDoclet Configuation" tab and "pacakging configurations" tab in my java-project properties window. WHY? WHY? Please let me know, because you guys have passed through that stage comfortably. or did you?
Thanks in advance
Nilesh Patel -
8. Re: JBoss Deployment
jayganesh786 Apr 14, 2004 10:03 AM (in response to stanley1610)sorry guys. I resolved this issue, by selecting "java perspective". Until now I was looking at "resource perspective". Silly me. On the other hand I would question, whether it should be like this. I think, like all other tabs, which are common between java perspective and resource perspective, XDoclet related tabs should be avaialble into resource perspective too. But never mind, at least we know now.
Thanks guys if you have replied or spent time into this already.
Nilesh Patel -
9. Re: JBoss Deployment
stanley1610 Apr 14, 2004 10:06 PM (in response to stanley1610)Hi jayganesh786,
Do you mean that you could follow the Tutorial and run it successfully? But I can't and get the deployment error. By your experience, what did I go wrong? Thanks.
-stan -
10. Re: JBoss Deployment
jayganesh786 Apr 15, 2004 4:07 AM (in response to stanley1610)Sorry Stan.
I posted the question, which is related to before deployment. Now I ran deployment section and I indeed get the very same error. I don,t know what is the cause, so I am in the same boat as yours. Any help from JBOSS-IDE world will be highly appreciated.
Thanks.
Nilesh -
11. Re: JBoss Deployment
stanley1610 Apr 16, 2004 4:29 AM (in response to stanley1610)Hi all,
Do you deploy the Tutorial successfully? If yes, could you share your opinion with us? Both Nilesh and I could not run it well and get the deployment error. Please help.
If you think the Tutorial cannot work well actually, can you suggest any Tutorial, which could be deployed successfully in practice, please?
Many thanks,
-stan -
12. Re: JBoss Deployment
albertfang Apr 17, 2004 3:48 AM (in response to stanley1610)Mine is working smoothly. Unfortunately, I don't know how to attach my files to this post. Maybe I can e-mai you if you give me your email address.
-
13. Re: JBoss Deployment
stanley1610 Apr 17, 2004 12:10 PM (in response to stanley1610)Hi albertfang,
Some of your message could not be seen. Can you tell me any trick to follow the Tutorial? What's wrong in our code?
Thanks,
-stan -
14. Re: JBoss Deployment
albertfang Apr 17, 2004 7:36 PM (in response to stanley1610)Hi, Stan.
Nothing special about this Fibo tutorial. I just followed the instructions step by step and it woked. I even changed the internal code from UTF-8 to Big5(Chinese, Taiwan) and it woked too. Can you tell me how to attach my files to this post or I just send an email attached with my files to you if you give me your email address. Then you can compare yours with mine. Because I am quite new to Eclipse, Jboss and Xdoclet, you have search any minor mistakes you might make. Good luck.