• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

remoteClasspath_geoLocator CFC issue

LEGEND ,
Apr 14, 2007 Apr 14, 2007

Copy link to clipboard

Copied

On shared server with a less than helpful host...but that's a different grip
entirely...;)

Have been to source forge and have the latest remoteClasspath_geoLocator CFC
with the latest InetAddressLocator.jar which includes some amendment for
CFMX.
Frankly, I know SFA about this stuff, except that I can't get it to work :(

I have the jar file in the same directory as the cfc and it seems to point
to it fine, but it throws the following error:

java init failed: net.sf.javainetlocator.CFMXwrapper

from the following try block:

<cftry>
<cfset jarFile=replace(jarFile,'\','/','all')> <!--- just in case --->
<cfset URLObject.init("file:" & jarFile)>
<cfset URLArray =
createObject("java","java.lang.reflect.Array").newInstance(URLObject.getClass(),1)>
<cfset arrayClass.set(URLArray,0,URLObject)>
<cfset loader =
createObject("java","java.net.URLClassLoader").init(URLArray)>
<cfset variables.geoLocator =
loader.loadClass("net.sf.javainetlocator.CFMXwrapper").newInstance()>
<cfobject type="Java" action="Create" class="java.util.Locale"
name="variables.javaLocale">
<cfcatch type="Any">
<cfthrow message="java init failed: net.sf.javainetlocator.CFMXwrapper"
detail="#cfcatch.detail#" errorcode="1001">
</cfcatch>
</cftry>

Can anyone please help this idiot figure out what he's doing wrong?

--
Cheers,
Lossed
__when the only tool you have is a hammer, everything looks like a nail __


TOPICS
Advanced techniques

Views

633

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 14, 2007 Apr 14, 2007

Copy link to clipboard

Copied

Lossed wrote:
> On shared server with a less than helpful host...but that's a different grip
> entirely...;)

these days i'm recommending that folks use mark mandel's javaLoader instead.
i'll be putting up a new version (on sustainableGIS.com) sometime today.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 14, 2007 Apr 14, 2007

Copy link to clipboard

Copied

get javaLoader from: http://javaloader.riaforge.org/

get the new geoLocator CFC from:
www.sustainableGIS.com/projects/geoLocator/geoLocator.zip

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 15, 2007 Apr 15, 2007

Copy link to clipboard

Copied

Tks Paul.
Latest error now stems from the javaLoader CFC:

com.compoundtheory.classloader.NetworkClassLoader

at line 53.

Is it meant to be loading that class from his site?

Excuse the dim questions but I haven't got a clue :(


"PaulH **AdobeCommunityExpert**" <paul@sustainableGIS.com> wrote in message
news:evsfva$m22$1@forums.macromedia.com...
> get javaLoader from: http://javaloader.riaforge.org/
>
> get the new geoLocator CFC from:
> www.sustainableGIS.com/projects/geoLocator/geoLocator.zip


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 15, 2007 Apr 15, 2007

Copy link to clipboard

Copied

And in case it was ever in any doubt, to cement my dim-ness, there was
mention in the read-me file of a possible memory leak using CF unless the
javaLoader instances are stored in the server scope. Should I be worried
about that?

Thanks,
Lossed


"Lossed" <blankemail@hotmail.com> wrote in message
news:evsm35$bn$1@forums.macromedia.com...
> Tks Paul.
> Latest error now stems from the javaLoader CFC:
>
> com.compoundtheory.classloader.NetworkClassLoader
>
> at line 53.
>
> Is it meant to be loading that class from his site?
>
> Excuse the dim questions but I haven't got a clue :(
>
>
> "PaulH **AdobeCommunityExpert**" <paul@sustainableGIS.com> wrote in
> message news:evsfva$m22$1@forums.macromedia.com...
>> get javaLoader from: http://javaloader.riaforge.org/
>>
>> get the new geoLocator CFC from:
>> www.sustainableGIS.com/projects/geoLocator/geoLocator.zip
>
>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 15, 2007 Apr 15, 2007

Copy link to clipboard

Copied

