You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by James Cook <ji...@iname.com> on 2000/08/28 20:11:00 UTC

Catalina: Adding a new realm

I have created my own Realm to do some custom authentication. It is based on
JDBCRealm and extends RealmBase.

For some reason, I can't seem to successfully add it to server.xml.

  <Realm className="us.oh.state.dot.servlet.security.BALSRealm" debug="99"
    vbrokerAddr="ITAOA125"
    vbrokerPort="49200" />

I have the appropriate methods defined in my class. I have even tried to deploy
it without any parameters, without success.

    public void setVbrokerAddr(String newVbrokerAddr)
    public void setVbrokerPort(String newVbrokerPort)

But I get the following exception when Catalina tries to start:

ERROR reading d:\projects\notes-servlet\servlet\server.xml
At Line 52 /Server/Engine/Realm/

Catalina.start: java.lang.IllegalArgumentException: argument type mismatch
java.lang.IllegalArgumentException: argument type mismatch
 at java.lang.reflect.Method.invoke(Native Method)
 at org.apache.tomcat.util.xml.AddChild.end(XmlMapper.java:781)
 at org.apache.tomcat.util.xml.XmlMapper.matchEnd(XmlMapper.java:391)
 at org.apache.tomcat.util.xml.XmlMapper.endElement(XmlMapper.java:109)
 at com.sun.xml.parser.Parser.maybeElement(Parser.java:1413)
 at com.sun.xml.parser.Parser.content(Parser.java:1499)
 <snip>

The JDBCRealm loads fine!? Did I forget to do something obvious? I have added my
Realm classes and supporting jar files into <catalina_home>/classes.

jim


Re: Catalina: Adding a new realm

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
The place you want to go for a nightly build is

    http://jakarta.apache.org/builds/jakarta-tomcat-4.0/nightly

and the corresponding sources are in

    http://jakarta.apache.org/builds/jakarta-tomcat-4.0/nightly/src

These are brand new, and I haven't announced them yet 'cause I'm still
downloading
the uploaded builds to make sure they unpack OK, and include everything
they are
supposed to.

Craig



James Cook wrote:

> Craig,
>
> I'm sending this directly to you because I believe the build I have may have
> other problems. I want to download a more recent build and post my results on
> the newsgroup. I noticed all of the nightly builds are "zero" length. If I user
> cvs to grab the source, what version tag should I use? I would like to make a
> build that has your recent RequestDispatcher.include fix. Would "head" do me?
>
> I think my build is bad because setting the debug="5" value in the server tag
> does not produce any debug output for me. Even when I comment out my realm.
>
> jim
>
> ----- Original Message -----
> From: "Craig R. McClanahan" <Cr...@eng.sun.com>
> To: <to...@jakarta.apache.org>
> Sent: Monday, August 28, 2000 2:19 PM
> Subject: Re: Catalina: Adding a new realm
>
> > James, could you try an experiment for me?
> >
> > Please temporarily rename your class so that the package name starts with
> > "org.apache.catalina." and see if it works?  There might be an issue with
> which
> > class loader is being consulted to load your class.  It would also be helpful
> to
> > turn debugging on so we can see the XmlMapper's output, by setting the "debug"
> > attribute on the <Server> element to a positive integer like 5.
> >
> > Then, if you're still having problems, the log output created by the XmlMapper
> > (which will be somewhat voluminous) will be helpful in tracking down what's
> going
> > on.
> >
> > Craig
> >
> >
> > James Cook wrote:
> >
> > > I have created my own Realm to do some custom authentication. It is based on
> > > JDBCRealm and extends RealmBase.
> > >
> > > For some reason, I can't seem to successfully add it to server.xml.
> > >
> > >   <Realm className="us.oh.state.dot.servlet.security.BALSRealm" debug="99"
> > >     vbrokerAddr="ITAOA125"
> > >     vbrokerPort="49200" />
> > >
> > > I have the appropriate methods defined in my class. I have even tried to
> deploy
> > > it without any parameters, without success.
> > >
> > >     public void setVbrokerAddr(String newVbrokerAddr)
> > >     public void setVbrokerPort(String newVbrokerPort)
> > >
> > > But I get the following exception when Catalina tries to start:
> > >
> > > ERROR reading d:\projects\notes-servlet\servlet\server.xml
> > > At Line 52 /Server/Engine/Realm/
> > >
> > > Catalina.start: java.lang.IllegalArgumentException: argument type mismatch
> > > java.lang.IllegalArgumentException: argument type mismatch
> > >  at java.lang.reflect.Method.invoke(Native Method)
> > >  at org.apache.tomcat.util.xml.AddChild.end(XmlMapper.java:781)
> > >  at org.apache.tomcat.util.xml.XmlMapper.matchEnd(XmlMapper.java:391)
> > >  at org.apache.tomcat.util.xml.XmlMapper.endElement(XmlMapper.java:109)
> > >  at com.sun.xml.parser.Parser.maybeElement(Parser.java:1413)
> > >  at com.sun.xml.parser.Parser.content(Parser.java:1499)
> > >  <snip>
> > >
> > > The JDBCRealm loads fine!? Did I forget to do something obvious? I have
> added my
> > > Realm classes and supporting jar files into <catalina_home>/classes.
> > >
> > > jim
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> >
> > --
> > ====================
> > See you at ApacheCon Europe <http://www.apachecon.com>!
> > Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
> > Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
> >                                     Applications to Tomcat
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

