-
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
-
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
-
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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks