Main

July 23, 2009

LiveCycle - Running an Additional JBoss 4.2 Instance on Same Server

In many customer situations, you might be required to run multiple, non-clustered JBoss instances on the same server. For example, TEST and DEV instances, or LiveCycle ES and BAM (Business Activity Monitor) instances.

To avoid port conflicts, you will have to change the ports for one of the JBosss instances. Here is a list of what you'd have to do if you are using the "all" configuration:

Please note : some of these recommended ports might conflict in your particular environment. In such cases, you might have to experiment until you get one that does not conflict. The JBoss server.log will tell you if there are any port conflicts. In Windows, you can use TCPView from Microsoft to inventory currently used ports. On Linux, you can use the netstat -an command.

%JBOSS_HOME%\server\all\deploy\jboss-web.deployer\server.xml (Tomcat)
Change HTTP Connector port from 8080 to 8090
Change redirectPort from 8443 to 8453
Change SSLConnector from 8443 to 8453
Change AJP Connector from 8009 to 8010

%JBOSS_HOME%\server\all\conf\jboss-service.xml
Change org.jboss.web.WebService port from 8083 to 8084
Change org.jboss.naming.NamingService Port from 1099 to 1200
Change org.jboss.naming.NamingService RmiPort from 1098 to 1201
Change org.jboss.invocation.jrmp.server.JRMPInvoker RMIObjectPort from 4444 to 4544
Change org.jboss.invocation.pooled.server.PooledInvoker ServerBindPort from 4445 to 4545
Change invoker serverBindPort from 4446 to 4546

%JBOSS_HOME%\server\all\conf\jacorb.properties
Change ORBInitRef.NameService=corbaloc::localhost:3528/JBoss/Naming/root from 3528 to 3529
Change OAPort from 3528 to 3529
Change OASSLPort from 3529 to 3530

%JBOSS_HOME%\server\all\deploy-hasingleton\jms\uil2-service.xml
Change org.jboss.mq.il.uil2.UILServerILService ServerBindPort from 8093 to 8094

%JBOSS_HOME%\server\all\deploy\ejb3.deployer\META-INF\jboss-service.xml
Change org.jboss.remoting.transport.Connector InvokerLocator port from 3873 to to 3973

%JBOSS_HOME%\server\all\deploy\snmp-adaptor.sar\META-INF\jboss-service.xml
Change org.jboss.jmx.adaptor.snmp.trapd.TrapdService Port from 1162 to 1164
Change org.jboss.jmx.adaptor.snmp.agent.SnmpAgentService Port from 1161 to 1163

%JBOSS_HOME%\bin\run.bat
Add a line to add a new property:
set JAVA_OPTS=%JAVA_OPTS% -Djboss.partition.name=partitionLCDev

%JBOSS_HOME%\server\all\deploy\cluster-service.xml (JBoss Cluster)
Add attribute ip_mcast="false"
Change num_initial_members from 3 to 1
Change org.jboss.ha.jndi.HANamingService port from 1100 to 1203
Change org.jboss.ha.jndi.HANamingService RmiPort from 1101 to 1204
Change AutoDiscoveryGroup port from 1102 to 1205
Change org.jboss.invocation.jrmp.server.JRMPInvokerHA RMIObjectPort from 4447 to 4547
Change org.jboss.invocation.pooled.server.PooledInvokerHA ServerBindPort from 4448 to 4548

%JBOSS_HOME%\server\all\deploy\ejb3-clustered-sfsbcache-service.xml (JBoss Stateful Sessions Beans [EJB] Cache)
Add attribute ip_mcast="false"
Change num_initial_members from 3 to 1

%JBOSS_HOME%\server\all\deploy\ejb3-entity-cache-service.xml (JBoss Entity Beans [EJB] Cache)
Add attribute ip_mcast="false"
Change num_initial_members from 3 to 1

%JBOSS_HOME%\server\all\deploy\jboss-web-cluster.sar\META-INF\jboss-services.xml (Tomcat Cluster)
Add attribute ip_mcast="false"
Change num_initial_members from 3 to 1

May 26, 2009

Ask the Experts - Thursday, May 28, 2009

Starting Thursday, May 28, 2009 at 9:00 a.m. Pacific / 12:00 p.m. Eastern we are starting a monthly series of eSeminars called "Ask the Experts".  Each month we will feature a new guest speaker with a new topic of interest for LiveCycle developers and architects. This month's featured speaker: Scott MacDonald on The Adobe LiveCycle SDK and Quick Starts.

For details on the events and to add them to your calendar, please go to http://asktheexperts.host.adobe.com/.


May 21, 2009

LiveCycle - Additional Configuration for a Stable WebSphere JDBC Connection Pool

For a long-running, stable configuration of the WebSphere JDBC Connection Pool for a database (DB2, Oracle, SQL Server 2005), there are additional configuration steps that can be performed.

1) Enable pre-testing of pooled connections
2) Enable pre-testing of existing pooled connections

