Este es el main que me permite inicializar los campos de las tablas 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.SerialInitContextFactor y");
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(objr ef2 ,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(obj ref, 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 la parte de las librerias he incluido el .JAR generado de desplegar los ejb que necesitaba, y al ejecutar todo esto me sale el siguiente error:
init:
deps-jar:
Created dir: D:\Documents and Settings\X\Escritorio\seminario LSD\crearUsuAdmin\build\classes
Compiling 1 source file to D:\Documents and Settings\X\Escritorio\seminario LSD\crearUsuAdmin\build\classes
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:0000000000000030524d493a50657266696c 454a422e50657266696c52656d6f7465486f6d653a30303030 30303030303030303030303000000000010000000000000178 000102000000000a3132372e302e302e31000e7400000056af abcb00000000260000003f00000009533141532d4f52420000 00000000000200000008526f6f74504f410000000012373435 33363030383938393637313432370000000000000d0108ce1a f2ce000300000001ff14000000000007000000010000002000 00000000010001000000020501000100010020000101090000 00010001010000000026000000020002000000000003000000 14000000000000000a3132372e302e302e31000eec00000003 00000014000000000000000a3132372e302e302e31000f5000 00001f00000004000000030000002000000004000000010000 00210000007800000000000000010000000000000024000000 1c0000006600000000000000010000000a3132372e302e302e 31000eec004000000000000806066781020101010000001704 01000806066781020101010000000764656661756c74000400 00000000000000000001000000080606678102010101000000 0f
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.ORBUtilSystemExcepti on.couldNotFindClass(ORBUtilSystemException.java:7 930)
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.inputObje ctField(IIOPInputStream.java:1989)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputClas sFields(IIOPInputStream.java:2213)
at com.sun.corba.ee.impl.io.IIOPInputStream.inputObje ct(IIOPInputStream.java:1221)
at com.sun.corba.ee.impl.io.IIOPInputStream.simpleRea dObject(IIOPInputStream.java:400)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValu eInternal(ValueHandlerImpl.java:330)
at com.sun.corba.ee.impl.io.ValueHandlerImpl.readValu e(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.UEInfoServiceC ontext.<init>(UEInfoServiceContext.java:30)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Construc tor.java:274)
at com.sun.corba.ee.spi.servicecontext.ServiceContext Data.makeServiceContext(ServiceContextData.java:11 4)
at com.sun.corba.ee.spi.servicecontext.ServiceContext s.unmarshal(ServiceContexts.java:195)
at com.sun.corba.ee.spi.servicecontext.ServiceContext s.get(ServiceContexts.java:357)
at com.sun.corba.ee.spi.servicecontext.ServiceContext s.get(ServiceContexts.java:345)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestD ispatcherImpl.processResponse(CorbaClientRequestDi spatcherImpl.java:470)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestD ispatcherImpl.marshalingComplete(CorbaClientReques tDispatcherImpl.java:327)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegate Impl.invoke(CorbaClientDelegateImpl.java:158)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocat ionHandlerImpl.invoke(StubInvocationHandlerImpl.ja va:129)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELSt ubBase.invoke(Unknown Source)
at PerfilEJB._PerfilRemoteHome_DynamicStub.create(_Pe rfilRemoteHome_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.UEInfoServiceC ontext.<init>(UEInfoServiceContext.java:34)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Construc tor.java:274)
at com.sun.corba.ee.spi.servicecontext.ServiceContext Data.makeServiceContext(ServiceContextData.java:11 4)
at com.sun.corba.ee.spi.servicecontext.ServiceContext s.unmarshal(ServiceContexts.java:195)
at com.sun.corba.ee.spi.servicecontext.ServiceContext s.get(ServiceContexts.java:357)
at com.sun.corba.ee.spi.servicecontext.ServiceContext s.get(ServiceContexts.java:345)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestD ispatcherImpl.processResponse(CorbaClientRequestDi spatcherImpl.java:470)
at com.sun.corba.ee.impl.protocol.CorbaClientRequestD ispatcherImpl.marshalingComplete(CorbaClientReques tDispatcherImpl.java:327)
at com.sun.corba.ee.impl.protocol.CorbaClientDelegate Impl.invoke(CorbaClientDelegateImpl.java:158)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocat ionHandlerImpl.invoke(StubInvocationHandlerImpl.ja va:129)
at com.sun.corba.ee.impl.presentation.rmi.bcel.BCELSt ubBase.invoke(Unknown Source)
at PerfilEJB._PerfilRemoteHome_DynamicStub.create(_Pe rfilRemoteHome_DynamicStub.java)
at crearusuadmin.Main.main(Main.java:42)
BUILD SUCCESSFUL (total time: 2 seconds)
A ver si alguien me puede echar una mano....
Saludosss