cancel
Showing results for 
Search instead for 
Did you mean: 

java.lang.IllegalAccessError

Former Member
0 Kudos

Hi,

I am using NWDS04S Version 7.01.04. I have developed an application that generates an excel file from the table contents. For this, I use the POI librairy.

My code used to work and suddendy the code does not work anymore and an IllegagAccessError exception occurs everytime I try to generate an excel file:

java.lang.IllegalAccessError: org.apache.poi.hssf.usermodel.HSSFWorkbook tried to access method org/apache/poi/hssf/usermodel/HSSFSheet.(Lorg/apache/poi/hssf/model/Workbook;)V

at org.apache.poi.hssf.usermodel.HSSFWorkbook.createSheet(HSSFWorkbook.java:366)

I have not changed the code.

I would really appreciate any help on this.

Thanks in advance for your help.

Warm regards,

Rashmi

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Can you try setting the browser security level to low, and enable all activex etc from security settings and try?

Best regards,

Chinnu

Former Member
0 Kudos

Hi IIan and Chinnu,

Thank you for your reply. I made sure that the required DC is deployed on the test server and also checked the browser settings with no luck.

I then tried to undeploy the DC on the test server, to make sure that my application is using the same jar files, but I saw some strange behavior here.

When I undeploy the J2EE DC, I still get the Iillegal access error instead of the class not found error, and also the download to excel functionality seems to work fine in another application on the same test server using the same external jar DC.

All the applications on the dev server are still working fine.

So I suspect that my application is not using the external jars DC that it is supposed to use.

Is there any way in which I can find out the location of the jar files that my DC is using at runtime ? Can I print it out somewhere ?

Any help is appreciated.

Thank you

Warm regards,

Rashmi

Former Member
0 Kudos

Hi,

I figured out what the problem is. I think it is the way in which the dependencies are defined.

This is the scenario we have.

1) Lets call the external jars DC as DC A.

2) DC B uses DC A.

3) DC C uses DC B and DC A.

4) DC D uses all three DC A, DC B and DC C.

In the second case, the external jars for the excel download functionality are accessed from the local public library folder of DC B on the J2EE server.

In the third case the external jars are accessed from the public library folder of DC B.

In the fourth case the external jars are accessed from the public library folder of DC B again, even though DC C also has the same depencies as B.

The problem seems to occur intermittently in the second and third cases. I suspect that the path is loaded alphabetically by the JVM, but I am not too sure.

Can anyone please shed some light on why there is an exception sometimes in the third and fourth case and also how it can be avoided ?

Thanks in advance for your help.

Warm regards,

Rashmi

Former Member
0 Kudos

Dear

It seems to be an old version of the POI jar file.So pls downloaded the latest version of Apache POI and try again...

I think It will solve ur issue

Thanks

Keshari

Former Member
0 Kudos

Hi Keshari,

Thank you for replying.

I have the latest version dated 20070705. The download to excel functionality works in all the others views except for one and there is no difference in the code, or the configuration between the them.

Is there anything else that I need to check ? Please let me know if you have any other ideas.

Thanks in advance for your help.

Warm regards,

Rashmi

former_member214651
Active Contributor
0 Kudos

Hi,

Please refer to the SAP tutorial, which describes the steps to export a table contents to Excel:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/edc2f3c2-0401-0010-8898-acd5b6a94...

Regards,

Poojith MV

Former Member
0 Kudos

Hi Poojith,

Thank you for the reply. The tutorial is indeed a good alternative, will make it more stable, than the current external jar files.

However we are not just exporting the table, we have made a few custom changes to the table data.

Do you have any ideas as to how we can resolve this problem ? The problem does not occur in the development environment, it occurs only in the test environment.

Any help will be appreciated.

Thank you.

Warm regards,

Rashmi

Former Member
0 Kudos

If you have not changed the code, perhaps you accidently undeployed the external library?

Or you are running this code on a server in which this external library has not been deployed?

Try and redeploy the external library to the server in question.