2 Replies Latest reply: Jul 10, 2012 4:19 AM by rukbat RSS

    it's fail to depoly application

    newbieRyan
      it may be off-topic, but i don't know where i can post
      I wrote a simple app that enter data to DB and populate it in html
      however, It can't depoly it. Could you point out the error?

      Publishing failed
      Could not publish to the server.
      java.lang.NullPointerException
      Could not publish to the server.
      java.lang.NullPointerException
      cannot Deploy BookWeb
      Deployment Error for module: BookWeb: Error occurred during deployment: Exception while deploying the app [BookWeb] : org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 15; Deployment descriptor file META-INF/persistence.xml in archive [classes]. cvc-complex-type.2.4.a: Invalid content was found starting with element 'Properties'. One of '{"http://java.sun.com/xml/ns/persistence":class, "http://java.sun.com/xml/ns/persistence":exclude-unlisted-classes, "http://java.sun.com/xml/ns/persistence":shared-cache-mode, "http://java.sun.com/xml/ns/persistence":validation-mode, "http://java.sun.com/xml/ns/persistence":properties}' is expected.. Please see server.log for more details.

      <?xml version="1.0" encoding="UTF-8"?>
      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
      http://java.sun.com/xmls/ns/persistence/persistence_2_0.xsd"
      version="2.0">

      <persistence-unit name="chapter10PU" transaction-type="JTA">
      <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
      <jta-data-source>jdbc/__OraclePool</jta-data-source>
      <class>com.apress.javaee6.chapter10.Book</class>
      <Properties>
      <Property name="eclipselink.ddl-generation" value="create-tables"/>
      <Property name="eclipselink.logging.level" value="INFO"/>
      </Properties>
      </persistence-unit>
      </persistence>
        • 1. Re: it's fail to depoly application
          gimbal2
          Since you're configuring JTA I'm guessing this is going to be deployed on some form of application server, so the Enterprise Javabeans forum would have been a closer fit. But when you're not sure play it safe: post in Java programming. Also when posting any type of code, put it between \
           tags to make it readable.
          
          As for the error, the message itself already points out what is the problem. You are putting Properties (upper case) and properties (lowercase) is expected. You'd better learn to read and interpret error messages AND be precise when you want to further your career as a programmer, in this rare case the error message is even nice enough to mention what is expected so you don't have to do any guesswork or research, normally you don't have that luxury.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
          • 2. Re: it's fail to depoly application
            it may be off-topic, but i don't know where i can post
            Post has now been moved from the JDBC forum to the EJB forum for topic alignment.