cancel
Showing results for 
Search instead for 
Did you mean: 

static class could not use by SAP AS[JAVA]

Former Member
0 Kudos

hello everyone:

I migrate one J2ee application from a standard J2EE server ,deploy is OK,but it does not work.

I found that the static class will not be used in web tier,the detail is :

there is a static class to implement the MD5 encryption,it will encrypt the data and return encryptd data .

when I use this static class at my MainServlet ,which is a servlet,exception throw,and I copy the encrypt method as private method of the servlet ,it works!

now,I really puzzle with it,the web container of SAP AS will not support static class?or it's a BUG of it?or something else?

regards for any

steff

Message was edited by: steff yan

Accepted Solutions (0)

Answers (2)

Answers (2)

guru_subramanianb
Active Contributor
0 Kudos

Hi,

If ur problem is solved pls close the question thread & if you wish reward points suitably.

Regards,

Guru

Former Member
0 Kudos

I'm running into a similiar situation where I am porting over a J2EE application over and I am unable to access the static classes. Not sure what the previous poster meant by fixing the static class to be "thread safe"?

Is it a matter of thread safety? And if so, it would appear that the WAS is very specific in these requirements. Is there a way around it? Or at least a standard to follow?

-David

guru_subramanianb
Active Contributor
0 Kudos

Hi,

SAP WAS supprts JDK 1.3 specifications and has a J2EE engine.It shd definitely supprts static class.Try a seperate program on the static class with some methods.Try to call the methods w/o instantiating the class.It shd work definitely.Let me know if it is not working in SAP WAS.

Rdgs,

G

Former Member
0 Kudos

Hi,Guru

I try it with your idea,it works.

the problem is resolved,there are a static class which is not thread safe,it seemed that SAP WAS will check if static class is thread safe when compile,I correct it,it works.