Menu

#1 java.lang.SecurityException when running Transform XML

open
transclipse (1)
5
2003-03-11
2003-03-10
Tony Basile
No

I get error "java.lang.SecurityException: Prohibited
package name: java.lang" when trying to transform
anything.

source doc:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xml"
href="sample.xsl"?>
<sample>
<element1 attrib1="value1" attrib2 ="val2">
<nested-element>Some text</nested-
element>
<empty-element/>
</element1>
</sample>

stylesheet:
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL
/Transform"
version="1.0">
<xsl:output method="html" version="4.0"/>

<xsl:template match="/">
<HTML>
<BODY STYLE="font-family:Arial, helvetica,
sans-serif; font-size:12pt;
background-color:#EEEEEE">
<xsl:for-each select="sample">
<DIV STYLE="background-color:teal;
color:white; padding:4px">
<SPAN STYLE="font-weight:bold;
color:white"><xsl:value-of
select="element1/nested-element"/></SPAN>
</DIV>
<DIV STYLE="margin-left:20px; margin-
bottom:1em; font-size:10pt">
<xsl:value-of
select="element1/@attrib2"/>
<SPAN STYLE="font-style:italic">
(<xsl:value-of select="calories"/>
calories per serving)
</SPAN>
</DIV>
</xsl:for-each>
</BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>