In the WebSphere Admin Console, navigate to JDBC providers->[Your_JDBC_Provider_Name]->Data sources->[Your_JDBC_Data_Source_Name]->WebSphere Application Server data source properties.

Check the checkbox for "Pretest existing pooled connections"
Check the checkbox for Pretest new connections.

In the "Pretest SQL string" field, enter:
SELECT COUNT(*) FROM LCDB2.EDCVERSIONENTITY.
Replace "LCDB2" with the actual name of your schema.

Apply and save the changes.

Repeat this for all of LiveCycle's data sources (IDP_DS, EDC_DS, JMS_DS).

Re-start the WebSphere appserver instances that host LiveCycle.

March 28, 2009

Reducing Latent CPU Utilization by LiveCycle JBoss Turnkey

While running the LiveCycle ES JBoss Turnkey (Windows), you will notice that even when you are not doing anything with LiveCycle, the CPU utilization is still about 5-10% If you use Microsoft's Process Monitor and watch the JBossService.exe (or java.exe, for non-turnkey JBoss) process that hosts the JBoss instance, you will notice several operations that cause this. Here are some things you can do to manage this.

Disable the Watch Folder of the Digital Signatures Sample Orchestration
------------------------------------------------------------------------------------------
The watch folder is called ..\LCWatchFolder\Signatures\. In the LiveCycle AdminUI, navigate to Services->Applications and Services->Service Management. Filter on the category 'Samples - DigitalSignatures'. Click on 'VerifyDigitalSignatures: 1.0'. Click on the EndPoints tab. Check the checkbox against the 'WatchedFolder' provider and disable it.

The watch folder functionality of LiveCycle essentially works by frequently polling the input folder for any input documents. Login to the LiveCycle Admin UI and disable the watch folder, assuming you are not using it!

Watch folders are expensive but convenient. If you have too many watch folders configured, you run the risk of them overwhelming your CPUs even when there's no work for them!

Configure LiveCycle Document Sweeps to Happen Less Often
----------------------------------------------------------------------------
In DEV environments, in the LiveCycle AdminUI, navigate to Settings->Core System Settings->Configurations and set 'Document sweep interval' to 600 (10 minutes) from the default 30 seconds.

Disable JBossAS Application Auto-deploy Feature
------------------------------------------------------------
This feature also works by a polling mechanism. It is less expensive on the CPU front. This feature lets you just drag and drop a new application (WAR or EAR) into the \deploy folder of JBossAS and have it deployed and started automatically. This is a great feature in a development environment but should be turned off in production and test environments.

In %JBOSS_HOME%\server\all\conf\jboss-service.xml, set the attribute 'ScanEnabled' of the mbean 'org.jboss.deployment.scanner.URLDeploymentScanner' to false.

Increase the JBossAS Log4J ConfigurationURL RefreshPeriod
---------------------------------------------------------------------------
In %JBOSS_HOME%\server\all\conf\jboss-service.xml, set the attribute 'RefreshPeriod' of the mbean 'org.jboss.logging.Log4jService' to 600 (10 minutes) from the default 60 seconds.

February 25, 2009

Verifying LiveCycle Trial Downloads using MD5 Checksums

LiveCycle ES Update 1 can be downloaded on a trial basis from here (need a freely obtainable Adobe ID). The downloads are between 2 and 3.5 GB. Depending on your Internet bandwidth, you should expect to get a throughput of about 1 GB/hour from the Akamai download. Longer download times increase the risk of corrupt or incomplete downloads. To help you verify that the downloaded file is not corrupt, Adobe provides the MD5 (Message Digest algorithm version 5) checksums here (PDF).

It is a very good idea to verify the integrity of the downloaded file before running the install.

1) Login with your free Adobe ID
2) Agree to the EULA (End User License Agreement)
3) Choose the appropriate download option
4) Also download the checksum file

Once the download is complete, download an MD5 checksum generator such as md5deep
1) Run it against the downloaded LiveCycle zip file with the following command:
md5deep -ze C:\TEMP\JBoss_EFGJ_DVD.zip

You should get an output such as this:
2923744940 60da1ec0664f014aad93f9d99e94350c C:\TEMP\JBoss_EFGJ_DVD.zip

The middle number is the MD5 checksum (60da1ec0664f014aad93f9d99e94350c). Compare it against the value in the Adobe Checksum PDF file. If they match exactly, you have a downloaded file that is not corrupt.

md5deep usage instructions are available here. You can also use the following command to get the command line arguments:
md5deep -help

April 22, 2008

Easy Web Service Calls to LiveCycle from Flex 3

If you would like to facilitate accessing LiveCycle Web Services (or any for that matter) in Adobe Flex Builder 3, take a look at the Import Web Service function.

From within Flex click on the "Data" menu option and then select "Import Web Service". When the wizard starts you will be prompted for a folder where the Action Script is to be generated. Click on the folder of your choice and then select Next. Now enter the location of your WSDL. Under LiveCycle the default WSDL location is as follows: "http://yourservername:theport/soap/services/servicename?wsdl" (a great reason not to use spaces in your service names).