--
====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat

Re: Catalina: Adding a new realm

Posted by James Cook <ji...@iname.com>.
so much for the "private email"! :-)

jim

----- Original Message -----
From: "James Cook" <ji...@iname.com>
To: <to...@jakarta.apache.org>
Sent: Monday, August 28, 2000 2:45 PM
Subject: Re: Catalina: Adding a new realm


> Craig,
>
> I'm sending this directly to you because I believe the build I have may have
> other problems. I want to download a more recent build and post my results on
> the newsgroup. I noticed all of the nightly builds are "zero" length. If I
user
> cvs to grab the source, what version tag should I use? I would like to make a
> build that has your recent RequestDispatcher.include fix. Would "head" do me?
>
> I think my build is bad because setting the debug="5" value in the server tag
> does not produce any debug output for me. Even when I comment out my realm.
>
> jim
>
>
> ----- Original Message -----
> From: "Craig R. McClanahan" <Cr...@eng.sun.com>
> To: <to...@jakarta.apache.org>
> Sent: Monday, August 28, 2000 2:19 PM
> Subject: Re: Catalina: Adding a new realm
>
>
> > James, could you try an experiment for me?
> >
> > Please temporarily rename your class so that the package name starts with
> > "org.apache.catalina." and see if it works?  There might be an issue with
> which
> > class loader is being consulted to load your class.  It would also be
helpful
> to
> > turn debugging on so we can see the XmlMapper's output, by setting the
"debug"
> > attribute on the <Server> element to a positive integer like 5.
> >
> > Then, if you're still having problems, the log output created by the
XmlMapper
> > (which will be somewhat voluminous) will be helpful in tracking down what's
> going
> > on.
> >
> > Craig
> >
> >
> > James Cook wrote:
> >
> > > I have created my own Realm to do some custom authentication. It is based
on
> > > JDBCRealm and extends RealmBase.
> > >
> > > For some reason, I can't seem to successfully add it to server.xml.
> > >
> > >   <Realm className="us.oh.state.dot.servlet.security.BALSRealm" debug="99"
> > >     vbrokerAddr="ITAOA125"
> > >     vbrokerPort="49200" />
> > >
> > > I have the appropriate methods defined in my class. I have even tried to
> deploy
> > > it without any parameters, without success.
> > >
> > >     public void setVbrokerAddr(String newVbrokerAddr)
> > >     public void setVbrokerPort(String newVbrokerPort)
> > >
> > > But I get the following exception when Catalina tries to start:
> > >
> > > ERROR reading d:\projects\notes-servlet\servlet\server.xml
> > > At Line 52 /Server/Engine/Realm/
> > >
> > > Catalina.start: java.lang.IllegalArgumentException: argument type mismatch
> > > java.lang.IllegalArgumentException: argument type mismatch
> > >  at java.lang.reflect.Method.invoke(Native Method)
> > >  at org.apache.tomcat.util.xml.AddChild.end(XmlMapper.java:781)
> > >  at org.apache.tomcat.util.xml.XmlMapper.matchEnd(XmlMapper.java:391)
> > >  at org.apache.tomcat.util.xml.XmlMapper.endElement(XmlMapper.java:109)
> > >  at com.sun.xml.parser.Parser.maybeElement(Parser.java:1413)
> > >  at com.sun.xml.parser.Parser.content(Parser.java:1499)
> > >  <snip>
> > >
> > > The JDBCRealm loads fine!? Did I forget to do something obvious? I have
> added my
> > > Realm classes and supporting jar files into <catalina_home>/classes.
> > >
> > > jim
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> >
> > --
> > ====================
> > See you at ApacheCon Europe <http://www.apachecon.com>!
> > Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
> > Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
> >                                     Applications to Tomcat
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>


Re: Catalina: Adding a new realm

Posted by James Cook <ji...@iname.com>.
Craig,

I'm sending this directly to you because I believe the build I have may have
other problems. I want to download a more recent build and post my results on
the newsgroup. I noticed all of the nightly builds are "zero" length. If I user
cvs to grab the source, what version tag should I use? I would like to make a
build that has your recent RequestDispatcher.include fix. Would "head" do me?

I think my build is bad because setting the debug="5" value in the server tag
does not produce any debug output for me. Even when I comment out my realm.

jim


