Re: [tcljava-user] two things: array problem and how to handle var length arg list
Brought to you by:
mdejong
From: Russell R. <rus...@gm...> - 2012-02-17 16:33:05
|
% set httpClient [java::new org.eclipse.jetty.client.HttpClient] java0x10 % set httpClients [java::new {org.eclipse.jetty.client.HttpClient[]} 2 {}] unknown class "org.eclipse.jetty.client.HttpClient" % I don't understand how classpath can be ok in creating a single instance then be the cause of "unknown" in attempting to create the array instance. On Wed, Feb 15, 2012 at 3:14 PM, Mo DeJong <mo...@mo...> wrote: > For the first issue, it may be the case that your ClientTransport class > can be loaded, but some other class that it depends on fails to load then > you try to init an instance of the object. These types of problems are > always caused by the CLASSPATH being set incorrectly. So, that would be the > first thing to try. > > Sorry, I don't know about the ... syntax, Jacl and Tcl Blend don't do > anything to try to deal with that new syntax. > > Mo DeJong > > On Feb 12, 2012, at 10:57 AM, Russell Roy wrote: > > Two things: > > 1) Problem w/ arrays... > > This works ok: > > % set arrayObj [java::new {int[]} 5 {11 12 99 14 15}] > java0x4 > > # this cast works ok too thus demonstrating that my class name is valid > % set clientTransport [java::cast * > org.cometd.client.transport.ClientTransport* $transport] > java0x3 > > But when I try to use that classname to create an array of these in the > same manner as int objects... > > % set clientTransports [java::new {* > org.cometd.client.transport.ClientTransport*[]} 1 $clientTransport] > unknown class "org.cometd.client.transport.ClientTransport" > % > > I didn't expect that result and I don't know how to correct. > > > 2) Thing 2. A certain class constructor takes a *variable length *argument > list. Here's the signature: > > *BayeuxClient<http://docs.cometd.org/apidocs/org/cometd/client/BayeuxClient.html#BayeuxClient%28java.lang.String,%20org.cometd.client.transport.ClientTransport,%20org.cometd.client.transport.ClientTransport...%29> > *(String<http://download.oracle.com/javase/1.5.0/docs/api/java/lang/String.html?is-external=true> > url, ClientTransport<http://docs.cometd.org/apidocs/org/cometd/client/transport/ClientTransport.html> > transport, ClientTransport<http://docs.cometd.org/apidocs/org/cometd/client/transport/ClientTransport.html> > ... transports) > Creates a BayeuxClient<http://docs.cometd.org/apidocs/org/cometd/client/BayeuxClient.html> that > will connect to the Bayeux server at the given URL and with the given > transport(s). > > > > % set client [java::new org.cometd.client.BayeuxClient http::// > 172.30.12.75:8080/cometd $clientTransport] > can't find accessible constructor with 2 argument(s) for class > "org.cometd.client.BayeuxClient" > > > Again, I didn't expect that result and don't know how to rephrase it in > tclblend parlance to satisfy the complaint. > > > Thanks in advance for any guidance you may be able to provide. > > - Russ Roy > > > > > > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > > http://www.accelacomm.com/jaw/sfnl/114/51521223/_______________________________________________ > tcljava-user mailing list > tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcljava-user > > > |