Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
JavaLoader and classpath behavior different on Adobe CF 8/9 and Railo 3 with interface classes
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
TomdeMan  
View profile  
 More options Mar 4 2010, 5:57 pm
From: TomdeMan <tom.demanin...@gmail.com>
Date: Thu, 4 Mar 2010 14:57:26 -0800 (PST)
Local: Thurs, Mar 4 2010 5:57 pm
Subject: JavaLoader and classpath behavior different on Adobe CF 8/9 and Railo 3 with interface classes
I am working with the YUICompressor Java library, and noticed some odd
behavior. Placing the yuicompressor-2.4.2.jar into the CF classpath
and using createObject() throws the following error:

An exception occurred when instantiating a Java object. The class must
not be an interface or an abstract class. Error: ''.

The same code, using javaloader to create() an object of the same
class runs successfully on CF 8 and CF 9.
Running it on Railo 3 produces the same error as the CF classpath.

The class in question is the ErrorReporter. The error is thrown on the
init of the JavaScriptCompressor, the reporter is created successfully
prior to that. (Even though it is just an interface, and no init
method is specified)

inputStream =
createObject('java','java.io.StringReader').init(inputString);
reporter = create('org.mozilla.javascript.ErrorReporter');
JavaScriptCompressor =
create('com.yahoo.platform.yui.compressor.JavaScriptCompressor').init(input Stream,reporter);

org.mozilla.javascript.ErrorReporter' is an interface.

The fact that it works at all was surprising too me.

I would really like to get to the bottom of this and be able to offer
a solution that runs on all platforms.

I am no expert with Java or the underlying CF class loader system and
would appreciate any feedback.

The YUICompressor jar and java src can be found at:
http://yuilibrary.com/downloads/yuicompressor/yuicompressor-2.4.2.zip


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Mandel  
View profile  
 More options Mar 4 2010, 6:00 pm
From: Mark Mandel <mark.man...@gmail.com>
Date: Fri, 5 Mar 2010 10:00:16 +1100
Local: Thurs, Mar 4 2010 6:00 pm
Subject: Re: JavaLoader and classpath behavior different on Adobe CF 8/9 and Railo 3 with interface classes

Being lazy - where can I find the JavaDoc for YUICompressor?

Mark

--
E: mark.man...@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

Hands-on ColdFusion ORM Training @ cf.Objective() 2010
www.ColdFusionOrmTraining.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
TomdeMan  
View profile  
 More options Mar 4 2010, 6:10 pm
From: TomdeMan <tom.demanin...@gmail.com>
Date: Thu, 4 Mar 2010 15:10:01 -0800 (PST)
Local: Thurs, Mar 4 2010 6:10 pm
Subject: Re: JavaLoader and classpath behavior different on Adobe CF 8/9 and Railo 3 with interface classes
I never found them online, I went off the src files that were included
with the jar in the download package.

On Mar 5, 12:00 am, Mark Mandel <mark.man...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matt Gersting  
View profile  
 More options Mar 4 2010, 6:12 pm
From: Matt Gersting <mgerst...@gmail.com>
Date: Thu, 4 Mar 2010 18:12:51 -0500
Local: Thurs, Mar 4 2010 6:12 pm
Subject: Re: JavaLoader and classpath behavior different on Adobe CF 8/9 and Railo 3 with interface classes
Is this what you're looking for, Mark?

http://github.com/yui/yuicompressor/blob/0e290b8e05392f19bccc2f7d5247...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Mandel  
View profile  
 More options Mar 4 2010, 6:20 pm
From: Mark Mandel <mark.man...@gmail.com>
Date: Fri, 5 Mar 2010 10:20:13 +1100
Local: Thurs, Mar 4 2010 6:20 pm
Subject: Re: JavaLoader and classpath behavior different on Adobe CF 8/9 and Railo 3 with interface classes

Thanks for that Matt - but I'm looking for the JavaDoc documentation.

Tom - first thing I would do is generate the JavaDoc documentation, so you
can browse how the library is implemented.  Browsing source for this is
tough.

Secondly, if ErrorReporter is an interface - yes, you can't create one. It's
an interface.

ColdFusion does have a 'feature' is if you request an interface it will
create an implementation for you that does nothing (i.e. not very useful).
Railo is probably giving you back the more 'correct' error.

If you do a javadoc of the library, you will be able to see what implements
the ErrorReporter interface - I would expect that there is a default
implementation with the library, and use that.

