title: Could not load class - JDBC
body: <p>I'm trying to get a JavaEE project to run on Glassfish 4.0 but when I try to flush inserts (persist) to the Sql Server DB it throws this error:</p>
  
  <pre><code>org.omg.CORBA.MARSHAL: WARNING: 00810057: Could not load class com.microsoft.sqlserver.jdbc.SQLServerException  vmcid: OMG  minor code: 57 completed: Maybe
  </code></pre>
  
  <p>The connection works in Netbeans for running commands and generating entity classes.</p>
  
  <p>Bean method:</p>
  
  <pre><code>    public int addUser(UserDetails u) {
      try{
          User uP  = new User(u.getUserName(), u.isEnabled(), u.isAdmin());
          em.persist(uP);
          return 0;
      }
      catch(Exception e)
      {
          throw new EJBException(e);
      }
  }
  </code></pre>
  
  <p>Persistence.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"&gt;
    &lt;persistence-unit name="LibraryBeanPU" transaction-type="JTA"&gt;
      &lt;jta-data-source&gt;JavaEE_Library&lt;/jta-data-source&gt;
      &lt;exclude-unlisted-classes&gt;false&lt;/exclude-unlisted-classes&gt;
      &lt;properties/&gt;
    &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>Client:</p>
  
  <pre><code>    public static void main(String[] args) {
      LibraryClient lc = new LibraryClient();
  }
  
  public LibraryClient()
  {
      LibraryFacadeRemote request = (LibraryFacadeRemote) getEJBBean("LibraryFacade");
      request.addUser(new UserDetails("admin", true, true));
  }
  
  public Object getEJBBean(String beanName) { 
      try {
          InitialContext ctx = new InitialContext();
          return ctx.lookup(beanName);
      } catch (Exception ex) {
          System.err.println("ERROR: while locating bean from the server " + ex.getMessage());
          return null;      
      }
  }
  </code></pre>