RestComm / jain-slee

The World's #1 Open Source JAIN-SLEE (JSLEE) 1.1 Implementation
http://www.restcomm.com/
GNU Affero General Public License v3.0
25 stars 50 forks source link

[deployer] Migrate Deployer module into SLEE Container Extension #72

Closed SergeyLee closed 7 years ago

SergeyLee commented 8 years ago

For JSLEE 2.x (based on JBoss 5.1.0.GA) we have Deployer module for deploying SLEE applications. For JSLEE 3.0 (based on JBoss 7.x) we have Deployment Processors in SLEE extension. So we need to implement Deployer module code into Deployment Processors.

SergeyLee commented 8 years ago

August 1 tasks:

SergeyLee commented 8 years ago

Now we have some problems (deadlocks) with parsing DeploymentUnit.

In the JBoss 5 we have org.jboss.deployers.structure.spi.DeploymentUnit interface and in the JBoss 7 we have org.jboss.as.server.deployment.DeploymentUnit interface. These classes are considerably different and we need use DeploymentUnit for getting SLEEDeploymentMetaData (and SLEEDeployerEntityResolver).

Perhaps in the JBoss 7 we can use jboss-deployment-structure.xml for solving this problem, but we should parse deployable-unit.jar as it is in SLEE Spec: 3.4.6. Deployable unit jar file example.

Perhaps we don't need SLEEDeploymentMetaData (and SLEEDeployerEntityResolver) anymore.

Now I am investigating how to parse JBoss 7 DeploymentUnit (SleeDeploymentParseProcessor) for installing (SleeDeploymentInstallProcessor) its components (in my simple application it is only sbb jar).

SergeyLee commented 8 years ago

August 5, 8 and 9 tasks:

Now I have problem with ClassNotFoundException: javax.slee.ActivityEndEvent. Perhaps this problem is linked to next lines:

17:48:32,213 DEBUG [org.jboss.security](MSC service thread 1-7) PBOX000307: Constructing JBossPolicyConfiguration with contextID standard-components-du-3.0.0-SNAPSHOT.jar 17:48:32,214 DEBUG [org.jboss.as.security](MSC service thread 1-7) Cannot create permissions with 'null' metaData for id=standard-components-du-3.0.0-SNAPSHOT.jar

Tomorrow I will create some commits for jboss7-deployment branch.

SergeyLee commented 8 years ago

I found solution for last problem (ClassNotFoundException: javax.slee.ActivityEndEvent). I only add module "org.telestax.slee.container.lib" in dependencies for org.jboss.as.server in its module.xml.

SergeyLee commented 8 years ago

Next tasks:

Finishing first step:

Refactoring tasks

SergeyLee commented 8 years ago

I commented code related to AddressProfileSpec in parsing DU dependencies: https://github.com/RestComm/jain-slee/blob/master/container/components/components/src/main/java/org/mobicents/slee/container/component/deployment/jaxb/descriptors/SbbDescriptorImpl.java#L288 and code for creating AddressProfileSpec: https://github.com/RestComm/jain-slee/blob/master/container/components/components/src/main/java/org/mobicents/slee/container/component/deployment/jaxb/descriptors/SbbDescriptorImpl.java#L144-L176

But now I have problems with JNDI and I need to understand what was changed:

SergeyLee commented 8 years ago

Now I finished with last task on this issue: Uninstalling.

But I have a two questions:

I found simple solution: I only add module "org.telestax.slee.container.lib" in dependencies for org.jboss.as.server in its module.xml. We must find another solution.

17:48:32,213 DEBUG org.jboss.security PBOX000307: Constructing JBossPolicyConfiguration with contextID standard-components-du-3.0.0-SNAPSHOT.jar 17:48:32,214 DEBUG org.jboss.as.security Cannot create permissions with 'null' metaData for id=standard-components-du-3.0.0-SNAPSHOT.jar

After some JBoss (7.2.0.Final) debugging I found that JBoss try to get this metaData from EjbSecurityDeployer getMetaDataType: EjbDeploymentAttachmentKeys.JACC_PERMISSIONS.

This JACC_PERMISSIONS JBoss adds to attachments in EjbJaccConfigurator: here.

But this Configurator didn't execute. It must created by MethodPermissionsMergingProcessor: here.

I created ejb-jar.xml and jboss-ejb3.xml like this:

<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
         version="3.0">

  <assembly-descriptor>
    <security-role>
      <role-name>User</role-name>
    </security-role>
    <method-permission>
      <role-name>User</role-name>
      <method>
        <ejb-name>*</ejb-name>
        <method-name>*</method-name>
      </method>
    </method-permission>
  </assembly-descriptor>

</ejb-jar>
<?xml version="1.0" encoding="UTF-8"?>
<jboss:ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:jboss="http://www.jboss.com/xml/ns/javaee"               
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:s="urn:security:1.1"
    version="3.1"
    impl-version="2.0">

  <assembly-descriptor>
    <s:security>
      <ejb-name>*</ejb-name>
      <s:security-domain>slee-container</s:security-domain>
    </s:security>
  </assembly-descriptor>

</jboss:ejb-jar>
SergeyLee commented 8 years ago

Some comments on 'null' metaData for DUs problem. We can exclude EJB3 Subsystem from deploying for a single deployment: Exclude a Subsystem from a Deployment

<exclude-subsystems>
    <subsystem name="ejb3" />
</exclude-subsystems>
SergeyLee commented 8 years ago

I found new big task for Deployer:

SergeyLee commented 8 years ago

Today I finally found solution for installing default deployments (located in extension's resource folder "deployments" by default) from SleeContainerService. I added to default deployments standard-components DU.

Commit 28c62407f68ccdf01d87437d08997cbc909193c7.