Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

xdoclet help w/ sessionbean
Hey all,

Does anyone see anything wrong w/ this session bean. I'm pretty new to
XDoclet and having various problems in compiling or loading. So now
I'm just trying a very basic example. I get the following compile
errors below it.

/**
*
* @ejb.bean
*      name="comp/History"
*      type="Stateless"
*      view-type="remote"
*      jndi-name="ejb/comp/History"
*
* @ejb.home
*      extends="javax.ejb.EJBHome"
*      remote-class="com.place.management.ejb.session.HistoryHome"
*
* @ejb.interface
*      extends="javax.ejb.EJBObject"
*      remote-class="com.place.management.ejb.session.History"
*/

public class HistoryBean implements SessionBean
{
private transient SessionContext context = null;

public void setSessionContext(SessionContext ctx) {
context = ctx;
}

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

/**
* @ejb.create-method
*/

public void ejbCreate() throws CreateException { }

/**
* @ejb.home-method
*/

public void ejbRemove() throws EJBException { }

/**
* @ejb.home-method
*/

public void ejbPassivate() { }

/**
* @ejb.home-method
*/

public void ejbActivate() { }

/**
* @ejb.home-method
*/

public void ejbRemove() { }
}

--- jboss server output ---

[javac] Compiling 42 source files to /home/myProject/build/classes
[javac] /home/myProject/src/com/place/management/ejb/session/HistoryBean.java:74:
ejbRemove() is already defined in
com.place.management.ejb.session.HistoryBean
[javac]     public void ejbRemove() { }
[javac]                     ^
[javac] /home/myProject/build/gen/com/place/management/ejb/session/HistoryHome.java
:29:
remove() is already defined in
com.place.management.ejb.session.HistoryHome
[javac]    public void remove()
[javac]                ^
[javac] 2 errors

Report this thread to moderator Post Follow-up to this message
Old Post
Willian Irving Zumwalt
09-24-04 01:58 AM


Re: xdoclet help w/ sessionbean
Apologies, wrong error, typo in the original. Here is my real problem.

Hey all,

Does anyone see anything wrong w/ this session bean. I'm pretty new to
XDoclet and having various problems in compiling or loading. So now
I'm just trying a very basic example. I get the following compile
errors below it.

/**
*
* @ejb.bean
*      name="comp/History"
*      type="Stateless"
*      view-type="remote"
*      jndi-name="ejb/comp/History"
*
* @ejb.home
*      extends="javax.ejb.EJBHome"
*      remote-class="com.place.management.ejb.session.HistoryHome"
*
* @ejb.interface
*      extends="javax.ejb.EJBObject"
*      remote-class="com.place.management.ejb.session.History"
*/

public class HistoryBean implements SessionBean
{
private transient SessionContext context = null;

public void setSessionContext(SessionContext ctx) {
context = ctx;
}

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

/**
* @ejb.create-method
*/

public void ejbCreate() throws CreateException { }

/**
* @ejb.home-method
*/

public void ejbRemove() throws EJBException { }

/**
* @ejb.home-method
*/

public void ejbPassivate() { }

/**
* @ejb.home-method
*/

public void ejbActivate() { }
}

--- Here is the server output error that I don't understand ...

...
21:25:49,635 INFO  [EjbModule] Deploying comp/History
21:25:49,821 ERROR [StatelessSessionContainer] Initialization failed
jboss.j2ee:jndiName=ejb/comp/History,service=EJB
java.lang.NoSuchMethodException:
org.jboss.ejb.StatelessSessionContainer.removeHome() at
java.lang.Class.getMethod(Class.java:978)
at
org.jboss.ejb.StatelessSessionContainer.setupHomeMapping(StatelessSession
Container.java:488)
at
org.jboss.ejb.StatelessSessionContainer.createService(StatelessSessionCon
tainer.java:142)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupp
ort.java:237)
at
org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanS
upport.java:219)
at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI
mpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java
:60)

Report this thread to moderator Post Follow-up to this message
Old Post
William Zumwalt
09-24-04 08:57 AM


Re: xdoclet help w/ sessionbean
William Zumwalt wrote:

> Apologies, wrong error, typo in the original. Here is my real problem.
>     /**
>      * @ejb.home-method
>      */
>
>     public void ejbRemove() throws EJBException { }

>     /**
>      * @ejb.home-method
>      */

>     public void ejbPassivate() { }
>
>     /**
>      * @ejb.home-method
>      */

>     public void ejbActivate() { }

Try to cut alle the @ejb.home-method tags here and see waht happens.

-marek

Report this thread to moderator Post Follow-up to this message
Old Post
Marek Lange
09-24-04 08:57 AM


Re: xdoclet help w/ sessionbean
Thanks, that fixed it, but I'm not sure why. I thought those were home
methods and should have been declared as such. In fact, I'm still
sorta sure of that.

Marek Lange <marek.lange@web.de> wrote in message news:<2rhu83F1amu68U1@uni-berlin.de>...[c
olor=darkred]
> William Zumwalt wrote:
> 
> 
> 
> 
>
> Try to cut alle the @ejb.home-method tags here and see waht happens.
>
> -marek[/color]

Report this thread to moderator Post Follow-up to this message
Old Post
Willian Irving Zumwalt
09-24-04 09:01 PM


Re: xdoclet help w/ sessionbean
Willian Irving Zumwalt wrote:

> Thanks, that fixed it, but I'm not sure why. I thought those were home
> methods and should have been declared as such. In fact, I'm still
> sorta sure of that.

You're not specifying the _view-type_:

/**
* @ejb.home-method view-type="[type]"
*/

where [type] is "local", "remote" or "both".

--
/**
* @author Darryl L. Pierce <mcpierce@myrealbox.com>
* @see    The Infobahn Offramp <http://mcpierce.mypage.org>
* @quote  "Lobby, lobby, lobby, lobby, lobby, lobby..." - Adrian Monk
*/

Report this thread to moderator Post Follow-up to this message
Old Post
Darryl L. Pierce
09-25-04 08:59 AM


Re: xdoclet help w/ sessionbean
Darryl L. Pierce wrote:
> Willian Irving Zumwalt wrote:
>
> 
>
>
> You're not specifying the _view-type_:
>
> /**
>  * @ejb.home-method view-type="[type]"
>  */
>
> where [type] is "local", "remote" or "both".

Remote is default IMHO. Not mandatory.

-marek

Report this thread to moderator Post Follow-up to this message
Old Post
Marek Lange
09-27-04 09:01 PM


Re: xdoclet help w/ sessionbean
Marek Lange wrote:
 
>
> Remote is default IMHO. Not mandatory.

Local is the default. Check
<http://xdoclet.sourceforge.net/xdoc...__0__
1_>
and lookup the entry for @ejb.home-method for more information.

--
/**
* @author Darryl L. Pierce <mcpierce@myrealbox.com>
* @see    The Infobahn Offramp <http://mcpierce.mypage.org>
* @quote  "Lobby, lobby, lobby, lobby, lobby, lobby..." - Adrian Monk
*/

Report this thread to moderator Post Follow-up to this message
Old Post
Darryl L. Pierce
09-28-04 02:03 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Java Beans archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:24 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.