If your WebService is successfully reached you will then need to select the operation (invoke by default), your package name, and the main class name. If you have problems at this point make sure you can reach the WSDL by using your favorite browser.

If you are not sure where to start with the code that is generated, open the "yourservicenameServiceService.as". It describes the next steps and provides you with sample code.

Don't modify the code. When you make changes to your service on the server, select "Data", "Manage Web Services" and then simply click on the update button. This will prompt you to regenerate the code associated with the service (you will need to change your application yourself of course).

April 21, 2008

Class Conflicts

On occasion you may find yourself trying to include Java libraries within your custom components that may be more recent than those already available on the server. DOM4J is a good example.

In the case of DOM4J you will more than likely find this message in your log file: "Caused by: java.lang.NoClassDefFoundError: org/dom4j/xpath/DefaultXPath" which basically means that you're using DOM4J xPath functionality in your component that technical does not exist on the server.

Although the best practice would be to ensure your libraries and components are all using the same library versions you can get yourself out of a tough spot by using the JarJar tools to rename the packages within the class you would like to include in your component and deploy the renamed jar with your component to avoid the conflict.

You will find the tools and instructions here: http://code.google.com/p/jarjar/

In the case of DOM4J I used the following Ant build to rename both the jaxen and dom4j packages:

<?xml version="1.0" encoding="UTF-8"?>
<project name="Jar Jar Links" default="jar">
<target name="jar">
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="lib/jarjar-1.0rc7.jar"/>
<jarjar jarfile="dist/etechdom4j-1.6.1.jar">
<zipfileset src="lib/dom4j-1.6.1.jar"/>
<zipfileset src="lib/jaxen-1.1-beta-6.jar"/>
<rule pattern="org.dom4j.**" result="org.etech.dom4j.@1"/>
<rule pattern="org.jaxen.**" result="org.etech.jaxen.@1"/>
</jarjar>
</target>
</project>

 

Once the build has been run, you can return to your component code and change your import statements to reflect the new package names. Also be sure to include the new jar file in your build path.

A big thank you goes out to the Java Guru Venkata for pointing me to this one.

March 10, 2008

Simplifying the Turn-key Workspace URL

Providing a URL with paths, pages, and port numbers to an end user can sometimes be a challenge especially over the phone. Here's how to make your JBoss turn-key demo install a little easier to access.

* First and foremost, make sure you create backup copies of the files you are about to modify.
* Make sure you have no other HTTP servers running on port 80 (Start, Run, "cmd /k netstat" to see which ports are currently in use)
* Replace any occurrences of 8080 with 80 in the following files (assuming you installed in the default location)
** server.xml in C:\Adobe\LiveCycle8\jboss\server\default\deploy\jbossweb-tomcat55.sar
** jboss-service.xml in C:\Adobe\LiveCycle8\jboss\server\default\deploy\http-invoker.sar\META-INF

When your server is started, it will now start on the standard port 80 where it can be addressed using simply the URL of the machine hosting the service (http://yourserver/).

To make the home page route users from the default JBoss page over to workspace, change your index.html under C:\Adobe\LiveCycle8\jboss\server\all\deploy\jbossweb-tomcat55.sar\ROOT.war to the following:

<HTML>
<HEAD>
<TITLE>Redirecting to Adobe LiveCycle Workspace</TITLE>
<META HTTP-EQUIV="Refresh" CONTENT="0;URL=/workspace">
</HEAD>
<BODY>
</BODY>
</HTML>

December 13, 2007

Add, Inquiry, Modify, and Delete XML Nodes within the PDF

Instead of creating hidden fields inside a form, consider adding XML directly to the form itself. This sample shows how to add, inquiry, modify, and delete XML nodes within the PDF without requiring hidden fields.

December 10, 2007

"XMLData.parse" and Finding Nodes

One thing to keep in mind when parsing XML from a variable or a data node is that attributes are considered to be a node of the parent. So, child-elements will not necessarily start at (0) if the parent has an attribute. The attribute(s) will be considered before the children.

This sample demonstrates a few methods of retrieving XML data including the population of a drop-down from XML on the form. The data is provided in a text box and parsed using the XMLData.parse method so that you can change the data and watch the results in real-time.

November 29, 2007

& In Your XML

If you are moving XML element values to String variables and later hoping to put those variables into other XML documents you may find that the XML in your String is no longer a valid XML value. If you set the value of a String variable from an XML element such as "J &amp; J" the result will be "J & J". If you concatenate this variable into a string and then into an XML document using XPath your operation will fail.

Before moving variables into values that will be used in an XML document, be sure they are valid & free of special characters.

You'll need something a little more comprehensive, but here's a quick executeScript sample to rid your variables of '&':

String inString = patExecContext.getProcessDataStringValue("/process_data/@myString");
String outstring = inString.replace("&", "&amp;");
System.out.println("***** String: " + myString);
patExecContext.setProcessDataStringValue("/process_data/@myString", outstring);

Continue reading "& In Your XML" »