Steven,

I'm looking at the link that you sent and I don't see a constructor for the
Mib class.  I am presuming that when the Javadoc was generated it was set to
only document public members - which doesn't appear to include any of the
constructors for this class.  Further upon reading the (slight)
documentation for this class it appears that getFile is not a static member.
I'm guessing that you request a reference for a Mib instance from another
object (perhaps the MibLoader) and it will construct one with the
appropriate content internally.  Since you don't have a constructed Mib with
internal content I can see why your call to getFile might give you some
problems.

rish

________________________________

From: Steve Dworman [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 15, 2004 12:09 PM
To: CF-Talk
Subject: Re: cfobject and java


i totally understand that, so i guess my problem is a little
different.

the following is my code to load a mib file.  this works.

<cfscript>

mib = createobject("java", "net.percederberg.mibble.MibLoader");
nfo = createobject("java", "net.percederberg.mibble.Mib");

tempdir="my path here";
tempvar = createObject( "java" ,  "java.io.File" ).init(tempdir);

mib.addDir(tempvar);
temp = mib.load("sonus.mib");
</cfscript>

You'll notice I create another object "nfo" which i need to access.
This is the mib class
http://www.mibble.org/doc/release/api/net/percederberg/mibble/Mib.html

I'm trying to call something simple like the getLoader or getFile
method.
if i add a line like "blah = nfo.getFile();" then i get an error
such as
net.percederberg.mibble.Mib  


  
The error occurred in : line 25


23 : mib.addDir(tempvar);
24 : temp = mib.load("sonus.mib");
25 : blah = nfo.getFile();
26 : </cfscript>
27 :





>Steve,
>
>Handling static methods is simple:
>
>X = createObject("java", "someclass");
>X.staticMethod(1, 2);
>
>Note that I did not invoke the init method (constructor alias).
>
>As for sharing the results of methods between objects...  You would
handle
>that just as you might expect.  Save the return value of a method
to a CFML
>variable and pass it as the argument to method in another object.
>
>You might refer to this content:
>http://www.sys-con.com/coldfusion/article.cfm?id=250
>
>
>rish
>
>________________________________
>
> From: Steve Dworman [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 15, 2004 11:46 AM
> To: CF-Talk
> Subject: cfobject and java
>
>
> here's the deal...
>
> i can, obviously, create an object for any class.
>
> i can also call any method that looks like "public void
>addDir(java.io.File dir)" and of course i have to something like
>createObject( "java" ,  "java.io.File" ).init(tempdir),
>
> how do i access a method like "public static void
>main(java.lang.String[] args)"?
>
> furthermore, how can i create multiple objects and make results
>accessible between them?
>________________________________
________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to