A page called java

66 views
Skip to first unread message

Cliff Mosdall

unread,
Jun 1, 2015, 8:46:18 PM6/1/15
to lu...@googlegroups.com
Hello Team,

I have a site I want to migrate from ACF to Lucee. The site has a page called /java, which is about the island (http://www.landenweb.net/java/). Running with Lucee it gives an error. Here's an example using Lucee express on Windows 7:

http://localhost:8888/java/

Lucee 4.5.1.000 Error (java.lang.SecurityException)
Message Prohibited package name: java
Cause java.lang.SecurityException
Java Stacktrace Prohibited package name: java

Does anyone have an idea how I can fix this?

Cheers

Igal @ Lucee.org

unread,
Jun 1, 2015, 9:02:05 PM6/1/15
to lu...@googlegroups.com
the package "java" is the most basic package for the JRE and is restricted so that malicious code will not be able to disguise itself as "trusted" code.

when Lucee compiles your code the directory structure is used for the package, so if you have for example a directory like:

    {site-root}/java/SomeCode.cfm

the class becomes something like

    java.SomeCode.class (over-simplification)

and then you get an error that the java package is prohibited.

you can either rename the folder, or put it in a subfolder, e.g.

    {site-root}/somefolder/java/SomeCode.cfm

Igal Sapir
Lucee Core Developer
Lucee.org

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/b1a4077c-428f-4c18-9e4f-42bb4a691170%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Blackwell

unread,
Jun 2, 2015, 4:36:00 AM6/2/15
to lu...@googlegroups.com
Whilst the explanation makes sense, its not really acceptable to impose directory naming limitations because of the underlying class structure, which a cfml dev may have no knowledge of.  
This is really a bug, Lucee should have a way of dealing with this.
Why can't lucee prefix every package name with something to prevent this.

Adam Cameron

unread,
Jun 2, 2015, 4:40:02 AM6/2/15
to lu...@googlegroups.com


On Tuesday, 2 June 2015 09:36:00 UTC+1, Chris Blackwell wrote:
Whilst the explanation makes sense, its not really acceptable to impose directory naming limitations because of the underlying class structure, which a cfml dev may have no knowledge of.  
This is really a bug, Lucee should have a way of dealing with this.
Why can't lucee prefix every package name with something to prevent this.


Agreed. This is a shortfall in the way Lucee names its compiled files, not something the CFML dev ought to have to worry about.

I'm not suggesting it should have been anticipated by the Lucee/Railo devs, nor that it's not an edge-case that ought to have been anticipated, but it's a design bug in the way the implementation has been done. IMO, natch.

It probably should be ticketed?

-- 
Adam

Adam Cameron

unread,
Jun 2, 2015, 4:40:46 AM6/2/15
to lu...@googlegroups.com
I'm not suggesting it should have been anticipated by the Lucee/Railo devs, nor that it's not an edge-case that ought to have been anticipated, but it's a design bug in the way the implementation has been done. IMO, natch.


Wow. That was a clumsy sentence :-/

-- 
Adam

Julian Halliwell

unread,
Jun 2, 2015, 4:54:54 AM6/2/15
to lu...@googlegroups.com
There's a similar, possibly related issue with context names:

https://luceeserver.atlassian.net/browse/LDEV-145
https://issues.jboss.org/browse/RAILO-3310

Desmond Miles

unread,
Jun 2, 2015, 5:26:33 AM6/2/15
to lu...@googlegroups.com
If you have name the directory "java" then the "/java" URI will work under ACF (I bet this is why the public link you gave works with /java/index.cfm).
In Lucee you'll have to rename your "java" directory to something else and define a "/java" mapping which points to it in your Lucee Web Admin (or Server Admin).
Then you will be able to access /java without that error. In addition you also will be able to instanciate your CFC using either new java.MyCFC() or with createObject("component","java.MyCFC").

Igal @ Lucee.org

unread,
Jun 2, 2015, 11:09:42 AM6/2/15
to lu...@googlegroups.com
I actually agree.

this old ticket would have resolved the issue, as well as have some other benefits.  perhaps it should be revisited:
https://issues.jboss.org/browse/RAILO-2868


Igal Sapir
Lucee Core Developer
Lucee.org

Andrew Dixon

unread,
Jun 2, 2015, 2:06:33 PM6/2/15
to lu...@googlegroups.com

Kind regards,

Andrew

Igal @ Lucee.org

unread,
Jun 2, 2015, 2:08:49 PM6/2/15
to lu...@googlegroups.com
thank you :)


Igal Sapir
Lucee Core Developer
Lucee.org

Michael Offner

unread,
Jun 3, 2015, 12:26:29 PM6/3/15
to lucee
agree, even it is not a major issue.

Micha

Reply all
Reply to author
Forward
0 new messages