Results 1 to 2 of 2
  1. #1
    flanjl2 is offline Member
    Join Date
    Aug 2011
    Posts
    21
    Rep Power
    0

    Default supernewb nosucka

    Caused by: java.lang.ClassNotFoundException: JVA.remote.__EJB31_Generated__BookEJB__Intf____Bea n__ (no security manager:
    RMI class loader disabled)
    helpma please.

  2. #2
    jammas615 is offline Senior Member
    Join Date
    Jul 2011
    Location
    Melbourne, Victoria, Australia
    Posts
    155
    Rep Power
    4

    Default Re: supernewb nosucka

    How can people help you when all you give is an error message. What code is causing the error?

  3. #3
    flanjl2 is offline Member
    Join Date
    Aug 2011
    Posts
    21
    Rep Power
    0

    Default Re: supernewb nosucka

    I have resolved all discrepancies up until this point, most were solved in the policy file.
    ...............................................

    package JVA.remote;

    import java.util.*; import java.rmi.*; import javax.ejb.spi.*; import javax.*; import javax.ejb.embeddable.EJBContainer; import javax.naming.*; import javax.ejb.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import java.net.Socket;


    public class MainRemote {

    public static Context ctx;
    public static BookEJB bookejb;
    public static JVARemoteInterface jvari;

    public static void main(String[] args) {
    Book book= new Book();

    Hashtable envHash = new Hashtable();
    //envHash.put("java.naming.factory.initial","com.eve rmind.server.rmi.RMIInitialContextFactory");
    envHash.put("java.naming.provider.url","http://localhost");

    System.setProperty("java.security.policy", "client.policy");
    if (System.getSecurityManager() == null)
    System.setSecurityManager(new RMISecurityManager());

    try {
    ctx= new InitialContext(envHash);
    bookejb= (BookEJB)ctx.lookup("java:global/MainRemote-1.0/BookEJB");
    }
    catch(NamingException ne) {
    System.out.println(ne+"...");
    }

    //bookejb.createBook(book);


    }

    }

    package JVA.remote;

    import java.util.*;
    import javax.persistence.*; import javax.ejb.*;
    import JVA.remote.JVARemoteInterface;
    import java.rmi.*; import java.util.List; import javax.*; import javax.annotation.*; import java.io.Serializable;

    @Stateless(mappedName="BookEJB")
    public class BookEJB implements Serializable {

    @PersistenceContext(unitName="chapter06PU")
    EntityManager em;

    public List<Book> findBooks() {
    Query query= em.createNamedQuery("findAllBooks");
    return query.getResultList();
    }

    public Book findBookById(Long id) {
    return em.find(Book.class, id);
    }

    public Book createBook(Book book) {
    em.persist(book);
    return book;

    }

    public void deleteBook(Book book) {
    em.remove(em.merge(book));
    }

    public Book updateBook(Book book) {
    return em.merge(book);
    }

    }

    .................................................. .

    java.lang.NullPointerException
    at com.sun.corba.ee.impl.orb.ORBImpl.postInit(ORBImpl .java)
    at com.sun.corba.ee.impl.orb.ORBImpl.set_parameters(O RBImpl.java:704)
    at com.sun.corba.ee.impl.orb.ORBImpl.setParameters(OR BImpl.java:691)
    at com.sun.corba.ee.spi.osgi.ORBFactory.initialize(OR BFactory.java:107)
    at org.glassfish.enterprise.iiop.impl.GlassFishORBMan ager.initORB(GlassFishORBManager.java:581)
    at org.glassfish.enterprise.iiop.impl.GlassFishORBMan ager.getORB(GlassFishORBManager.java:263)
    at org.glassfish.enterprise.iiop.impl.GlassFishORBFac toryImpl.createORB(GlassFishORBFactoryImpl.java:93 )
    at org.glassfish.enterprise.iiop.api.GlassFishORBHelp er.getORB(GlassFishORBHelper.java:152)
    at com.sun.enterprise.naming.impl.SerialContext.getOR B(SerialContext.java:365)
    at com.sun.enterprise.naming.impl.SerialContext.getPr oviderCacheKey(SerialContext.java:372)
    at com.sun.enterprise.naming.impl.SerialContext.getRe moteProvider(SerialContext.java:402)
    at com.sun.enterprise.naming.impl.SerialContext.getPr ovider(SerialContext.java:347)
    at com.sun.enterprise.naming.impl.SerialContext.looku p(SerialContext.java:504)
    at com.sun.enterprise.naming.impl.SerialContext.looku p(SerialContext.java:455)
    at javax.naming.InitialContext.lookup(InitialContext. java:411)
    at JVA.remote.MainRemote.main(MainRemote.java:28)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •