Better, but not a flawless experience.
Originally I got an exception:
java.sql.SQLException: *Failed to create database
'/temp/cargo-tracker-database', see the next exception for details.*
at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
I'm on a Linux system, not running as root, and there is no /temp
directory, so I changed the following line in pom.xml:
<webapp.databaseTempDir>/temp</webapp.databaseTempDir>
to
<webapp.databaseTempDir>/tmp</webapp.databaseTempDir>
Then changed the following line in test-web.xml
<url>jdbc:derby:/temp/test/cargo-tracker-database;create=true</url>
to
<url>jdbc:derby:/tmp/test/cargo-tracker-database;create=true</url>
Rebuilt and redeployed, but I was still getting the exception, I searched
all over the code for references to "/temp" but couldn't find any.
As a workaround I sudo'ed to root, created /temp and chmod'ed it 777, and
was finally able to deploy.
FWIW, this is the version of GlassFish I downloaded:
http://dlc.sun.com.edgesuite.net/glassfish/4.0/promoted/latest-glassfish.zip<http://dlc.sun.com.edgesuite.net/glassfish/4.0/promoted/>
Added it to NetBeans ("Services" tab, right click "Servers" | "Add Server")
David
On Sat, Oct 5, 2013 at 12:05 PM, Reza Rahman <reza.rahman_at_oracle.com> wrote:
> Could you kindly try the nightly build of GlassFish 4 and tell me what
> happens?
>
> Sent from my iPhone
>
> On Oct 5, 2013, at 12:01 PM, David Heffelfinger <dheffelfinger_at_gmail.com>
> wrote:
>
> All,
>
> I got the latest source code from SVN as of this morning (revision 123).
>
> I loaded the project into NetBeans 7.4 RC2, and built it without a problem.
>
> I then attempted to deploy and run the project to GlassFish 4 (included
> with NetBeans), but was unsuccessful, I got a NoClassDefFoundError.
>
> Here is a partial stack trace:
>
> SEVERE: Exception while preparing the app :
> java.lang.NoClassDefFoundError: Could not initialize class
> org.apache.derby.jdbc.EmbeddedDriver
> java.lang.NoClassDefFoundError: Could not initialize class
> org.apache.derby.jdbc.EmbeddedDriver
> at java.lang.Class.forName0(Native Method)
> at java.lang.Class.forName(Class.java:188)
> at
> com.sun.gjc.spi.DMManagedConnectionFactory.createManagedConnection(DMManagedConnectionFactory.java:114)
> at
> com.sun.enterprise.resource.allocator.LocalTxConnectorAllocator.createResource(LocalTxConnectorAllocator.java:87)
> at
> com.sun.enterprise.resource.pool.ConnectionPool.createSingleResource(ConnectionPool.java:907)
> at
> com.sun.enterprise.resource.pool.ConnectionPool.createResource(ConnectionPool.java:1189)
> at
> com.sun.enterprise.resource.pool.datastructure.RWLockDataStructure.addResource(RWLockDataStructure.java:98)
>
> I made sure I had derby.jar under .../domain1/lib but the problem persists.
>
> I would look deeper into it but unfortunately I'm busy with some other
> stuff.
>
> Is this a known issue or am I missing something here?
>
> Thanks,
> David
>
>
> --
> http://ensode.net - A Guide to Java, Linux and Other Technology Topics
> My Books: http://www.packtpub.com/authors/profiles/david-heffelfinger
> My Video Training:
> http://www.packtpub.com/java-ee-development-with-netbeans-7/video
> Follow me on Twitter: https://twitter.com/ensode
>
>
--
http://ensode.net - A Guide to Java, Linux and Other Technology Topics
My Books: http://www.packtpub.com/authors/profiles/david-heffelfinger
My Video Training:
http://www.packtpub.com/java-ee-development-with-netbeans-7/video
Follow me on Twitter: https://twitter.com/ensode