[JBoss-user] [Clustering/JBoss] - Re: ClassCastException when looking up HAPartition via JNDI

2004-07-11 Thread aggiaggi
Thx for the quick answer.

Best regards
Gerd

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3841685#3841685

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3841685


---
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Clustering/JBoss] - ClassCastException when looking up HAPartition via JNDI

2004-07-11 Thread aggiaggi
Hello,

I need help on the following problem:

I get a ClassCastException when I try to lookup the DefaultPartion via JNDI from 
within client code. I run jboss 3.2.2 in the shipped "all" configuration and have only 
jbossall-client.jar in the client's CLASSPATH. Here is my code:

import java.util.Properties;
  | 
  | import javax.naming.Context;
  | import javax.naming.InitialContext;
  | 
  | import org.jboss.ha.framework.interfaces.HAPartition;
  | 
  | public class TestJBoss {
  | 
  | public static void main(String[] args) {
  | Properties p = new Properties();
  | 
p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
  | p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
  | p.put(Context.PROVIDER_URL, "169.254.195.178:1100"); // HA-JNDI port.
  | 
  | try{
  | InitialContext ctx = new InitialContext(p);
  | Object obj = (Object) 
ctx.lookup("/HAPartition/DefaultPartition");
  | System.out.println(obj);
  | HAPartition myPartition = (HAPartition) obj;
  | System.out.println(myPartition.getPartitionName());
  | }catch(Exception e){
  | e.printStackTrace();
  | }
  | }
  | }

The System.out.println(obj) produces the following output:

anonymous wrote : Reference Class Name: org.jboss.ha.framework.server.HAPartitionImpl
  | Type: nns
  | Content: /HAPartition/DefaultPartition

Cheers 
Gerd

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3841671#3841671

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3841671


---
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Clustering/JBoss] - Re: Problems with HA-JNDI Lookup of DefaultPartition

2004-07-08 Thread aggiaggi
Thanks for the hint. I'll have a look.

Cheers
Gerd

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3841388#3841388

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3841388


---
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [Clustering/JBoss] - Problems with HA-JNDI Lookup of DefaultPartition

2004-07-05 Thread aggiaggi
Hello,

when I try to lookup the /HAPartition/DefaultPartition object in HA-JNDI I get a null 
object as result. There are no error messages during startup of server. I inspected 
the JNDI tree with JNDIExplorer and the object seems to be there. What am I doing 
wrong?

Here is the code:

public class RegisterServer {

public static void main(String[] args) {
Properties p = new Properties();

p.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
p.put(Context.PROVIDER_URL, "jnp://169.254.195.178:1100"); // HA-JNDI 
port.
p.setProperty("jnp.partitionName","DefaultPartition");
try{
InitialContext ctx = new InitialContext(p);
Object obj = ctx.lookup("/HAPartition/DefaultPartition");
HAPartition myPartition = (HAPartition) obj;
System.out.println(myPartition.getPartitionName());
}catch (Exception e) {
System.out.println(e.toString());
}
}
} 

Cheers
Gerdanonymous wrote : 

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3841003#3841003

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3841003


---
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user