Discussion

  • Gregor Heinze

    Gregor Heinze - 2003-03-10
    • status: open --> pending
     
  • Gregor Heinze

    Gregor Heinze - 2003-03-10

    Logged In: YES
    user_id=706355

    Please tell me the JRE (Help > About Eclipse Platform
    > Configuration Details) and the XSLT processor
    you're using.

     
  • Tony Basile

    Tony Basile - 2003-03-11

    Logged In: YES
    user_id=729591

    java.runtime.version=1.4.1_01-b01

    my xslt processor is "unknown Xalan"

     
  • Tony Basile

    Tony Basile - 2003-03-11
    • status: pending --> open
     
  • Gregor Heinze

    Gregor Heinze - 2003-03-11

    Logged In: YES
    user_id=706355

    Did you explicit select the Xalan or did you just use
    the one that comes with the JRE? It should be
    sufficient if you tell me the Xalan location from the
    Transclipse preferences.

    If you don't mind, I would also like to have a full
    stack trace. You can get that easily by double clicking
    on the exception in the Error Log and copying it from
    the Status Details.

    Thanks.

     
  • Tony Basile

    Tony Basile - 2003-03-11

    Logged In: YES
    user_id=729591

    justed used the default.

    java.lang.SecurityException: Prohibited package name:
    java.lang
    at java.lang.ClassLoader.defineClass
    (ClassLoader.java:488)
    at java.security.SecureClassLoader.defineClass
    (SecureClassLoader.java:123)
    at java.net.URLClassLoader.defineClass
    (URLClassLoader.java:250)
    at java.net.URLClassLoader.access$100
    (URLClassLoader.java:54)
    at java.net.URLClassLoader$1.run
    (URLClassLoader.java:193)
    at java.security.AccessController.doPrivileged(Native
    Method)
    at java.net.URLClassLoader.findClass
    (URLClassLoader.java:186)
    at
    de.eclipseproject.transclipse.EndorsingClassLoader.load
    Class(EndorsingClassLoader.java:93)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at java.lang.ClassLoader.loadClassInternal
    (ClassLoader.java:315)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass
    (ClassLoader.java:502)
    at java.security.SecureClassLoader.defineClass
    (SecureClassLoader.java:123)
    at java.net.URLClassLoader.defineClass
    (URLClassLoader.java:250)
    at java.net.URLClassLoader.access$100
    (URLClassLoader.java:54)
    at java.net.URLClassLoader$1.run
    (URLClassLoader.java:193)
    at java.security.AccessController.doPrivileged(Native
    Method)
    at java.net.URLClassLoader.findClass
    (URLClassLoader.java:186)
    at
    de.eclipseproject.transclipse.EndorsingClassLoader.load
    Class(EndorsingClassLoader.java:93)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
    at
    de.eclipseproject.transclipse.actions.TransformXmlActio
    n.initTransformer(TransformXmlAction.java:145)
    at
    de.eclipseproject.transclipse.actions.TransformXmlActio
    n.run(TransformXmlAction.java:80)
    at org.eclipse.ui.actions.ActionDelegate.runWithEvent
    (ActionDelegate.java:71)
    at org.eclipse.ui.internal.PluginAction.runWithEvent
    (PluginAction.java:241)
    at
    org.eclipse.jface.action.ActionContributionItem.handleWi
    dgetSelection(ActionContributionItem.java:456)
    at
    org.eclipse.jface.action.ActionContributionItem.handleWi
    dgetEvent(ActionContributionItem.java:403)
    at
    org.eclipse.jface.action.ActionContributionItem.access$
    0(ActionContributionItem.java:397)
    at
    org.eclipse.jface.action.ActionContributionItem$ActionLi
    stener.handleEvent(ActionContributionItem.java:72)
    at org.eclipse.swt.widgets.EventTable.sendEvent
    (EventTable.java:77)
    at org.eclipse.swt.widgets.Widget.sendEvent
    (Widget.java:836)
    at org.eclipse.swt.widgets.Display.runDeferredEvents
    (Display.java:1777)
    at org.eclipse.swt.widgets.Display.readAndDispatch
    (Display.java:1485)
    at org.eclipse.ui.internal.Workbench.runEventLoop
    (Workbench.java:1400)
    at org.eclipse.ui.internal.Workbench.run
    (Workbench.java:1383)
    at org.eclipse.core.internal.boot.InternalBootLoader.run
    (InternalBootLoader.java:845)
    at org.eclipse.core.boot.BootLoader.run
    (BootLoader.java:461)
    at sun.reflect.NativeMethodAccessorImpl.invoke0
    (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke
    (NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke
    (DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    at org.eclipse.core.launcher.Main.basicRun
    (Main.java:247)
    at org.eclipse.core.launcher.Main.run(Main.java:703)
    at org.eclipse.core.launcher.Main.main(Main.java:539)

     
  • Gregor Heinze

    Gregor Heinze - 2003-03-11

    Logged In: YES
    user_id=706355

    Ok, I think I know what the problem is. Please verify
    for me that the location of the Xalan (see Transclipse
    preferences) is part of the system property
    sun.boot.class.path.

    You aren't using Windows, right?

     
  • Tony Basile

    Tony Basile - 2003-03-12

    Logged In: YES
    user_id=729591

    actually I'm on Windows 2000 sp 3

     
  • Gregor Heinze

    Gregor Heinze - 2003-03-12

    Logged In: YES
    user_id=706355

    Please tell me the location of the Xalan and the system
    properties sun.boot.class.path and java.class.path.

     
  • Tony Basile

    Tony Basile - 2003-03-12

    Logged In: YES
    user_id=729591

    sun.boot.class.path=c:\j2sdk1.4.1
    \jre\lib\rt.jar;c:\j2sdk1.4.1
    \jre\lib\i18n.jar;c:\j2sdk1.4.1
    \jre\lib\sunrsasign.jar;c:\j2sdk1.4.1
    \jre\lib\jsse.jar;c:\j2sdk1.4.1
    \jre\lib\jce.jar;c:\j2sdk1.4.1
    \jre\lib\charsets.jar;c:\j2sdk1.4.1\jre\classes

    xalan:
    org.apache.xalan.processor.TransformerFactoryImpl

     
  • Gregor Heinze

    Gregor Heinze - 2003-03-12

    Logged In: YES
    user_id=706355

    With "location of the Xalan" I meant the URL in the Location
    column from the Transclipse preferences. It should start with
    file:/

     
  • Tony Basile

    Tony Basile - 2003-03-13

    Logged In: YES
    user_id=729591

    It's pointing to the jre,
    file:/c:/j2skdk1.4.1/jre/lib/rt.jar

     
  • Gregor Heinze

    Gregor Heinze - 2003-03-14

    Logged In: YES
    user_id=706355

    Well, I think I know what's going wrong but I have no idea why.
    Whatever I try I'm not able to reproduce this exception.

    I will not bother you any more, so a workaround should be if you
    download a separate Xalan (http://xml.apache.
    org/xalan-j/downloads.html) and select this as XSL processor
    instead of the "unknown Xalan".

     
  • Samuel Ĺslund

    Samuel Ĺslund - 2003-08-11

    Logged In: YES
    user_id=601646

    Hi

    I get a problem like this too.
    I am running Eclipse on Linux with the Blackdown JDK 1.4.1

    //Samuel

     

Log in to post a comment.

MongoDB Logo MongoDB