atuttle / Taffy

:candy: The REST Web Service framework for ColdFusion and Lucee
http://taffy.io
Other
226 stars 118 forks source link

Issues with Java objects #401

Open jlmills opened 3 years ago

jlmills commented 3 years ago

On a shared CF hosting plan access to Java objects was not on by default. I got the error:

Element _TAFFY.SETTINGS.EXCEPTIONLOGADAPTER is undefined in APPLICATION.

In the ORIGINAL EXCEPTION part of the error dump:

access denied ("java.lang.RuntimePermission" "createClassLoader" ...

Taffy was trying to use a few Java objects, java.lang.String and java.lang.StringBuffer, and java.net.InetAddress. Once the hosting company granted the permissions everything worked fine.

The question is why was Java being used and therefore making installation more difficult in some environments.

cfreturn createObject( "java", "java.net.InetAddress" ).getLocalHost().getHostName() /> seems completely unnecessary. You can get anything you need from CGI.LOCAL_ADDR and such.

<cfset var s = createObject("java", "java.lang.StringBuffer").init("") /> is doing some string processing that CF can probably do just fine.