Lossed wrote:
> Is it meant to be loading that class from his site?

no. did you d/l & "install" his CFC? there's a lib dir that needs to be under
the location of the javaloader CFC.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 15, 2007 Apr 15, 2007

Copy link to clipboard

Copied

Lossed wrote:
> And in case it was ever in any doubt, to cement my dim-ness, there was
> mention in the read-me file of a possible memory leak using CF unless the
> javaLoader instances are stored in the server scope. Should I be worried
> about that?

i would have put that into server scope except that you mentioned you were on a
shared host. whether that leaks affects your server depends on how you use
geoLocator but i'd suggest following mark's suggestion.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 15, 2007 Apr 15, 2007

Copy link to clipboard

Copied

OK, so, in addition to getting the javaLoader CFC, one also needs to place
the lib folder and it's class in the same directory as the CFC.

;)

"Lossed" <blankemail@hotmail.com> wrote in message
news:evsm35$bn$1@forums.macromedia.com...
> Tks Paul.
> Latest error now stems from the javaLoader CFC:
>
> com.compoundtheory.classloader.NetworkClassLoader
>
> at line 53.
>
> Is it meant to be loading that class from his site?
>
> Excuse the dim questions but I haven't got a clue :(
>
>
> "PaulH **AdobeCommunityExpert**" <paul@sustainableGIS.com> wrote in
> message news:evsfva$m22$1@forums.macromedia.com...
>> get javaLoader from: http://javaloader.riaforge.org/
>>
>> get the new geoLocator CFC from:
>> www.sustainableGIS.com/projects/geoLocator/geoLocator.zip
>
>


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 15, 2007 Apr 15, 2007

Copy link to clipboard

Copied

SNAP:
was just advising that, after reading through the read-me file ;)

"PaulH **AdobeCommunityExpert**" <paul@sustainableGIS.com> wrote in message
news:evsrcl$5e7$1@forums.macromedia.com...
> Lossed wrote:
>> Is it meant to be loading that class from his site?
>
> no. did you d/l & "install" his CFC? there's a lib dir that needs to be
> under the location of the javaloader CFC.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 15, 2007 Apr 15, 2007

Copy link to clipboard

Copied

cheers for putting up with the dimwit here :)
Not to mention the great CFC's

Very much appreciated.
We are all go now.


"PaulH **AdobeCommunityExpert**" <paul@sustainableGIS.com> wrote in message
news:evsrgu$5e7$2@forums.macromedia.com...
> Lossed wrote:
>> And in case it was ever in any doubt, to cement my dim-ness, there was
>> mention in the read-me file of a possible memory leak using CF unless the
>> javaLoader instances are stored in the server scope. Should I be worried
>> about that?
>
> i would have put that into server scope except that you mentioned you were
> on a shared host. whether that leaks affects your server depends on how
> you use geoLocator but i'd suggest following mark's suggestion.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 15, 2007 Apr 15, 2007

Copy link to clipboard

Copied

LATEST
Lossed wrote:
> OK, so, in addition to getting the javaLoader CFC, one also needs to place
> the lib folder and it's class in the same directory as the CFC.

you can put either of them anywhere you want as long as the javaLoader's lib is
under the javaLoader location and you amend the javaloader location in the
geoLocator CFC (and of course how you call the geoLocator CFC).

if you want to play it safe (and your host doesn't mind) in geoLocator's init()
method change:

<cfset var javaLoader=createObject("component","javaLoader").init(paths)>
<cftry>
<cfset variables.geoLocator =
javaLoader.create("net.sf.javainetlocator.InetAddressLocator")>

to (move the javaLoader createObject call inside the try block) :

<cftry>
<cfif NOT structKeyExists(server,"javaLoader")>
<cflock name="loadItext" timeout="60">
<cfif NOT structKeyExists(server,"javaLoader")>
<cfset server.javaLoader=createObject("component","javaLoader").init(iTextPath)>
</cfif>
</cflock>
</cfif>
<cfset variables.geoLocator =
server.javaLoader.create("net.sf.javainetlocator.InetAddressLocator")>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation