You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@beehive.apache.org by Aaron Oathout <ao...@gmail.com> on 2005/09/27 06:48:48 UTC

Beehive Control inside WebService gives NPE

First off, thx for all the work the beehive team (and community) has put
into beehive. Nice to have to features of workshop in an open fashion. Now
onto the issue. I'm having a problem when trying to use a control inside my
beehive webservice. I've created a very simple control that works perfectly
inside a page flow, but when I try to reuse that control inside a simple
webservice my control is never getting configured/created. Here is the
webservice code:

package web;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import org.apache.axis.utils.StringUtils;
import org.apache.beehive.controls.api.bean.Control;
import controls.SimpleControl;
@WebService public class Blank {
@Control private SimpleControl control;
@WebMethod public String sayHelloWorld(String s) {
return control.sayHello(s);
}
@WebMethod public String sayHelloWorldInParam(@WebParam String greetee) {
if (StringUtils.isEmpty(greetee))
greetee = "World";
return control.sayHello(greetee);
}
public String sayNothingOverTheWeb()
{
return "Not for Web consumption!";
}
}

Here is the control interface code:
package controls;
import org.apache.beehive.controls.api.bean.ControlInterface;
@ControlInterface
public interface SimpleControl {
public String sayHello(String name);
}

Here is the control impl code:
package controls;
import org.apache.beehive.controls.api.bean.ControlImplementation;
@ControlImplementation(isTransient=true)
public class SimpleControlImpl implements SimpleControl {
/* (non-Javadoc)
* @see controls.SimpleControl#sayHello(java.lang.String)
*/
public String sayHello(String name) {
return "Hello, " + name + "!";
}
}

When I invoke the web service I get a NPE because my control is never
initialized (looks like the beaninfo and control initializer are being
created fine). Could somebody give me an idea of what may be going wrong, or
where in the beehive source I could look to help me resolve this issue?

I will be attending BEA World this week so if any of the dev. team (or
community memebers) are there and would be willing to meet to discuss these
issues (possibly at the BOF session tomorrow night) I would love to meet up.

Thanks,

Aaron Oathout

Re: Beehive Control inside WebService gives NPE

Posted by Eddie O'Neil <ek...@gmail.com>.
  And, I'll look at getting the patch for 804 committed in the next day or so.

Eddie


On 9/27/05, Aaron Oathout <ao...@gmail.com> wrote:
> Thanks for the respons chad. I'll take a look at the Jira issue and apply it
> to my local copy.
>
> Aaron
>
> On 9/27/05, Chad Schoettger <ch...@gmail.com> wrote:
> >
> > Hi Aaron,
> >
> > It appears you have run into BEEHIVE-804. I have attached a patch in JIRA
> > for this issue, but it may not get commited until after 1.0 has been
> > released (hopefully later this week).
> >
> > - Chad
> >
> > On 9/26/05, Aaron Oathout <ao...@gmail.com> wrote:
> > >
> > > First off, thx for all the work the beehive team (and community) has put
> > > into beehive. Nice to have to features of workshop in an open fashion.
> > > Now
> > > onto the issue. I'm having a problem when trying to use a control inside
> > > my
> > > beehive webservice. I've created a very simple control that works
> > > perfectly
> > > inside a page flow, but when I try to reuse that control inside a simple
> > > webservice my control is never getting configured/created. Here is the
> > > webservice code:
> > >
> > > package web;
> > > import javax.jws.WebMethod;
> > > import javax.jws.WebParam;
> > > import javax.jws.WebService;
> > > import org.apache.axis.utils.StringUtils;
> > > import org.apache.beehive.controls.api.bean.Control ;
> > > import controls.SimpleControl;
> > > @WebService public class Blank {
> > > @Control private SimpleControl control;
> > > @WebMethod public String sayHelloWorld(String s) {
> > > return control.sayHello(s);
> > > }
> > > @WebMethod public String sayHelloWorldInParam(@WebParam String greetee)
> > > {
> > > if (StringUtils.isEmpty(greetee))
> > > greetee = "World";
> > > return control.sayHello(greetee);
> > > }
> > > public String sayNothingOverTheWeb()
> > > {
> > > return "Not for Web consumption!";
> > > }
> > > }
> > >
> > > Here is the control interface code:
> > > package controls;
> > > import org.apache.beehive.controls.api.bean.ControlInterface;
> > > @ControlInterface
> > > public interface SimpleControl {
> > > public String sayHello(String name);
> > > }
> > >
> > > Here is the control impl code:
> > > package controls;
> > > import org.apache.beehive.controls.api.bean.ControlImplementation;
> > > @ControlImplementation(isTransient=true)
> > > public class SimpleControlImpl implements SimpleControl {
> > > /* (non-Javadoc)
> > > * @see controls.SimpleControl#sayHello(java.lang.String)
> > > */
> > > public String sayHello(String name) {
> > > return "Hello, " + name + "!";
> > > }
> > > }
> > >
> > > When I invoke the web service I get a NPE because my control is never
> > > initialized (looks like the beaninfo and control initializer are being
> > > created fine). Could somebody give me an idea of what may be going
> > > wrong, or
> > > where in the beehive source I could look to help me resolve this issue?
> > >
> > > I will be attending BEA World this week so if any of the dev. team (or
> > > community memebers) are there and would be willing to meet to discuss
> > > these
> > > issues (possibly at the BOF session tomorrow night) I would love to meet
> > > up.
> > >
> > > Thanks,
> > >
> > > Aaron Oathout
> > >
> > >
> >
>
>

Re: Beehive Control inside WebService gives NPE

Posted by Aaron Oathout <ao...@gmail.com>.
Thanks for the respons chad. I'll take a look at the Jira issue and apply it
to my local copy.

Aaron

On 9/27/05, Chad Schoettger <ch...@gmail.com> wrote:
>
> Hi Aaron,
>
> It appears you have run into BEEHIVE-804. I have attached a patch in JIRA
> for this issue, but it may not get commited until after 1.0 has been
> released (hopefully later this week).
>
> - Chad
>
> On 9/26/05, Aaron Oathout <ao...@gmail.com> wrote:
> >
> > First off, thx for all the work the beehive team (and community) has put
> > into beehive. Nice to have to features of workshop in an open fashion.
> > Now
> > onto the issue. I'm having a problem when trying to use a control inside
> > my
> > beehive webservice. I've created a very simple control that works
> > perfectly
> > inside a page flow, but when I try to reuse that control inside a simple
> > webservice my control is never getting configured/created. Here is the
> > webservice code:
> >
> > package web;
> > import javax.jws.WebMethod;
> > import javax.jws.WebParam;
> > import javax.jws.WebService;
> > import org.apache.axis.utils.StringUtils;
> > import org.apache.beehive.controls.api.bean.Control ;
> > import controls.SimpleControl;
> > @WebService public class Blank {
> > @Control private SimpleControl control;
> > @WebMethod public String sayHelloWorld(String s) {
> > return control.sayHello(s);
> > }
> > @WebMethod public String sayHelloWorldInParam(@WebParam String greetee)
> > {
> > if (StringUtils.isEmpty(greetee))
> > greetee = "World";
> > return control.sayHello(greetee);
> > }
> > public String sayNothingOverTheWeb()
> > {
> > return "Not for Web consumption!";
> > }
> > }
> >
> > Here is the control interface code:
> > package controls;
> > import org.apache.beehive.controls.api.bean.ControlInterface;
> > @ControlInterface
> > public interface SimpleControl {
> > public String sayHello(String name);
> > }
> >
> > Here is the control impl code:
> > package controls;
> > import org.apache.beehive.controls.api.bean.ControlImplementation;
> > @ControlImplementation(isTransient=true)
> > public class SimpleControlImpl implements SimpleControl {
> > /* (non-Javadoc)
> > * @see controls.SimpleControl#sayHello(java.lang.String)
> > */
> > public String sayHello(String name) {
> > return "Hello, " + name + "!";
> > }
> > }
> >
> > When I invoke the web service I get a NPE because my control is never
> > initialized (looks like the beaninfo and control initializer are being
> > created fine). Could somebody give me an idea of what may be going
> > wrong, or
> > where in the beehive source I could look to help me resolve this issue?
> >
> > I will be attending BEA World this week so if any of the dev. team (or
> > community memebers) are there and would be willing to meet to discuss
> > these
> > issues (possibly at the BOF session tomorrow night) I would love to meet
> > up.
> >
> > Thanks,
> >
> > Aaron Oathout
> >
> >
>

Re: Beehive Control inside WebService gives NPE

Posted by Chad Schoettger <ch...@gmail.com>.
Hi Aaron,

It appears you have run into BEEHIVE-804. I have attached a patch in JIRA
for this issue, but it may not get commited until after 1.0 has been
released (hopefully later this week).

- Chad

On 9/26/05, Aaron Oathout <ao...@gmail.com> wrote:
>
> First off, thx for all the work the beehive team (and community) has put
> into beehive. Nice to have to features of workshop in an open fashion. Now
> onto the issue. I'm having a problem when trying to use a control inside
> my
> beehive webservice. I've created a very simple control that works
> perfectly
> inside a page flow, but when I try to reuse that control inside a simple
> webservice my control is never getting configured/created. Here is the
> webservice code:
>
> package web;
> import javax.jws.WebMethod;
> import javax.jws.WebParam;
> import javax.jws.WebService;
> import org.apache.axis.utils.StringUtils;
> import org.apache.beehive.controls.api.bean.Control;
> import controls.SimpleControl;
> @WebService public class Blank {
> @Control private SimpleControl control;
> @WebMethod public String sayHelloWorld(String s) {
> return control.sayHello(s);
> }
> @WebMethod public String sayHelloWorldInParam(@WebParam String greetee) {
> if (StringUtils.isEmpty(greetee))
> greetee = "World";
> return control.sayHello(greetee);
> }
> public String sayNothingOverTheWeb()
> {
> return "Not for Web consumption!";
> }
> }
>
> Here is the control interface code:
> package controls;
> import org.apache.beehive.controls.api.bean.ControlInterface;
> @ControlInterface
> public interface SimpleControl {
> public String sayHello(String name);
> }
>
> Here is the control impl code:
> package controls;
> import org.apache.beehive.controls.api.bean.ControlImplementation;
> @ControlImplementation(isTransient=true)
> public class SimpleControlImpl implements SimpleControl {
> /* (non-Javadoc)
> * @see controls.SimpleControl#sayHello(java.lang.String)
> */
> public String sayHello(String name) {
> return "Hello, " + name + "!";
> }
> }
>
> When I invoke the web service I get a NPE because my control is never
> initialized (looks like the beaninfo and control initializer are being
> created fine). Could somebody give me an idea of what may be going wrong,
> or
> where in the beehive source I could look to help me resolve this issue?
>
> I will be attending BEA World this week so if any of the dev. team (or
> community memebers) are there and would be willing to meet to discuss
> these
> issues (possibly at the BOF session tomorrow night) I would love to meet
> up.
>
> Thanks,
>
> Aaron Oathout
>
>