Mark

--
E: mark.man...@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

Hands-on ColdFusion ORM Training @ cf.Objective() 2010
www.ColdFusionOrmTraining.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom de Manincor  
View profile  
 More options Mar 4 2010, 9:04 pm
From: Tom de Manincor <tom.demanin...@gmail.com>
Date: Thu, 4 Mar 2010 18:04:26 -0800 (PST)
Local: Thurs, Mar 4 2010 9:04 pm
Subject: Re: JavaLoader and classpath behavior different on Adobe CF 8/9 and Railo 3 with interface classes
I can understand Railo's error being correct if it does not have the
feature that CF does for creating that skeleton interface object.
But what I can't understand is why it would not work on CF without
javaloader???

To me it seemed like a conflict of pre-loaded libraries in the CF
classpath.
I have verified another instance of
org.mozilla.javascript.ErrorReporter in one of the other jars.
That is why I assumed it worked with JavaLoader.

But not working on Railo with JavaLoader made me wonder if Railo and
JavaLoader have something different going on with respect to loading
the existing coldfusion libraries.

Which led me to try creating the same implementation the YUI java
source used to create the object.
I created a java class of the same type but different package.
Created the jar and threw it in the cf classpath.
Changed my code to create one of my new classes and passed that in,
and got the same error, about it being an interface or an abstract
class.

My next move would be to repackage the YUICompressor jar, but before I
do that the big question to me is...

How did JavaLoader get it to work? What is it doing? Got to be a way
to mimic it?

On Mar 5, 12:20 am, Mark Mandel <mark.man...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Mandel  
View profile  
 More options Mar 4 2010, 9:13 pm
From: Mark Mandel <mark.man...@gmail.com>
Date: Fri, 5 Mar 2010 13:13:50 +1100
Local: Thurs, Mar 4 2010 9:13 pm
Subject: Re: JavaLoader and classpath behavior different on Adobe CF 8/9 and Railo 3 with interface classes

Tom,

On Fri, Mar 5, 2010 at 1:04 PM, Tom de Manincor <tom.demanin...@gmail.com>wrote:

> I can understand Railo's error being correct if it does not have the
> feature that CF does for creating that skeleton interface object.
> But what I can't understand is why it would not work on CF without
> javaloader???

Why does it matter? If you do it correctly (and follow the ideas I suggested
below, you can get this working no problem).

I think you're making this overly complicated.

Mark
--
E: mark.man...@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

Hands-on ColdFusion ORM Training @ cf.Objective() 2010
www.ColdFusionOrmTraining.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tom de Manincor  
View profile  
 More options Mar 8 2010, 7:40 pm
From: Tom de Manincor <tom.demanin...@gmail.com>
Date: Mon, 8 Mar 2010 16:40:05 -0800 (PST)
Local: Mon, Mar 8 2010 7:40 pm
Subject: Re: JavaLoader and classpath behavior different on Adobe CF 8/9 and Railo 3 with interface classes
I've tried all kinds of stuff to get this to work with the CF
classpath with little success, just one error after another coming
from classes in the org.mozilla.javascript package.

So I am taking a break with the CF classpath issue and focus on Railo
with JavaLoader.

The same code that works in CF with JavaLoader produces the following
error in railo:

No matching Constructor for
com.yahoo.platform.yui.compressor.JavaScriptCompressor(java.io.StringReader ,
coldfusion.runtime.java.JavaProxy) found

There is nothing in the stack trace indicating what if anything
happened with the java code behind the scenes.

On Mar 5, 3:13 am, Mark Mandel <mark.man...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Mandel  
View profile  
 More options Mar 8 2010, 7:44 pm
From: Mark Mandel <mark.man...@gmail.com>
Date: Tue, 9 Mar 2010 11:44:07 +1100
Local: Mon, Mar 8 2010 7:44 pm
Subject: Re: JavaLoader and classpath behavior different on Adobe CF 8/9 and Railo 3 with interface classes

That looks like a bug in Railo's Java reflection and invocation
implementation.

Mark

On Tue, Mar 9, 2010 at 11:40 AM, Tom de Manincor
<tom.demanin...@gmail.com>wrote:

--
E: mark.man...@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

Hands-on ColdFusion ORM Training @ cf.Objective() 2010
www.ColdFusionOrmTraining.com/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »