[jboss-jira] [JBoss JIRA] Created: (JBAS-4038) HiLoKeyGeneratorFactory IllegalArgumentException
Manuel Duran Aguete (JIRA)
jira-events at jboss.com
Wed Jan 31 05:12:22 EST 2007
HiLoKeyGeneratorFactory IllegalArgumentException
------------------------------------------------
Key: JBAS-4038
URL: http://jira.jboss.com/jira/browse/JBAS-4038
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: JBossAS-4.0.5.GA
Environment: java version "1.5.0_10"
Debian Sarge 2.6.18-2-686 #1 SMP Wed Nov 8 19:52:12 UTC 2006 i686 GNU/Linux
jboss-4.0.5.GA JEMS INSTALLER 1.2.0.GA with ejb3-clustered fresh install
Reporter: Manuel Duran Aguete
When we try to use the HiLoKeyGenerator the following exception occurs:
java.lang.IllegalArgumentException: no such field
at java.io.ObjectInputStream$GetFieldImpl.getFieldOffset(ObjectInputStream.java:2092)
at java.io.ObjectInputStream$GetFieldImpl.get(ObjectInputStream.java:2028)
at org.jboss.ejb.plugins.keygenerator.hilo.HiLoKeyGeneratorFactory.readObject(HiLoKeyGeneratorFactory.java:431)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:946)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1809)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at net.caixagaliciamoviles.plataforma.sms.mensaje.SMSIdGenerator.getSMSId(SMSIdGenerator.java:27)
The calling code is :
public static String getSMSId() {
log.info ("Generando SMSID");
try {
InitialContext ctx = new InitialContext();
KeyGeneratorFactory kgf = (KeyGeneratorFactory) ctx.lookup("HiLoKeyGeneratorFactory");
KeyGenerator kg = kgf.getKeyGenerator ();
Long id = (Long) kg.generateKey ();
String txtId = String.valueOf (id);
log.info ("El SMSID generado es [" + txtId + "]");
return txtId;
} catch (Exception e){
log.warn ("Error generando SMSID",e);
}
log.info ("El ID es BLANCO");
return "";
}
The exception is thrown at " KeyGeneratorFactory kgf = (KeyGeneratorFactory) ctx.lookup("HiLoKeyGeneratorFactory");
If we change to use de UUID generator no exception is thrown in lookup.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list