You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Philip Wachtel <su...@wachtel.us> on 2003/09/11 23:28:46 UTC

doDelete on TurbineUserPeer causes NullPointerException

Hi all,

I'm using:
Torque 3.1
Turbine 2.3

I'm getting a NullPointerException (see exception below) when I run the following code:

Criteria criteria = new Criteria().add(TurbineUser.USERNAME, "existingUserNameHere");
TurbineUserPeer.doDelete(criteria);

I get the following exception:
ERROR [HttpProcessor[8081][4]] (VelocityActionEvent.java:191) - Invokation of public void us.wachtel.turbine.modules.actions.security.UserAdmin.doRemoveuser(org.apache.turbine.util.RunData,org.apache.velocity.context.Context)
        java.lang.NullPointerException
        at org.apache.torque.util.BasePeer.doDelete(Unknown Source)
        at org.apache.torque.util.BasePeer.doDelete(Unknown Source)
        at us.wachtel.turbine.modules.actions.security.UserAdmin.doRemoveuser(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.apache.turbine.util.velocity.VelocityActionEvent.executeEvents(VelocityActionEvent.java:174)
        at org.apache.turbine.util.velocity.VelocityActionEvent.perform(VelocityActionEvent.java:116)
        ....

I've been looking around for days, trying to find out where this problem comes from.  I've been looking through the BasePeer source and near as I can tell, the error happens because the criterion in BasePeer.doDelete() method returns an invalid table name which chokes up the line 530:

530: ColumnMap[] columnMaps = dbMap.getTable(tab).getColumns();

because dbMap.getTable(tab) doesn't return an object.

I upgraded from older versions of torque and turbine because I was out of ideas.  Didn't help!

Any help would be greatly (really really greatly) appreciated.

Thanks,
Philip

Re: doDelete on TurbineUserPeer causes NullPointerException

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Philip Wachtel" <su...@wachtel.us> writes:

Do you have adapters configured in your torque.properties?

	Regards
		Henning



>------=_NextPart_000_0242_01C3788A.2804F7A0
>Content-Type: text/plain;
>	charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable

>Hi all,

>I'm using:
>Torque 3.1
>Turbine 2.3

>I'm getting a NullPointerException (see exception below) when I run the =
>following code:

>Criteria criteria =3D new Criteria().add(TurbineUser.USERNAME, =
>"existingUserNameHere");
>TurbineUserPeer.doDelete(criteria);

>I get the following exception:
>ERROR [HttpProcessor[8081][4]] (VelocityActionEvent.java:191) - =
>Invokation of public void =
>us.wachtel.turbine.modules.actions.security.UserAdmin.doRemoveuser(org.ap=
>ache.turbine.util.RunData,org.apache.velocity.context.Context)
>        java.lang.NullPointerException
>        at org.apache.torque.util.BasePeer.doDelete(Unknown Source)
>        at org.apache.torque.util.BasePeer.doDelete(Unknown Source)
>        at =
>us.wachtel.turbine.modules.actions.security.UserAdmin.doRemoveuser(Unknow=
>n Source)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at =
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java=
>:39)
>        at =
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI=
>mpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:324)
>        at =
>org.apache.turbine.util.velocity.VelocityActionEvent.executeEvents(Veloci=
>tyActionEvent.java:174)
>        at =
>org.apache.turbine.util.velocity.VelocityActionEvent.perform(VelocityActi=
>onEvent.java:116)
>        ....

>I've been looking around for days, trying to find out where this problem =
>comes from.  I've been looking through the BasePeer source and near as I =
>can tell, the error happens because the criterion in BasePeer.doDelete() =
>method returns an invalid table name which chokes up the line 530:

>530: ColumnMap[] columnMaps =3D dbMap.getTable(tab).getColumns();

>because dbMap.getTable(tab) doesn't return an object.

>I upgraded from older versions of torque and turbine because I was out =
>of ideas.  Didn't help!

>Any help would be greatly (really really greatly) appreciated.

>Thanks,
>Philip
>------=_NextPart_000_0242_01C3788A.2804F7A0--

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

"Dominate!! Dominate!! Eat your young and aggregate! I have grotty silicon!" 
      -- AOL CD when played backwards  (User Friendly - 200-10-15)

Re: doDelete on TurbineUserPeer causes NullPointerException

Posted by Philip Wachtel <su...@wachtel.us>.
Hi Scott,

Changing the code to TurbineSecurity.removeUser(user) worked!  Thanks!

Well, I'm happy that it works, but I'm nervous about not knowing why what I
was doing before wasn't working because I usually don't get bitten by
something only once.  I like to keep blithely wandering into the same
problems over and over again.  So, I'm still interested in pursuing why what
I had before didn't work.

I'm using the following classes:
import org.apache.turbine.services.security.TurbineSecurity;
import org.apache.turbine.om.security.peer.TurbineUserPeer;

Are these correct?  I thought so, but...

Ok, well, thanks.  Now I can at least get back to work!

Regards,
Philip

----- Original Message -----
From: "Scott Eade" <se...@backstagetech.com.au>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Thursday, September 11, 2003 7:28 PM
Subject: Re: doDelete on TurbineUserPeer causes NullPointerException


> Which SecurityService are you using?
>
> What package is the TurbineUserPeer class declared as in its import
> statement?
>
> Have you tried retrieving the user and then
> TurbineSecurity.removeUser(user)?
>
> Scott
>
> --
> Scott Eade
> Backstage Technologies Pty. Ltd.
> http://www.backstagetech.com.au
>
>
> Philip Wachtel wrote:
>
> >Hi all,
> >
> >I'm using:
> >Torque 3.1
> >Turbine 2.3
> >
> >I'm getting a NullPointerException (see exception below) when I run the
following code:
> >
> >Criteria criteria = new Criteria().add(TurbineUser.USERNAME,
"existingUserNameHere");
> >TurbineUserPeer.doDelete(criteria);
> >
> >I get the following exception:
> >ERROR [HttpProcessor[8081][4]] (VelocityActionEvent.java:191) -
Invokation of public void
us.wachtel.turbine.modules.actions.security.UserAdmin.doRemoveuser(org.apach
e.turbine.util.RunData,org.apache.velocity.context.Context)
> >        java.lang.NullPointerException
> >        at org.apache.torque.util.BasePeer.doDelete(Unknown Source)
> >        at org.apache.torque.util.BasePeer.doDelete(Unknown Source)
> >        at
us.wachtel.turbine.modules.actions.security.UserAdmin.doRemoveuser(Unknown
Source)
> >        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
> >        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
> >        at java.lang.reflect.Method.invoke(Method.java:324)
> >        at
org.apache.turbine.util.velocity.VelocityActionEvent.executeEvents(VelocityA
ctionEvent.java:174)
> >        at
org.apache.turbine.util.velocity.VelocityActionEvent.perform(VelocityActionE
vent.java:116)
> >        ....
> >
> >I've been looking around for days, trying to find out where this problem
comes from.  I've been looking through the BasePeer source and near as I can
tell, the error happens because the criterion in BasePeer.doDelete() method
returns an invalid table name which chokes up the line 530:
> >
> >530: ColumnMap[] columnMaps = dbMap.getTable(tab).getColumns();
> >
> >because dbMap.getTable(tab) doesn't return an object.
> >
> >I upgraded from older versions of torque and turbine because I was out of
ideas.  Didn't help!
> >
> >Any help would be greatly (really really greatly) appreciated.
> >
> >Thanks,
> >Philip
> >
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org
>
>


Re: doDelete on TurbineUserPeer causes NullPointerException

Posted by Scott Eade <se...@backstagetech.com.au>.
Which SecurityService are you using?

What package is the TurbineUserPeer class declared as in its import 
statement?

Have you tried retrieving the user and then 
TurbineSecurity.removeUser(user)?

Scott

-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au


Philip Wachtel wrote:

