TDG Rafael Z.Frantz Committed to research! TDG Site Manager 1.1

Setup

########################################################################
> Softwares you need to install
########################################################################

  • Sun JDK 1.6, available here
  • GlassFish ESB 2.1, available here
  • Guaraná SDK API, available here 
  • Eclipse IDE, available here (optional)


########################################################################
> Enabling Log System
########################################################################

You must enable log in your Guaraná's solution. To do this, add a file named guarana-log-conf.xml with the following content:

<?xml version="1.0"?>
<config>
    <log>
        <params>
            <param name="file_name" value="guarana-dsl.log" />
            <param name="append" value="false" />
            <param name="suppress_console_output" value="true" />
            <param name="log_level" value="ALL" />
            <param name="output_format" value="SIMPLE" />
            <param name="subsystem" value="tdg.guarana" />
        </params>
    </log>
</config>



########################################################################
> Configure the JVM Security if you are going to use Decrypter/Encrypter tasks
########################################################################

Network permissions must be given to Guaraná's solution in order to enable solutions to work with RMI technology. Add the file client.policy to ../jre/lib/security. You can download it  here.


########################################################################
> Configuring Ports
########################################################################


1) Entry Port -> PASSIVE made ACTIVE with JBI Adapter:
------------------------------------------------------------------------------------------------------------------------------
SCENARIO: The In-Communicator is exported to the RMI Registry as a remote object. The JBI Adapter does a lookup and set messages by means of the pushRead() method at this communicator.


AT USER'S SOLUTION:

1) Add the following VM Arguments:
* -Xms32m
* -Xmx1024m
* -Djava.rmi.server.codebase=file:/c:/guarana-sdk-X.X.X.jar
* -Djava.security.policy=client.policy
* -Djava.rmi.server.hostname=localhost
* -Djava.rmi.server.disableHttp=true

2) Classpath libraries
* guarana-sdk-X.X.X.jar
  > commons-codec-1.4.jar
  > not-yet-commons-ssl-0.3.11.jar


AT 'EJB MODULE':

1) Classpath libraries
* guarana-sdk-X.X.X.jar


CREATING THE JBI BC ADAPTER:

1. In Composite Application project, create a new "WSDL Document"
2. In EJB Module project, create a new "Web Service from WSDL"
3. Make this WS extends "AbstractJbiEntryAdapter"
4. Implement the poll method in the WS. An example of implementation is shown below:

try {
    IStubIn stub = lookupCommunicator( "jndiName", "localhost", 0 );
    Message msg = new Message( PayloadFormat.STREAM );
    msg.getBody().setContent( payload.getBytes() );
    stub.pushRead( msg );
}catch ( Exception e ) { ...}




2) Exit Port -> PASSIVE only with RMI
------------------------------------------------------------------------------------------------------------------------------
SCENARIO: The Out-Communicator is exported to the RMI Registry as a remote object. Clients must call the fetch() method of this communicator to get outbound messages.


AT USER'S SOLUTION:

1) Add the following VM Arguments:
* -Xms32m
* -Xmx1024m
* -Djava.rmi.server.codebase=file:/c:/guarana-sdk-X.X.X.jar
* -Djava.security.policy=client.policy
* -Djava.rmi.server.hostname=localhost
* -Djava.rmi.server.disableHttp=true

2) Classpath libraries
* guarana-sdk-X.X.X.jar
  > commons-codec-1.4.jar
  > not-yet-commons-ssl-0.3.11.jar




3) Exit Port -> ACTIVE with JBI Adapter
------------------------------------------------------------------------------------------------------------------------------
SCENARIO: The Out-Communicator makes a lookup for the JBI Adapter (EJB) and sends outbound messages to it by means of the execute() method at the communicator and the write() method at the EJB. The JBI Adapter is responsable for invoking the specific JBI Binding Component, that, effectively, dispatch the outbound messages.

AT USER'S SOLUTION:

1) Add the following VM Arguments:
* -Xms32m
* -Xmx1024m

2) Classpath libraries
* appserv-rt.jar
  > appserv-ext.jar
  > appserv-deployment-client.jar
* guarana-sdk-X.X.X.jar
  > commons-codec-1.4.jar
  > not-yet-commons-ssl-0.3.11.jar
  > javaee.jar
    > jmxremote_optional.jar

AT 'EJB MODULE':

1) Classpath libraries
* guarana-sdk-X.X.X.jar


CREATING THE JBI BC ADAPTER:

1. In Composite Application project, create a new "WSDL Document"
2. In EJB Module project, create a new "Web Service Client"
3. In wizard, choose the WSDL file created at step 1
4. In EJB Module project, create a new remote stateless "Session Bean"
5. Make this bean implements "IExitAdapter"
6. Add the following annotation to this bean:

   @Remote({IExitAdapter.class})

7. Implements the folowing abstract method from IExitAdapter:
   
public void write(Message msg) throws AdapterException {...}

8. Add the following annotation to this bean:

@Stateless(name="THIS_BEAN_NAME",
           mappedName="ejb/THIS_BEAN_JNDI_NAME")

9. Inside overriden method write(Message msg), right click and select "Web Service Client Resource" -> "Call Web Service Operation"
10. In your EJB Module, select the write() operation for this exit adapter



4) Solicitor Port -> ACTIVE with JBI Adapter
------------------------------------------------------------------------------------------------------------------------------
SCENARIO: The OutIn-Communicator makes a lookup for the JBI Adapter (that is an EJB) and sends solicit messages to it by means of the execute() method at the communicator and the solicit() method at the JBI Adapter. The JBI Adapter is responsable for using the specific JBI BC or any other Web Service.


AT USER'S SOLUTION:

1) Add the following VM Arguments:
* -Xms32m
* -Xmx1024m
* -Djava.rmi.server.codebase=file:/c:/guarana-sdk-X.X.X.jar
* -Djava.security.policy=client.policy
* -Djava.rmi.server.hostname=localhost
* -Djava.rmi.server.disableHttp=true

2) Classpath libraries
* appserv-rt.jar
  > appserv-ext.jar
  > appserv-deployment-client.jar
* guarana-sdk-X.X.X.jar
  > commons-codec-1.4.jar
  > not-yet-commons-ssl-0.3.11.jar
  > javaee.jar
    > jmxremote_optional.jar


AT 'EJB MODULE':

2) Classpath libraries
* guarana-sdk-X.X.X.jar




5) Responder Port -> PASSIVE with SOAP JBI Adapter
------------------------------------------------------------------------------------------------------------------------------
SCENARIO: The InOut-Communicator is exported to the RMI Registry as a remote object. The SOAP JBI Adapter makes a lookup and call the pushRequest() method at the communicator to send inbound request messages.


AT USER'S SOLUTION:

1) Add the following VM Arguments:
* -Xms32m
* -Xmx1024m
* -Djava.rmi.server.codebase=file:/c:/guarana-sdk-X.X.X.jar
* -Djava.security.policy=client.policy
* -Djava.rmi.server.hostname=localhost
* -Djava.rmi.server.disableHttp=true

2) Classpath libraries
* guarana-sdk-X.X.X.jar
  > commons-codec-1.4.jar
  > not-yet-commons-ssl-0.3.11.jar
  > javaee.jar
    > jmxremote_optional.jar

AT 'EJB MODULE':

1) Classpath libraries
* guarana-sdk-X.X.X.jar


########################################################################
> Workaround to fix a Glassfish bug
########################################################################
 

This is a workaround to fix a bug in glassfish instalation related with domain name/address.

1) Edit file ../domains/domain1/config/sun-acc.xml

2) Locate: <target-server name="XXXX" address="XXXX" port="3700"/>

3) Change the contents of this file to:

  <target-server name="localhost" address="localhost" port="3700"/>

then restart the server!

BUG: http://bugs.sun.com/view_bug.do?bug_id=6614558