[GLASSFISH-19075] starting hybrid osgi app with jpa failed on a cluster and causing undeploy-related problems Created: 14/Sep/12  Updated: 19/Sep/12

Status: Open
Project: glassfish
Component/s: OSGi-JavaEE
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: TangYong Assignee: Sanjeeb Sahoo
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

1 Windows XP
2 GF Trunk 2012/09/14


Attachments: Java Archive File sample.uas.api.jar     Java Archive File sample.uas.entities.jar     Text File server.log    

 Description   

1 After setting the "org.glassfish.osgjpa.extension.useHybridPersistenceProviderResolver=true" and executing the following commands, a hybrid osgi app with jpa started failed from server.log[1],

1) >asadmin start-domain
Waiting for domain1 to start .......................
Successfully started the domain : domain1
domain Location: E:\gf0914\glassfish3\glassfish\domains\domain1
Log File: E:\gf0914\glassfish3\glassfish\domains\domain1\logs\server.log
Admin Port: 4848
Command start-domain executed successfully.

2) >asadmin start-database
Starting database in Network Server mode on host 0.0.0.0 and port 1527.
...

3) >asadmin create-cluster cluster1
Command create-cluster executed successfully.

4) >asadmin create-local-instance --cluster cluster1 --systemproperties HTTP_LISTENER_PORT=18080:HTTP_SSL_LISTENER_PORT=18181:IIOP_SSL_LISTENER_PORT=13800:IIOP_LISTENER_PORT=13700:JMX_SYSTEM_CONNECTOR_PORT=17676:IIOP_SSL_MUTUALAUTH_PORT=13801:JMS_PROVIDER_PO
Rendezvoused with DAS on localhost:4848.
Port Assignments for server instance in1:
JMX_SYSTEM_CONNECTOR_PORT=17676
JMS_PROVIDER_PORT=18686
HTTP_LISTENER_PORT=18080
ASADMIN_LISTENER_PORT=14848
JAVA_DEBUGGER_PORT=29009
IIOP_SSL_LISTENER_PORT=13800
IIOP_LISTENER_PORT=13700
OSGI_SHELL_TELNET_PORT=26666
HTTP_SSL_LISTENER_PORT=18181
IIOP_SSL_MUTUALAUTH_PORT=13801
Command create-local-instance executed successfully.

5) >asadmin create-local-instance --cluster cluster1 --systemproperties HTTP_LISTENER_PORT=28080:HTTP_SSL_LISTENER_PORT=28181:IIOP_SSL_LISTENER_PORT=23800:IIOP_LISTENER_PORT=23700:JMX_SYSTEM_CONNECTOR_PORT=27676:IIOP_SSL_MUTUALAUTH_PORT=23801:JMS_PROVIDER_PO
Rendezvoused with DAS on localhost:4848.
Using DAS host localhost and port 4848 from existing das.properties for node
localhost-domain1. To use a different DAS, create a new node using create-node-ssh or
create-node-config. Create the instance with the new node and correct
host and port:
asadmin --host das_host --port das_port create-local-instance --node node_name instance_name.
Port Assignments for server instance in2:
JMX_SYSTEM_CONNECTOR_PORT=27676
JMS_PROVIDER_PORT=28686
HTTP_LISTENER_PORT=28080
ASADMIN_LISTENER_PORT=24848
JAVA_DEBUGGER_PORT=29010
IIOP_SSL_LISTENER_PORT=23800
IIOP_LISTENER_PORT=23700
OSGI_SHELL_TELNET_PORT=26667
HTTP_SSL_LISTENER_PORT=28181
IIOP_SSL_MUTUALAUTH_PORT=23801
Command create-local-instance executed successfully.

6) >asadmin deploy --type=osgi --target cluster1 E:\gfv4\gftrunk\fighterfish\sample\uas\entities\target\sample.uas.entities.jar
Application deployed with name sample.uas.entities.
Command deploy executed successfully.

7) >asadmin start-local-instance in1
Waiting for in1 to start ......................................................................................................................................................
Successfully started the instance: in1
instance Location: E:\gf0914\glassfish3\glassfish\nodes\localhost-domain1\in1
Log File: E:\gf0914\glassfish3\glassfish\nodes\localhost-domain1\in1\logs\server.log
Admin Port: 14848
Command start-local-instance executed successfully.

Although the above commands can be executed successfully, if opening glassfish3\glassfish\nodes\localhost-domain1\in1\logs\server.log[1], you will find that sample.uas.entities.jar[2] has started failed because of "No Persistence provider for EntityManager named sample.uas.entities".

[1] pl.see the attachment(server.log)
[2] pl.see the attachment(sample.uas.entities.jar)

2 Based 1, while you undeployed the sample.uas.entities.jar using the following command, undeploying will also failed[3] although displaying "Command undeploy executed successfully".

>asadmin undeploy --target cluster1 sample.uas.entities
sample.uas.entities disabled failed
An error occurred during replication
Failure: Command disable failed on server instance in1: remote failure: Application not registered
Command undeploy executed successfully.

[3] The mean of what I said "failed" is that,
1) on the instance's felix-cache(glassfish\nodes\localhost-domain1\in1\osgi-cache\felix), sample.uas.entities bundle still existed and has been not deleted.

2) on the das server's felix-cache(glassfish\domains\domain1\osgi-cache\felix), sample.uas.entities bundle has been deleted. so inconsist with 1)

3) on the das server's "domains\domain1\applications", sample.uas.entities directory and resouces still existed and has been not deleted. On the other hand, on the instance's "nodes\localhost-domain1\in1\applications", sample.uas.entities directory and resouces been deleted. So inconsistance also happened.

4) on the das server's "glassfish\domains\domain1\config\domain.xml", sample.uas.entities application-ref and application definition still existed, however on the instance's "nodes\localhost-domain1\in1\config\domain.xml", sample.uas.entities application-ref and application definition have been deleted. So, inconsistance happened again.



 Comments   
Comment by TangYong [ 14/Sep/12 ]

On cluster mode, right undeploying results are as following:

Taking the sample.uas.api.jar[1] as an example, after undeploying the bundle,

1) on the instance's felix-cache(glassfish\nodes\localhost-domain1\in1\osgi-cache\felix), sample.uas.api bundle will be deleted.

2) on the das server's felix-cache(glassfish\domains\domain1\osgi-cache\felix), sample.uas.api bundle will be deleted.

3) on the das server's "domains\domain1\applications", sample.uas.api directory and resouces will be deleted. And on the instance's "nodes\localhost-domain\in1\applications", sample.uas.api directory and resouces will be deleted too.

4) on the das server's "glassfish\domains\domain1\config\domain.xml", sample.uas.api application-ref and application definition will be deleted,and on the instance's "nodes\localhost-domain1\in1\config\domain.xml", sample.uas.api application-ref and application definition have been deleted too.

[1] pl. see the attachment(sample.uas.api.jar)

Comment by TangYong [ 19/Sep/12 ]

I need to say that on problem description, it needs not to create two instances on cluster and creating only one instance will trigger the problem. And I also confirmed the problem can be reproduced based on the newest gf trunk and confirmed that my env has no problem.

Comment by TangYong [ 19/Sep/12 ]

If first starting cluster instance, then deploying the jpa bundle, the jpa bundle can be deployed successfully and the exception of "No Persistence provider for EntityManager named sample.uas.entities" will disappear.

However, after undeploying the jpa bundle, under nodes\localhost-domain1\in1\applications, sample.uas.entities directory still exists.

Generated at Thu May 28 09:22:24 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.