does it ring a bell: java.lang.SecurityException: Prohibited package name: java.lang


Starting with 1131, or 1136, I can't run tests that use the openapi, and the testFramework anymore.
I now get dozens of failing tests with the stacktrace below. Does it ring a bell to you?
AFAIK, nothing has changed, except that I now use the newest jars.






12 comments


Note: another problem started appearing at the same time :
see:
java.lang.RuntimeException: log.xml file is not exists! Path:
http://www.intellij.net/tracker/idea/viewSCR?publicId=28748#797970

0

Alain Ravet wrote:

Note: another problem started appearing at the same time :
see:
java.lang.RuntimeException: log.xml file is not exists! Path:
http://www.intellij.net/tracker/idea/viewSCR?publicId=28748#797970


Yup. Noticed ame problem here - note that I'm not even using the
testFramework. Mainly because I don't know how - the Wiki seems outdated?

CU,
Edwin

0


Any idea about this problem? (still happens with 1141.)

I'm now desperately stuck in my plugin project, with 45 failing tests ,
and Google doesn't have much to say about this one.

Alain

0

What class is failing to load?

--

Dmitry Peshehonov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Dmitry,

> What class is failing to load?

It happens when calling a class of mines' method. Always the same method.

All the failing tests fail on a call like this :
(this is the deepest line of mines, found in the stacktrace.)


, and the troublesome called method lives in this class :



0

Dmitry,

> What class is failing to load?

OK. I've finally tracked the problem. It's linked to the use of the generic compiler, but I still don't know if its a bug, or if I'm wrong?

Here is a very simple way to reproduce it:


1/ create the class 'Fail' as below


2/ use the generic enabled compiler
3/ add the 'collect.jar' library, and move it to the 1st position.
4/ set project jdk to 1.4.2
5/ compile and run

This configuration doesn't run (see stacktrace below)

If I remove generics (collect jar, and compiler), it runs fine.


0

Alain,

I still can't reproduce the problem. I've tried your code with jdk1.4.2
(but probably I use a bit different collect.jar). But I've got an idea how
to find bad class name:
Attach junit sources to your project (to junit jar).
Create Application configuration to run swing test runner (set Class
name to junit.swingui.TestRunner, set Module as you run your tests, specify
VM parameters if you'd like to).
Debug this new configuration and set breakpoint to first line of
junit.runner.TestCaseClassLoader.loadClass(String, boolean). In breakpoint
properties dialog uncheck Suspend VM execution, check Log evaluated
expression and type smth like "loading: " + name.
Start your tests with Swing runner and get the name of bad class.

--

Dmitry Peshehonov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


"Alain Ravet" < alainravet-jetbrains@yahoo.com> wrote in message
news:4646683.1076113518682.JavaMail.itn@is.intellij.net...

Dmitry,

>

> What class is failing to load?

>

OK. I've finally tracked the problem. It's linked to the use of the

generic compiler, but I still don't know if its a bug, or if I'm wrong?
>

Here is a very simple way to reproduce it:

>
>

1/ create the class 'Fail' as below

    package one;
>
>    public class Fail extends java.util.ArrayList
>    {
>        public static void main ( String[] args )
>        {
>
>        }
>    }
>    ]]>

>

2/ use the generic enabled compiler
3/ add the 'collect.jar' library, and move it to the 1st position.
4/ set project jdk to 1.4.2
5/ compile and run

>

This configuration doesn't run (see stacktrace below)

>

If I remove generics (collect jar, and compiler), it runs fine.

>

C:/dev/sys/j2sdk1.4.2\bin\java -Dfile.encoding=windows-1252 -classpath "C:\IntelliJ-IDEA-1148\lib\generics\collect.jar;C:\dev\sys\j2sdk1.4.2\jre\li b\charsets.jar;C:\dev\sys\j2sdk1.4.2\jre\lib\jce.jar;C:\dev\sys\j2sdk1.4.2\j re\lib\jsse.jar;C:\dev\sys\j2sdk1.4.2\jre\lib\plugin.jar;C:\dev\sys\j2sdk1.4 .2\jre\lib\rt.jar;C:\dev\sys\j2sdk1.4.2\jre\lib\sunrsasign.jar;C:\dev\sys\j2 sdk1.4.2\jre\lib\ext\dnsns.jar;C:\dev\sys\j2sdk1.4.2\jre\lib\ext\ldapsec.jar ;C:\dev\sys\j2sdk1.4.2\jre\lib\ext\localedata.jar;C:\dev\sys\j2sdk1.4.2\jre\ lib\ext\sunjce_provider.jar;C:\Documents and Settings\aravet\IdeaProjects\untitled\classes;C:\IntelliJ-IDEA-1148\lib\idea _rt.jar" -Didea.launcher.port=7552 -Didea.launcher.library=C:\IntelliJ-IDEA- 1148\bin\breakgen.dll com.intellij.rt.execution.application.AppMain one.Fail > java.lang.SecurityException: Prohibited package name: java.lang > at java.lang.ClassLoader.defineClass(ClassLoader.java:524) > at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) > at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) > at java.net.URLClassLoader.access$100(URLClassLoader.java:55) > at java.net.URLClassLoader$1.run(URLClassLoader.java:194) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:187) > at java.lang.ClassLoader.loadClass(ClassLoader.java:289) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) > at java.lang.ClassLoader.loadClass(ClassLoader.java:235) > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) > at java.lang.Class.forName0(Native Method) > at java.lang.Class.forName(Class.java:141) > at com.intellij.rt.execution.application.AppMain.main(Unknown Source) > Exception in thread "main" Process terminated with exit code 1 > ]]>

