glassfish 4.1 and cluster with JMS

I have create the cluster "mycluster", two local instance and the resources jms/Queue1, jms/Queue2 and jms/Topic with target server and cluster.

So in this way I created the cluster:

  • create-cluster mycluster

  • create-instance --node localhost-domain1 --cluster mycluster instance01

  • create-instance --node localhost-domain1 --cluster mycluster instance02

  • [...]

  • start-cluster mycluster

  • deploy --target mycluster Coo.ear

  • Application deployed with name Coo.

    Warning: Command _deploy did not complete successfully on server instance instance01: remote failure: Failed to load the application on instance instance01. The application will not run properly. Please fix your application and redeploy.

    Exception while loading the app : EJB Container initialization error. Please see server.log for more details.

    Warning: Command _deploy did not complete successfully on server instance instance02: remote failure: Failed to load the application on instance instance02. The application will not run properly. Please fix your application and redeploy.

    Exception while loading the app : EJB Container initialization error. Please see server.log for more details. Command deploy completed with warnings.

    [...]

    On [server]: hostname:8080/FE-war/ all right.

    On [instance01 the cluster] hostname:28080/FE-war

    and

    On [instance02 the cluster] hostname:28081/FE-war

    I get this desperate HTTP status 404 - Not Found ((((

    Complete logs file server, instance01, instance02, [...]:

    https://drive.google.com/folderview?id=0B7CqU8774DG8RGx0VkRVeEZXclE&usp=sharing

    2016-02-06T17:00:24.593+0100] [glassfish 4.1] [SEVERE] [] [org.eclipse.persistence.session./file:/home/glassfish/glassfish4/glassfish/nodes/localhost-domain1/Coo1/applications/ejb-timer-service-app/WEB-INF/classes/___EJB__Timer__App.ejb] [tid: _ThreadID=22 _ThreadName=RunLevelControllerThread-1454774410800] [timeMillis: 1454774424593] [levelValue: 1000] [[

    Local Exception Stack: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.1.v20150605-31e8258): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: java.net.ConnectException: Errore di connessione al server localhost sulla porta 1527 con messaggio Connessione rifiutata. Error Code: 0 [...]


    Your database/datasource is not configured correctly. It currently wants to connect to the database on localhost:1527 , but that means that each instance will try to connect to a database local to itself. Obviously this is not what you want - you want your app to always connect to the same database no matter what instance is being used.

    You need to edit the datasource in your cluster config to use a proper hostname so that each instance connects to, for example, dbserver:1527 and, if this is a production deployment, change your database from Derby to something else (eg MySQL, MariaDB, PostgreSQL etc). Apache Derby is not appropriate for production use.


    To start the derby database server on one of the cluster hosts or the DAS host run.

    asadmin start-database
    

    You will also need to reconfigure the URL for the jdbc/__default datasource in the administration console. Select the Additional Properties tab of the DerbyPool connection pool and change serverName from localhost to the hostname of the server you started the database on.

    DerbyPool的JDBC设置

    链接地址: http://www.djcxy.com/p/68252.html

    上一篇: Glassfish IllegalArgumentException:无效的ejb jar:它包含零ejb

    下一篇: glassfish 4.1和JMS集群