On Tue, 18 Feb 2003 08:39, Valter Nogueira wrote:

> What I don't get it is: How do I write xml config files?

I can highly recommend using XDoclet, takes most of the pain out of doing 
this. You just write and annotate the bean implementation and xdoclet will do 
most of the rest.  (http://xdoclet.sourceforge.net/) 

For a good example of using xdoclet, grab a copy of xpetstore  from 
http://xpetstore.sourceforge.net/ which is the sun petstore app ported to use 
xdoclet and is deployable on multiple different appserver platforms (well, on 
jboss and weblogic at least)

> For example I have a simple bean called MathStuff wich implements a single
> method: int fatorial(int n).
>
> I have compiled MathStuff (remote interface), MathStuffHome and
> MathStuffBean sucessfully and saved the class file at
> JBOSS_HOME/server/default/deploy/myapp.ear
>
> I believe that I just need to write ejb-jar.xml and jboss.xml at META-INF.
> Is that correct?

Yes, but that should be a jar file not an ear to deploy that way. If you have 
multiple bean jar files and/or connectors (sar files) or server/jsps (in war 
files) and even web apps (wsr files?) then you can package them all together 
in an ear file and then you need the application.xml.

> Is the following ejb-jar.xml near of correction?
>
> <ejb-jar>
>       <enterprise-beans>
>               <session>
>                       <ejb-name>ejb/MathStuff</ejb-name>
>                       <home>MathStuffHome</home>
>                       <remote>MathStuff</remote>
>                       <ejb-class>MathStuffBean</ejb-class.
>               </session>
>       </enterprise-beans>
> </ejb-jar>

I don't think the '/' should be in the ejb-name but with a session bean it 
should be OK (cmp entity beans require a name that is a valid java ID). 
Probably should have a <session-type>Stateless</session-type> (or Statefull). 
I'm not sure what the default is.

the class names should be fully qualified with the package name (if any).

As I said above, xdoclet can take all the pain out of this, I rarely need to 
even look at the ejb-jar.xml, jboss.xml or jbosscmp-jdbc.xml files anymore.

brian...



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to