You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Youngho Cho <yo...@nannet.co.kr> on 2001/04/19 10:42:39 UTC

Group/Permission/Role does not insert now !

Hi,

I would like to insert Group/Permission/Role.
But I have following Error Message( I update the lastest cvs )

How can I add thease Secure Object again ?

Thanks,

youngho

Horrible Exception: java.lang.reflect.InvocationTargetException: java.lang.NullPointerException
 at java.util.Hashtable.get(Hashtable.java(Compiled Code))
 at org.apache.turbine.util.db.IDBroker.getNextIds(IDBroker.java:353)
 at org.apache.turbine.util.db.IDBroker.getIdAsBigDecimal(IDBroker.java:280)
rethrown as org.apache.turbine.util.security.DataBackendException: addGroup(Group) failed
 at org.apache.turbine.util.TurbineException.<init>(TurbineException.java:173)
 at org.apache.turbine.util.security.TurbineSecurityException.<init>(TurbineSecurityException.java:88)
 at org.apache.turbine.util.security.DataBackendException.<init>(DataBackendException.java:89)
 at org.apache.turbine.services.security.db.DBSecurityService.addGroup(DBSecurityService.java:744)
 at org.apache.turbine.services.security.TurbineSecurity.addGroup(TurbineSecurity.java:710)
 at com.nannet.jettiger.modules.actions.admin.group.GroupAction.doInsert(GroupAction.java:46)
 at java.lang.reflect.Method.invoke(Native Method)
 at org.apache.turbine.util.velocity.VelocityActionEvent.executeEvents(VelocityActionEvent.java:164)
 at org.apache.turbine.util.velocity.VelocityActionEvent.perform(VelocityActionEvent.java:111)
 at org.apache.turbine.modules.actions.VelocityAction.perform(VelocityAction.java:114)
 

RE: Group/Permission/Role does not insert now !

Posted by Pere Torrodellas <pt...@fihoca.com>.
As I said in a previous message, I'm pretty sure that your exception is related
to the error I reported a few days ago. This is the fix, or use the patch added
by John to the system.

Pere Torrodellas

----- Mensaje original -----
>De: John McNally <jm...@collab.net>
>Para: <tu...@jakarta.apache.org>
>Enviado: jueves 19 de abril de 2001 20:54
>Asunto: Re: Security exception with Oracle
>
> Added to cvs.
> Thank you.
> John McNally
>
> Pere Torrodellas wrote:
> >
> > > This time I got a new exception, caused ultimately by the fact that
> > > TableMap.getPrimaryKeyMethodInfo() returns null when invoked in
> > > BasePeer.doInsert() for Security tables. I looked into
> > > TurbineMapBuilder, and it seems that the Security TableMaps pkInfo
> > > attribute is not being set. Shouldn't it be initialized there?
> > >
> >
> > I managed to fix the error by adding initialization statements for
> > TableMap.pkInfo in TurbineMapBuilder. I expect that someone more
> > knowledgeable will check this and take advantage of it to build the
> > right patch.
> >
> > Please excuse me if this is not a CVS diff, but:
> >
> > - I'm testing with the TDK 1.1a12, not the last Turbine source.
> > - I'm not used to CVS (yet?).
> >
> > TurbineMapBuilder.doBuild() {
> > ...............
> >         TableMap tMap = dbMap.getTable(getTableUser());
> >         tMap.setPrimaryKeyMethod("idbroker_table");
> >         tMap.setPrimaryKeyMethodInfo(tMap.getName()); /*ADDED*/
> > ...............
> >         tMap = dbMap.getTable(getTableGroup());
> >         tMap.setPrimaryKeyMethod("idbroker_table");
> >         tMap.setPrimaryKeyMethodInfo(tMap.getName()); /*ADDED*/
> > ................
> >         tMap = dbMap.getTable(getTableRole());
> >         tMap.setPrimaryKeyMethod("idbroker_table");
> >         tMap.setPrimaryKeyMethodInfo(tMap.getName()); /*ADDED*/
> > ................
> >         tMap = dbMap.getTable(getTablePermission());
> >         tMap.setPrimaryKeyMethod("idbroker_table");
> >         tMap.setPrimaryKeyMethodInfo(tMap.getName()); /*ADDED*/
> > ................
> >         tMap = dbMap.getTable(getTableJobentry());
> >         tMap.setPrimaryKeyMethod("idbroker_table");
> >         tMap.setPrimaryKeyMethodInfo(tMap.getName()); /*ADDED*/
> > ................
> > }
> >
> > Pere Torrodellas



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


