Error al intentar dar de alta un usuario nuevo en el PointBase

msitika
18 de Enero del 2006
Hola
Tengo el siguiente main con el que quiero inicializar los campos de la tabla usuario y perfil del PointBase:

package crearusuadmin;

import java.util.*;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.rmi.PortableRemoteObject;
import com.sun.enterprise.util.Console.*;
import UsuarioEJB.*;
import PerfilEJB.*;


public class Main {


public static void main(String[] args) {

try {

Properties env = new Properties();
env.put("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
env.put("java.naming.provider.url", "iiop://localhost:3700");

InitialContext initial = new InitialContext(env);

Object objref2 = initial.lookup("ejb/PerfilBean");
PerfilRemoteHome homePerfil = (PerfilRemoteHome)PortableRemoteObject.narrow(objref2 ,PerfilRemoteHome.class);
System.out.println("el homePerfil"+ homePerfil);

PerfilRemote per1= homePerfil.create("1p","Administrador");
PerfilRemote per2= homePerfil.create("2p","Coordinador");
PerfilRemote per3= homePerfil.create("3p","Profesr");
PerfilRemote per4= homePerfil.create("4p","Alumno");

Object objref = initial.lookup("ejb/UsuarioBean");
UsuarioRemoteHome homeUsuario = (UsuarioRemoteHome)PortableRemoteObject.narrow(objref, UsuarioRemoteHome.class);

UsuarioRemote user = homeUsuario.create("admin", "admin", "Administrdor Master", "", true, 0, 0, "", "1p");
System.out.println(user.getUsername());

}catch(javax.ejb.DuplicateKeyException dke){
System.out.println("Ya existe usuario admin creado");
}catch (Exception ex) {
System.err.println("Caught an exception." );
ex.printStackTrace();
}
}

}

En el pryecto tengo incluida la libreria .JAR generada del despliegue de los ejb que necesito para tarbajar, pero aun asi me sale un error acerca de que no encuntra las clases... El programa me casca al llegar al metodo create y no se porque. Os pego el error:

init:
deps-jar:
Created dir: D:Documents and SettingsAnaEscritorioseminario LSDcrearUsuAdminbuildclasses
Compiling 1 source file to D:Documents and SettingsAnaEscritorioseminario LSDcrearUsuAdminbuildclasses
compile:
run:
15-ene-2006 15:13:24 com.sun.corba.ee.spi.logging.LogWrapperBase doLog
INFO: "IOP00710299: (INTERNAL) Successfully created IIOP listener on the specified host/port: all interfaces/1163"
el homePerfilIOR:0000000000000030524d493a50657266696c454a422e50657266696c52656d6f7465486f6d653a3030303030303030303030303030303000000000010000000000000178000102000000000a3132372e302e302e31000e7400000056afabcb00000000260000003f00000009533141532d4f5242000000000000000200000008526f6f74504f41000000001237343533363030383938393637313432370000000000000d0108ce1af2ce000300000001ff14000000000007000000010000002000000000000100010000000205010001000100200001010900000001000101000000002600000002000200000000000300000014000000000000000a3132372e302e302e31000eec0000000300000014000000000000000a3132372e302e302e31000f500000001f00000004000000030000002000000004000000010000002100000078000000000000000100000000000000240000001c0000006600000000000000010000000a3132372e302e302e31000eec00400000000000080606678102010101000000170401000806066781020101010000000764656661756c74000400000000000000000000010000000806066781020101010000000f
15-ene-2006 15:13:25 com.sun.corba.ee.impl.encoding.CDRInputStream_1_0 read_value
ADVERTENCIA: "IOP00810257: (MARSHAL) Could not find class"
org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
at com.sun.corba.ee.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemException.java:7930)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1013)
at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:259)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:1989)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2213)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1221)
at com.sun.corba.ee.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:400)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:330)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:296)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1034)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:879)
at com.sun.corba.ee.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:255)
at com.sun.corba.ee.spi.servicecontext.UEInfoServiceContext.<init>(UEInfoServiceContext.java:30)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at com.sun.corba.ee.spi.servicecontext.ServiceContextData.makeServiceContext(ServiceContextData.java:114)
at com.sun.corba.ee.spi.servicecontext.ServiceContexts.unmarshal(ServiceContexts.java:195)
at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:357)
at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:345)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:470)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:327)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:158)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
at PerfilEJB._PerfilRemoteHome_DynamicStub.create(_PerfilRemoteHome_DynamicStub.java)
at crearusuadmin.Main.main(Main.java:42)
Caused by: java.lang.ClassNotFoundException
... 27 more
Caught an exception.
org.omg.CORBA.UNKNOWN: vmcid: 0x0 minor code: 0 completed: Maybe
at com.sun.corba.ee.spi.servicecontext.UEInfoServiceContext.<init>(UEInfoServiceContext.java:34)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at com.sun.corba.ee.spi.servicecontext.ServiceContextData.makeServiceContext(ServiceContextData.java:114)
at com.sun.corba.ee.spi.servicecontext.ServiceContexts.unmarshal(ServiceContexts.java:195)
at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:357)
at com.sun.corba.ee.spi.servicecontext.ServiceContexts.get(ServiceContexts.java:345)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java:470)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestDispatcherImpl.marshalingComplete(CorbaClientRequestDispatcherImpl.java:327)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegateImpl.invoke(CorbaClientDelegateImpl.java:158)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:129)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELStubBase.invoke(Unknown Source)
at PerfilEJB._PerfilRemoteHome_DynamicStub.create(_PerfilRemoteHome_DynamicStub.java)
at crearusuadmin.Main.main(Main.java:42)
BUILD SUCCESSFUL (total time: 2 seconds)

A ver si alguien sabe xq puede ser...
Gracias, y un saludo!

Eric Mignot
18 de Enero del 2006
Hola,

dos ideas :

1.Estas seguro de que el servidor tenga acceso al stub y al skeleton de PerfilRemoteHome desde su classpath ?

2.Parece que tu cliente intenta connectarse a un servidor en el puerto 3700. Sabes que classe da la informacio de la creacion de un listener sobre el puerto 1163 ? Si es el servidor (listener !) podria ser que tu cliente no se connectara al adecuado servidor pero a uno (3700) que sigue arrancado y que olvidaste parar antes de cambiar de puerto. Yo mismo tengo dificultad a describir el hopotesis ;-)