Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

error while launching a mysql database with glassfish

  Asked By: Lamberta    Date: Nov 25    Category: Java    Views: 574

I ask for some help on basic management of glassfish with mysql.

here is what I have done:
I downloaded glassfish, unpacked it in /Users/(myname)/Downloads (I'm on
macos X.5), then I installed mysql with the plugin for the "system
preferences".I ran mysql from it (the "system preferences") and I
obtained a message telling me that mysql is well launched.
then, I entered the command "ant -f setup.xml" in order to configure
I successfully launched the "domain1", and created a personal domain.

I ran the following task:

<target name="start-domain" description="starts application server
petstore domain" depends="check">

<echo message="Starting ${application.name} domain for

<exec executable="${asadmin}" failonerror="true"

<arg line=" start-domain"/>

<arg line=" --echo=${echo}"/>

<arg line=" ${application.name}"/>



but the following command makes an error:

<target name="start-db" description="starts the databse server."

<exec executable="${asadmin}" failonerror="true"

<arg value="start-database"/>

<arg line=" --echo=${echo}"/>

<arg value="--dbhost=${db.host}"/>

<arg value="--dbport=${db.port}"/>

<arg value="--dbhome=${derby.home}"/>



this previous command generates this line:

start-database --terse=false --dbhost localhost --dbport
3306 --echo=true --dbhome /Users/oliviersaint-eve/Downloads/glassfish/javadb

the error (catched in derby.log) is: unable to listen on port 3306 on
host localhost.

do you know what's going wrong?



2 Answers Found

Answer #1    Answered By: Kristen Chavez     Answered On: Nov 25

Did you copy the MySql JDBC driver (JAR file) to you glassfishHome/lib?

Answer #2    Answered By: Jennie Harris     Answered On: Nov 25

missing driver would cause in class not found exception, not "unable to listen
on port  3306 on host localhost."

The problem is that you are launching  Derby database  on port 3306, which of
course you can not do since mysql  is already listening on that port.
you are not configuring glassfish to connect to MySQL, you are configuring it
with Derby and telling derby to listen on 3306.

Here you are configuring Derby:
start-database --terse=false --dbhost localhost  --dbport 3306 --echo=true
--dbhome /Users/oliviersaint-eve/Downloads/glassfish/javadb

configure glassfish with mysql.

Didn't find what you were looking for? Find more on error while launching a mysql database with glassfish Or get search suggestion and latest updates.