Re: Group/Permission/Role does not insert now !

Posted by Youngho Cho <yo...@nannet.co.kr>.
Hi Jason,

Here is my Code.
I'm  just following old flux code.

When I changed my code like the recent flux code , 
Group group = TurbineSecurity.getNewGroup(null)
instead of Group group = new TurbineGroup()
I have same results.

What I'm doing is 
1. update jakarta-turbine source
2. compile 
3. update tubine.jar in my package and tomcat WEB-INF/lib directory
4. compile my package
5. run 
6. try to add new group
7 get error message.

Thanks.

youngho


public class GroupAction extends SecureAction
{

    /**
     *
     */
    public void doInsert(RunData data, Context context)
        throws Exception
    {

        String name = data.getParameters().getString("name");

  if( name == null || name.length() == 0 )
  {
   data.setMessage("?? ???? ?? Group ??? ?? ??? ????.");
   return;
  }

        Group group = new TurbineGroup();        
        data.getParameters().setProperties(group);

        try
        {
            TurbineSecurity.addGroup(group);
        }
        catch (EntityExistsException eee)
        {
            data.setMessage("?? ???? ?? Group ??? ?? ?????.");

            context.put("name", name);

            context.put("group", group);
            /*
             * We are still in insert mode. So keep this
             * value alive.
             */
            data.getParameters().add("mode", "insert");
            setTemplate(data, "/admin/group/GroupForm.vm");
        }

    }


Horrible Exception: java.lang.reflect.InvocationTargetException: java.lang.NullPointerException
 at java.util.Hashtable.get(Hashtable.java(Compiled Code))
 at org.apache.turbine.util.db.IDBroker.getNextIds(IDBroker.java:353)
 at org.apache.turbine.util.db.IDBroker.getIdAsBigDecimal(IDBroker.java:280)
rethrown as org.apache.turbine.util.security.DataBackendException: addGroup(Group) failed
 at org.apache.turbine.util.TurbineException.<init>(TurbineException.java:173)
 at org.apache.turbine.util.security.TurbineSecurityException.<init>(TurbineSecurityException.java:88)
 at org.apache.turbine.util.security.DataBackendException.<init>(DataBackendException.java:89)
 at org.apache.turbine.services.security.db.DBSecurityService.addGroup(DBSecurityService.java:744)
 at org.apache.turbine.services.security.TurbineSecurity.addGroup(TurbineSecurity.java:710)
 at com.nannet.jettiger.modules.actions.admin.group.GroupAction.doInsert(GroupAction.java:47)
 at java.lang.reflect.Method.invoke(Native Method)
 at org.apache.turbine.util.velocity.VelocityActionEvent.executeEvents(VelocityActionEvent.java:164)
 at org.apache.turbine.util.velocity.VelocityActionEvent.perform(VelocityActionEvent.java:111)
 at org.apache.turbine.modules.actions.VelocityAction.perform(VelocityAction.java:114)
 at org.apache.turbine.modules.actions.VelocitySecureAction.perform(VelocitySecureAction.java:100)
 at org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:122)
 at org.apache.turbine.modules.pages.DefaultPage.doBuild(DefaultPage.java:143)

----- Original Message ----- 
From: Jason van Zyl <jv...@apache.org>
To: <tu...@jakarta.apache.org>
Sent: Friday, April 20, 2001 12:20 AM
Subject: Re: Group/Permission/Role does not insert now !


> Youngho Cho wrote:
> > 
> > Hi,
> > 
> > I would like to insert Group/Permission/Role.
> > But I have following Error Message( I update the lastest cvs )
> > 
> > How can I add thease Secure Object again ?
> 
> 
> How are you doing this? I tested all the security changes with flux
> and all actions work correctly. Look at the code in flux as it
> tries as much as possible to use the interfaces of the security
> system.
> 
> Your security code operations shouldn't have anything to do with
> the specific backend implementation and if it does then the security
> service interfaces have some problems I would say.
> 
> In the flux actions that perform all the additions of
> users/roles/groups/perms
> there is no mention of backend specifics and everything works correctly.
> 
> What exactly are you trying to do?
> 
> > 
> > Thanks,
> > 
> > youngho
> > 
> > Horrible Exception: java.lang.reflect.InvocationTargetException: java.lang.NullPointerException
> >  at java.util.Hashtable.get(Hashtable.java(Compiled Code))
> >  at org.apache.turbine.util.db.IDBroker.getNextIds(IDBroker.java:353)
> >  at org.apache.turbine.util.db.IDBroker.getIdAsBigDecimal(IDBroker.java:280)
> > rethrown as org.apache.turbine.util.security.DataBackendException: addGroup(Group) failed
> >  at org.apache.turbine.util.TurbineException.<init>(TurbineException.java:173)
> >  at org.apache.turbine.util.security.TurbineSecurityException.<init>(TurbineSecurityException.java:88)
> >  at org.apache.turbine.util.security.DataBackendException.<init>(DataBackendException.java:89)
> >  at org.apache.turbine.services.security.db.DBSecurityService.addGroup(DBSecurityService.java:744)
> >  at org.apache.turbine.services.security.TurbineSecurity.addGroup(TurbineSecurity.java:710)
> >  at com.nannet.jettiger.modules.actions.admin.group.GroupAction.doInsert(GroupAction.java:46)
> >  at java.lang.reflect.Method.invoke(Native Method)
> >  at org.apache.turbine.util.velocity.VelocityActionEvent.executeEvents(VelocityActionEvent.java:164)
> >  at org.apache.turbine.util.velocity.VelocityActionEvent.perform(VelocityActionEvent.java:111)
> >  at org.apache.turbine.modules.actions.VelocityAction.perform(VelocityAction.java:114)
> > 
> 
> -- 
> jvz.
> 
> Jason van Zyl
> jvanzyl@apache.org
> 
> http://jakarta.apache.org/velocity
> http://jakarta.apache.org/turbine
> http://jakarta.apache.org/commons
> http://tambora.zenplex.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

Re: Group/Permission/Role does not insert now !

Posted by Jason van Zyl <jv...@apache.org>.
Youngho Cho wrote:
> 
> Hi,
> 
> I would like to insert Group/Permission/Role.
> But I have following Error Message( I update the lastest cvs )
> 
> How can I add thease Secure Object again ?


How are you doing this? I tested all the security changes with flux
and all actions work correctly. Look at the code in flux as it
tries as much as possible to use the interfaces of the security
system.

Your security code operations shouldn't have anything to do with
the specific backend implementation and if it does then the security
service interfaces have some problems I would say.

In the flux actions that perform all the additions of
users/roles/groups/perms
there is no mention of backend specifics and everything works correctly.

What exactly are you trying to do?

> 
> Thanks,
> 
> youngho
> 
> Horrible Exception: java.lang.reflect.InvocationTargetException: java.lang.NullPointerException
>  at java.util.Hashtable.get(Hashtable.java(Compiled Code))
>  at org.apache.turbine.util.db.IDBroker.getNextIds(IDBroker.java:353)
>  at org.apache.turbine.util.db.IDBroker.getIdAsBigDecimal(IDBroker.java:280)
> rethrown as org.apache.turbine.util.security.DataBackendException: addGroup(Group) failed
>  at org.apache.turbine.util.TurbineException.<init>(TurbineException.java:173)
>  at org.apache.turbine.util.security.TurbineSecurityException.<init>(TurbineSecurityException.java:88)
>  at org.apache.turbine.util.security.DataBackendException.<init>(DataBackendException.java:89)
>  at org.apache.turbine.services.security.db.DBSecurityService.addGroup(DBSecurityService.java:744)
>  at org.apache.turbine.services.security.TurbineSecurity.addGroup(TurbineSecurity.java:710)
>  at com.nannet.jettiger.modules.actions.admin.group.GroupAction.doInsert(GroupAction.java:46)
>  at java.lang.reflect.Method.invoke(Native Method)
>  at org.apache.turbine.util.velocity.VelocityActionEvent.executeEvents(VelocityActionEvent.java:164)
>  at org.apache.turbine.util.velocity.VelocityActionEvent.perform(VelocityActionEvent.java:111)
>  at org.apache.turbine.modules.actions.VelocityAction.perform(VelocityAction.java:114)
> 

-- 
jvz.

Jason van Zyl
jvanzyl@apache.org

http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine
http://jakarta.apache.org/commons
http://tambora.zenplex.org

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


RE: Group/Permission/Role does not insert now !

Posted by Pere Torrodellas <pt...@fihoca.com>.
I bet this is the error I reported last Tuesday (see the "RE: Security
exception with Oracle" thread):

>This time I got a new exception, caused ultimately by the fact that
>TableMap.getPrimaryKeyMethodInfo() returns null when invoked in
>BasePeer.doInsert() for Security tables. I looked into
>TurbineMapBuilder, and it seems that the Security TableMaps pkInfo
>attribute is not being set. Shouldn't it be initialized there?

Just now I was going to test a solution, although given my limited
knowledge of Security and Torque internals I'm unsure of what
unsuspected (for me) effect it may have in other parts of the system.

Pere Torrodellas

----- Mensaje original -----
De: Youngho Cho <yo...@nannet.co.kr>
Para: <tu...@jakarta.apache.org>
Enviado: jueves 19 de abril de 2001 10:42
Asunto: Group/Permission/Role does not insert now !


> Hi,
>
> I would like to insert Group/Permission/Role.
> But I have following Error Message( I update the lastest cvs )
>
> How can I add thease Secure Object again ?
>
> Thanks,
>
> youngho
>
> Horrible Exception: java.lang.reflect.InvocationTargetException:
java.lang.NullPointerException
>  at java.util.Hashtable.get(Hashtable.java(Compiled Code))
>  at org.apache.turbine.util.db.IDBroker.getNextIds(IDBroker.java:353)
>  at
org.apache.turbine.util.db.IDBroker.getIdAsBigDecimal(IDBroker.java:280)
> rethrown as org.apache.turbine.util.security.DataBackendException:
addGroup(Group) failed
>  at
org.apache.turbine.util.TurbineException.<init>(TurbineException.java:17
3)
>  at
org.apache.turbine.util.security.TurbineSecurityException.<init>(Turbine
SecurityException.java:88)
>  at
org.apache.turbine.util.security.DataBackendException.<init>(DataBackend
Exception.java:89)
>  at
org.apache.turbine.services.security.db.DBSecurityService.addGroup(DBSec
urityService.java:744)
>  at
org.apache.turbine.services.security.TurbineSecurity.addGroup(TurbineSec
urity.java:710)
>  at
com.nannet.jettiger.modules.actions.admin.group.GroupAction.doInsert(Gro
upAction.java:46)
>  at java.lang.reflect.Method.invoke(Native Method)
>  at
org.apache.turbine.util.velocity.VelocityActionEvent.executeEvents(Veloc
ityActionEvent.java:164)
>  at
org.apache.turbine.util.velocity.VelocityActionEvent.perform(VelocityAct
ionEvent.java:111)
>  at
org.apache.turbine.modules.actions.VelocityAction.perform(VelocityAction
.java:114)
>
>


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