Class parameter


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Class parameter

  1. #1
    sobul Guest

    Class parameter


    Hello,

    I have the following problem with j2sdkee1.3 app server.
    I have a session bean that provides an operation like this:

    public void test(Class cls1, Class cls2);

    when I call this operation from the client and one of the clsX references
    the class java.lang.String a nullPointerException is rised (operation on
    the bean is not called at all), but
    when classes are different from java.lang.String everything is OK. What can
    be the problem?

    Thanks for any answer in advice

    Sobul

    P.S.

    client code:

    c1=Class.forName("java.lang.String");
    c2=Class.forName("java.lang.Integer");
    c3=Class.forName("java.lang.Long");

    bean.test(c1,c2) --- Exception is rised
    bean.test(c2,c3) --- OK

  2. #2
    Paul Clapham Guest

    Re: Class parameter

    The problem must be in the bean somewhere, unless c1 is null; you could test
    to see if c1 is null.

    PC2

    "sobul" <quiq@quick.cz> wrote in message news:3be796b3@147.208.176.211...
    >
    > Hello,
    >
    > I have the following problem with j2sdkee1.3 app server.
    > I have a session bean that provides an operation like this:
    >
    > public void test(Class cls1, Class cls2);
    >
    > when I call this operation from the client and one of the clsX references
    > the class java.lang.String a nullPointerException is rised (operation on
    > the bean is not called at all), but
    > when classes are different from java.lang.String everything is OK. What

    can
    > be the problem?
    >
    > Thanks for any answer in advice
    >
    > Sobul
    >
    > P.S.
    >
    > client code:
    >
    > c1=Class.forName("java.lang.String");
    > c2=Class.forName("java.lang.Integer");
    > c3=Class.forName("java.lang.Long");
    >
    > bean.test(c1,c2) --- Exception is rised
    > bean.test(c2,c3) --- OK




  3. #3
    sobul Guest

    Re: Class parameter


    I have tested it on a different computer with the "same" configuration (Win2000,j2sdkee1.3)
    and everything is OK.
    But on the first computer the problem resists.
    I can concretize the problem as follows:

    client:

    c1=Class.forName("java.lang.String");
    c2=Class.forName("java.lang.Integer");
    c3=Class.forName("java.lang.Long");
    c1,c2,c3 is not null;
    bean.test(c1,c2) --- Exception is rised
    bean.test(c2,c3) --- OK


    Bean:

    public void test(Class cls1, Class cls2);
    {
    first_command_in_method; <- not called when c1 (or c2)
    should be java.lang.String class,
    so that exception is rised sooner
    ...
    }


    It seems that my configuration is broken in some way, but what can be wrong??

    Thanks for any answer in advice again

    Sobul

    "Paul Clapham" <pclapham@core-mark.com> wrote:
    >The problem must be in the bean somewhere, unless c1 is null; you could

    test
    >to see if c1 is null.
    >
    >PC2
    >
    >"sobul" <quiq@quick.cz> wrote in message news:3be796b3@147.208.176.211...
    >>
    >> Hello,
    >>
    >> I have the following problem with j2sdkee1.3 app server.
    >> I have a session bean that provides an operation like this:
    >>
    >> public void test(Class cls1, Class cls2);
    >>
    >> when I call this operation from the client and one of the clsX references
    >> the class java.lang.String a nullPointerException is rised (operation

    on
    >> the bean is not called at all), but
    >> when classes are different from java.lang.String everything is OK. What

    >can
    >> be the problem?
    >>
    >> Thanks for any answer in advice
    >>
    >> Sobul
    >>
    >> P.S.
    >>
    >> client code:
    >>
    >> c1=Class.forName("java.lang.String");
    >> c2=Class.forName("java.lang.Integer");
    >> c3=Class.forName("java.lang.Long");
    >>
    >> bean.test(c1,c2) --- Exception is rised
    >> bean.test(c2,c3) --- OK

    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center