----- Original Message -----
From: "Craig R. McClanahan" <Cr...@eng.sun.com>
To: <to...@jakarta.apache.org>
Sent: Monday, August 28, 2000 2:19 PM
Subject: Re: Catalina: Adding a new realm


> James, could you try an experiment for me?
>
> Please temporarily rename your class so that the package name starts with
> "org.apache.catalina." and see if it works?  There might be an issue with
which
> class loader is being consulted to load your class.  It would also be helpful
to
> turn debugging on so we can see the XmlMapper's output, by setting the "debug"
> attribute on the <Server> element to a positive integer like 5.
>
> Then, if you're still having problems, the log output created by the XmlMapper
> (which will be somewhat voluminous) will be helpful in tracking down what's
going
> on.
>
> Craig
>
>
> James Cook wrote:
>
> > I have created my own Realm to do some custom authentication. It is based on
> > JDBCRealm and extends RealmBase.
> >
> > For some reason, I can't seem to successfully add it to server.xml.
> >
> >   <Realm className="us.oh.state.dot.servlet.security.BALSRealm" debug="99"
> >     vbrokerAddr="ITAOA125"
> >     vbrokerPort="49200" />
> >
> > I have the appropriate methods defined in my class. I have even tried to
deploy
> > it without any parameters, without success.
> >
> >     public void setVbrokerAddr(String newVbrokerAddr)
> >     public void setVbrokerPort(String newVbrokerPort)
> >
> > But I get the following exception when Catalina tries to start:
> >
> > ERROR reading d:\projects\notes-servlet\servlet\server.xml
> > At Line 52 /Server/Engine/Realm/
> >
> > Catalina.start: java.lang.IllegalArgumentException: argument type mismatch
> > java.lang.IllegalArgumentException: argument type mismatch
> >  at java.lang.reflect.Method.invoke(Native Method)
> >  at org.apache.tomcat.util.xml.AddChild.end(XmlMapper.java:781)
> >  at org.apache.tomcat.util.xml.XmlMapper.matchEnd(XmlMapper.java:391)
> >  at org.apache.tomcat.util.xml.XmlMapper.endElement(XmlMapper.java:109)
> >  at com.sun.xml.parser.Parser.maybeElement(Parser.java:1413)
> >  at com.sun.xml.parser.Parser.content(Parser.java:1499)
> >  <snip>
> >
> > The JDBCRealm loads fine!? Did I forget to do something obvious? I have
added my
> > Realm classes and supporting jar files into <catalina_home>/classes.
> >
> > jim
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
> --
> ====================
> See you at ApacheCon Europe <http://www.apachecon.com>!
> Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
> Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
>                                     Applications to Tomcat
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>


Re: Catalina: Adding a new realm

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
James, could you try an experiment for me?

Please temporarily rename your class so that the package name starts with
"org.apache.catalina." and see if it works?  There might be an issue with which
class loader is being consulted to load your class.  It would also be helpful to
turn debugging on so we can see the XmlMapper's output, by setting the "debug"
attribute on the <Server> element to a positive integer like 5.

Then, if you're still having problems, the log output created by the XmlMapper
(which will be somewhat voluminous) will be helpful in tracking down what's going
on.

Craig


James Cook wrote:

> I have created my own Realm to do some custom authentication. It is based on
> JDBCRealm and extends RealmBase.
>
> For some reason, I can't seem to successfully add it to server.xml.
>
>   <Realm className="us.oh.state.dot.servlet.security.BALSRealm" debug="99"
>     vbrokerAddr="ITAOA125"
>     vbrokerPort="49200" />
>
> I have the appropriate methods defined in my class. I have even tried to deploy
> it without any parameters, without success.
>
>     public void setVbrokerAddr(String newVbrokerAddr)
>     public void setVbrokerPort(String newVbrokerPort)
>
> But I get the following exception when Catalina tries to start:
>
> ERROR reading d:\projects\notes-servlet\servlet\server.xml
> At Line 52 /Server/Engine/Realm/
>
> Catalina.start: java.lang.IllegalArgumentException: argument type mismatch
> java.lang.IllegalArgumentException: argument type mismatch
>  at java.lang.reflect.Method.invoke(Native Method)
>  at org.apache.tomcat.util.xml.AddChild.end(XmlMapper.java:781)
>  at org.apache.tomcat.util.xml.XmlMapper.matchEnd(XmlMapper.java:391)
>  at org.apache.tomcat.util.xml.XmlMapper.endElement(XmlMapper.java:109)
>  at com.sun.xml.parser.Parser.maybeElement(Parser.java:1413)
>  at com.sun.xml.parser.Parser.content(Parser.java:1499)
>  <snip>
>
> The JDBCRealm loads fine!? Did I forget to do something obvious? I have added my
> Realm classes and supporting jar files into <catalina_home>/classes.
>
> jim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org

--
====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat