Spike's solution will give you errors and so will ClassLoader.CFC

First loading a Jar with that solution!

<cfset URLObject.init("file:"&currentDirectory&"jxl.jar")>

line 22

<cfset helloWorld = loader.loadClass("jxl.Workbook").newInstance()>

You get these error with Spikes solution and ClassLoader.cfc

Class coldfusion.runtime.StructBean can not access a member of class
jxl.Workbook with modifiers "protected" null

So YES it does I would make a difference.  As I just stated that
classloaders only work if the methods are public. I had problems with
protected methods too. JavaProxy does not for work protected methods which
the JavaLoader.cfc uses which and is ever better then Spikes example.

This works just like adding a jar to the classpath and turning the server
off and on and it is without context issues

Try the jexcel API with Spikes example and then try JavaLoader.cfc and you
will find that Workbook only with works my CFC.

Workbook.java

Reason is

protected Workbook()
  {
  }


On 7/23/06, James Holmes <[EMAIL PROTECTED]> wrote:
>
> Does that do anything that this doesn't?
>
>
> http://www.spike.org.uk/blog/index.cfm?do=blog.entry&entry=B49509DF-D565-E33F-31C9E574EA1591EE
>
> On 7/23/06, dan plesse <[EMAIL PROTECTED]> wrote:
> > Hello All,
> >
> > This could be my final java solution (300+) and it was a big pain to
> make.
> >
> > After making a 2 line classloader I found out that I was having trouble
> > with anything other then public methods and saving objects to disk was
> not
> > working out so I tested out just adding jars to the classpath at runtime
> and I did see the errors I was getting with classloaders. I tested it with
> > test.forName("jxl.Workbook") and that did not error so I am assuming it
> works. It uses java reflection.
> >
> > Add Jar at Runtime/CLASSPATH CFC
> > http://www.cfide.org/add_jar_at_runtime.html
> >
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/cf_lists/message.cfm/forumid:4/messageid:247430
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to