>



0

Dmitry,

> I've got an idea how to find bad class name:
>..


I tried, but it didn't help. All I saw is 'null'. At some point, I also saw a mention, somewhere, of 'java.lang.SimpleIterator', but couldn't reproduce it.

I've attached a minimal self-contained - with my collect.jar - failing project.
The code doesn't use generics at all, and works fine, as long as I don't use the 'generic-enabled compiler'.

I'm lost:
- I reinstalled a fresh copy of the jdk 1.4.2_03
- I tried multiple versions of collect jar
, to no avail.

In the end, it boils down to the compilation of a class that extends ArrayList:
- the code produced by the standard compiler works fine.
- the code produced by the generic-enabled compiler fails.



Alain



Attachment(s):
SecurityExceptionBug.zip
0

Alain,

I've tried to reproduce the problem with your project (I had to configure it
a bit), but failed again. So I think the problem is in the only generics
related thing which wasn't tried - your gjc-rt.jar. To solve the problem (if
my suggestion it right) you need to downgrade to previous version (build
1147 has problem with latest generics compiler).

--

Dmitry Peshehonov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


"Alain Ravet" < alainravet-jetbrains@yahoo.com> wrote in message
news:22670579.1076174147885.JavaMail.itn@is.intellij.net...

Dmitry,

>

> I've got an idea how to find bad class name:
>..

>
>

I tried, but it didn't help. All I saw is 'null'. At some point, I also

saw a mention, somewhere, of 'java.lang.SimpleIterator', but couldn't
reproduce it.
>

I've attached a minimal self-contained - with my collect.jar - failing

project.

The code doesn't use generics at all, and works fine, as long as I don't

use the 'generic-enabled compiler'.
>

I'm lost:
- I reinstalled a fresh copy of the jdk 1.4.2_03
- I tried multiple versions of collect jar
, to no avail.

>

In the end, it boils down to the compilation of a class that extends

ArrayList:

- the code produced by the standard compiler works fine.
- the code produced by the generic-enabled compiler fails.

>
>
>

Alain

>


0

Dmitry,


> So I think the problem is in the only generics
> related thing which wasn't tried - your gjc-rt.jar.

Alleluia..You were right.
Somehow, my copy of gjc-rt.jar got corrupted - ? cosmic ray ?-. I overwrote it with a backup copy, and it works fine now.

Note: how strange, and frightening, that java couldn't detect a jar corruption !!

0

"Alain Ravet" < alainravet-jetbrains@yahoo.com> wrote in message
news:7897263.1076268467363.JavaMail.itn@is.intellij.net...

Dmitry,

>
>

> So I think the problem is in the only generics
> related thing which wasn't tried - your gjc-rt.jar.

>

Alleluia..You were right.
Somehow, my copy of gjc-rt.jar got corrupted - ? cosmic ray ?-. I

overwrote it with a backup copy, and it works fine now.
>

Note: how strange, and frightening, that java couldn't detect a jar

corruption !!

Alain,

It hardly was cosmic ray - good jar structure and wrong byte code was good
enough to be executed by VM, I think you've faced with alien incursion.

However, have you used Tools | Setup Generics action? May be jar was
corrupted when overwriten by newer version?

--

Dmitry Peshehonov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"



0

Dmitry,
> .. have you used Tools | Setup Generics action?
> May be jar was corrupted when overwriten by newer version?

I never used "Tools | Setup Generics": with each new build, I would copy and paste /lib/generics to ]]>/lib/. It worked fine till a few builds ago.

After your suggestion, I retrieved an old build - 977 - , and copied the lilb/generics/gjc-rt.jar over the new and corrupted one. (I checked that they were the same size, and same date).



0

Please sign in to leave a comment.