>Hi all,
>
>I'm using:
>Torque 3.1
>Turbine 2.3
>
>I'm getting a NullPointerException (see exception below) when I run the following code:
>
>Criteria criteria = new Criteria().add(TurbineUser.USERNAME, "existingUserNameHere");
>TurbineUserPeer.doDelete(criteria);
>
>I get the following exception:
>ERROR [HttpProcessor[8081][4]] (VelocityActionEvent.java:191) - Invokation of public void us.wachtel.turbine.modules.actions.security.UserAdmin.doRemoveuser(org.apache.turbine.util.RunData,org.apache.velocity.context.Context)
>        java.lang.NullPointerException
>        at org.apache.torque.util.BasePeer.doDelete(Unknown Source)
>        at org.apache.torque.util.BasePeer.doDelete(Unknown Source)
>        at us.wachtel.turbine.modules.actions.security.UserAdmin.doRemoveuser(Unknown Source)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:324)
>        at org.apache.turbine.util.velocity.VelocityActionEvent.executeEvents(VelocityActionEvent.java:174)
>        at org.apache.turbine.util.velocity.VelocityActionEvent.perform(VelocityActionEvent.java:116)
>        ....
>
>I've been looking around for days, trying to find out where this problem comes from.  I've been looking through the BasePeer source and near as I can tell, the error happens because the criterion in BasePeer.doDelete() method returns an invalid table name which chokes up the line 530:
>
>530: ColumnMap[] columnMaps = dbMap.getTable(tab).getColumns();
>
>because dbMap.getTable(tab) doesn't return an object.
>
>I upgraded from older versions of torque and turbine because I was out of ideas.  Didn't help!
>
>Any help would be greatly (really really greatly) appreciated.
>
>Thanks,
>Philip
>  
>




Re: doDelete on TurbineUserPeer causes NullPointerException

Posted by "Henning P. Schmiedehausen" <hp...@intermeta.de>.
"Philip Wachtel" <su...@wachtel.us> writes:

Do you have adapters configured in your torque.properties?

	Regards
		Henning



>------=_NextPart_000_0242_01C3788A.2804F7A0
>Content-Type: text/plain;
>	charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable

>Hi all,

>I'm using:
>Torque 3.1
>Turbine 2.3

>I'm getting a NullPointerException (see exception below) when I run the =
>following code:

>Criteria criteria =3D new Criteria().add(TurbineUser.USERNAME, =
>"existingUserNameHere");
>TurbineUserPeer.doDelete(criteria);

>I get the following exception:
>ERROR [HttpProcessor[8081][4]] (VelocityActionEvent.java:191) - =
>Invokation of public void =
>us.wachtel.turbine.modules.actions.security.UserAdmin.doRemoveuser(org.ap=
>ache.turbine.util.RunData,org.apache.velocity.context.Context)
>        java.lang.NullPointerException
>        at org.apache.torque.util.BasePeer.doDelete(Unknown Source)
>        at org.apache.torque.util.BasePeer.doDelete(Unknown Source)
>        at =
>us.wachtel.turbine.modules.actions.security.UserAdmin.doRemoveuser(Unknow=
>n Source)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at =
>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java=
>:39)
>        at =
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI=
>mpl.java:25)
>        at java.lang.reflect.Method.invoke(Method.java:324)
>        at =
>org.apache.turbine.util.velocity.VelocityActionEvent.executeEvents(Veloci=
>tyActionEvent.java:174)
>        at =
>org.apache.turbine.util.velocity.VelocityActionEvent.perform(VelocityActi=
>onEvent.java:116)
>        ....

>I've been looking around for days, trying to find out where this problem =
>comes from.  I've been looking through the BasePeer source and near as I =
>can tell, the error happens because the criterion in BasePeer.doDelete() =
>method returns an invalid table name which chokes up the line 530:

>530: ColumnMap[] columnMaps =3D dbMap.getTable(tab).getColumns();

>because dbMap.getTable(tab) doesn't return an object.

>I upgraded from older versions of torque and turbine because I was out =
>of ideas.  Didn't help!

>Any help would be greatly (really really greatly) appreciated.

>Thanks,
>Philip
>------=_NextPart_000_0242_01C3788A.2804F7A0--

-- 
Dipl.-Inf. (Univ.) Henning P. Schmiedehausen          INTERMETA GmbH
hps@intermeta.de        +49 9131 50 654 0   http://www.intermeta.de/

Java, perl, Solaris, Linux, xSP Consulting, Web Services 
freelance consultant -- Jakarta Turbine Development  -- hero for hire

"Dominate!! Dominate!! Eat your young and aggregate! I have grotty silicon!" 
      -- AOL CD when played backwards  (User Friendly - 200-10-15)

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org