[JBoss ESB Development] New message: "Re: Smooks problem"
by Gilles Dupont Tagne Tagne
JBoss development,
A new message was posted in the thread "Smooks problem":
http://community.jboss.org/message/521035#521035
Author : Gilles Dupont Tagne Tagne
Profile : http://community.jboss.org/people/tagnegilles
Message:
--------------------------------------------------------------
Thanks Maurice for the advices. I changed the GillesSmooksAction.java
package de.gilles.projects.splitteresb;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import javax.naming.InitialContext;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;
import org.jboss.soa.esb.actions.AbstractActionLifecycle;
import org.jboss.soa.esb.actions.ActionLifecycleException;
import org.jboss.soa.esb.actions.ActionProcessingException;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;
import org.milyn.Smooks;
import org.milyn.container.ExecutionContext;
import org.milyn.event.report.HtmlReportGenerator;
import org.milyn.persistence.util.PersistenceUtil;
import org.milyn.scribe.adapter.jpa.EntityManagerRegister;
public class GillesSmooksAction extends AbstractActionLifecycle {
protected ConfigTree _configTree;
protected Smooks smooks = null;
protected EntityManagerFactory emf = null;
protected String smooksConfigFile = null;
public GillesSmooksAction(ConfigTree configTree){
_configTree = configTree;
}
public Message process(Message message) throws ActionProcessingException {
EntityManager em = null;
StreamResult result = new StreamResult(new ByteArrayOutputStream());
try {
em = emf.createEntityManager();
ExecutionContext executionContext = smooks.createExecutionContext();
executionContext.setEventListener(new HtmlReportGenerator("/Users/gilles/Desktop/report/reportjpa.html"));
PersistenceUtil.setDAORegister(executionContext, new EntityManagerRegister(em));
EntityTransaction tx = em.getTransaction();
tx.begin();
smooks.filterSource(executionContext, new StreamSource(new ByteArrayInputStream(((String)message.getBody().get()).getBytes())),result);
message.getBody().add(result.getOutputStream().toString());
tx.commit();
} catch (Exception e) {
e.printStackTrace();
throw new ActionProcessingException(e);
}
finally{
try {
if(em != null) em.close();
} catch (Exception e2) {}
result = null;
}
return message;
}
public void exceptionHandler(Message message, Throwable exception) {
logHeader();
System.out.println("!ERROR!");
System.out.println(exception.getMessage());
System.out.println("For Message: ");
System.out.println(message.getBody().get());
logFooter();
}
@Override
public void initialise() throws ActionLifecycleException {
super.initialise();
smooksConfigFile = _configTree.getAttribute("smooksConfig");
try {
if(smooksConfigFile == null){
throw new Exception("The Attribute with the name: 'smooksConfig' doesn't exist." );
}
InitialContext jndiContext = new InitialContext();
emf = (EntityManagerFactory) jndiContext.lookup("java:/personDbEntityManagerFactory");
smooks = new Smooks(smooksConfigFile);
} catch (Exception e) {
e.printStackTrace();
throw new ActionLifecycleException(e);
}
}
@Override
public void destroy() throws ActionLifecycleException {
super.destroy();
try {
if(emf != null) {emf.close(); emf = null;}
} catch (Exception e2) {
e2.printStackTrace();
throw new ActionLifecycleException(e2);
}
if(smooks != null) {smooks.close(); smooks = null;}
}
// This makes it easier to read on the console
private void logHeader() {
System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
}
private void logFooter() {
System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n");
}
}
I have forgotten to mention it. I was obliged to add the *milyn-scribe-core.1.2.4.jar* in the esb.deployer because jboss couldn't found the ObjectStore.class. But i think Tom has already created a Jira to solve the problem https://jira.jboss.org/jira/browse/JBESB-3121.
Do you think i will give the *reader.pool.size* the value 3?
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/521035#521035
16 years, 2 months
[JBoss Tools Development] Document updated/added: "DevStudioReleaseProcess"
by Max Andersen
JBoss development,
The document "DevStudioReleaseProcess", was updated Jan 20, 2010
by Max Andersen.
To view the document, visit:
http://community.jboss.org/docs/DOC-9570#cf
Document:
--------------------------------------------------------------
h3. JBoss Developer Studio and JBossTools Release Process
-
----
Prereqs for using this build
1. Install infozip
2. Have write access to download.jboss.org/jbosstools
3. Have file release permissions on sourceforge.net
-
----
1. Each component's repository must be tagged for release. Generally, we do a wide-sweeping tag for the entire jbosstools repository, while a few components (namely jBPM) have their own repositories and tags. You can easily tag a release by using the "make_tags.sh" script in releng's util directory.
TAG=jbosstools-2.1.2.GA BRANCH=branches/jbosstools-2.1.x ./make_tags.sh
0.1.
0.2. JBossIDE Core: IDE_CORE_RELEASENAME
0.3. JBossAOP Developer: IDE_AOP_DEVELOPER_RELEASENAME
0.4. EJB3 Tools: IDE_EJB3_TOOLS_RELEASENAME
0.5. Hibernate Tools: TOOLS_RELEASENAME
0.6. jBPM Designer: jbpm_gpd_releasename
2. After tagging is complete, an integration build is made on those tags.
3. Checkout the build system for JBossIDE
3.1. cvs co jbosside/releng/org.jboss.ide.eclipse.releng
5. From directory releng/org.jboss.ide.eclipse.releng execute the following:
5.1. ant -f customizeBuild.xml
7. This will launch a gui
7.1. Create temp dirs for the appropriate locations
7.2. You may need to execute 'ant -f customizeBuild.xml customize' to create a build.properties file.
9. Create a tags file, RELEASENAME.tag in the folder builders/product/versionTags
9.1. You can see an example tags file from the 1.5.1.GA release http://fisheye.jboss.com/viewrep/JBoss/jbosside/releng/org.jboss.ide.ecli...
9.2. You will need to know the sub version for each component.
9.3. The integration build is ran using this command in the builders directory of JBossIDE releng:
9.3.1. cd releng/org.jboss.ide.releng/builders
9.3.2. ./build-integration.sh product -tags tagsfile
9.3.3. See more info at the [JBossIDE Releng System
Docs|http://docs.jboss.com/jbosside/releng/user/build/en/html/index.html]
0.0.1. example: ./build-integration.sh product -tags product/versionTags/1.5.2.GA.tags
0.2. You will need to expand the eclipse-SDK which is downloaded into a an additional dir which you specify
0.3. Also, may need to modify global.properties updating as follows:
0.3.1. pdescriptdir=${clean.eclipse.home}/plugins/org.eclipse.pde.build_3.1.2/scripts
0.5. If the integration build breaks on compilation, the component lead responsible is notified and they re-tag their repository. We then re-initiate the integration build
2. Once the integration build is complete, each component lead is notified of the build and is responsible for doing any tests to their satisfaction on that build. (Note that this is usually outside the scope of unit tests).
2.1. If there are any fatal bugs / problems in the integration build, we give the responsible component leader time to fix those bugs, and re-start the process.
2.2. Once we receive the "thumbs-up" from all component leads, it's time to make a release build.
4. At this point, the tags file should be committed to Releng cvs.
5. If the release is "stable" (i.e. non beta/RC/etc) then you will run this command in the builders directory:
5.1. ./build-release.sh product stable RELEASENAME
7. Otherwise if the release is "development" (beta/RC/etc) then you will run this command:
7.1. ./build-release.sh product development RELEASENAME
9. The component leads are given a final chance to go over the release build before it will be published.
9.1. If there are any complaints, restart the process with the integration build
9.2. If all component leads give "thumbs-up", then it's time to upload and announce.
11. I first start by uploading all of the release files to sourceforge. Depending on the connection this can easily take a few hours. I have an ant script that automates this process for me that I've attached to this wiki. It's syntax is ./sf_upload.sh RELEASENAME (it probably needs to be changed to work on other systems)
12. While the files are uploading, I create the release in Sourceforge, and call it JBossIDE RELEASENAME.
13. I collect and enter the Changelog/ReleaseNotes from JIRA and various notes given to me from component leads.
14. After the files are done uploading, I add all of the appropriate files into the release, and describe them correctly using SF's interface (MD5 files get "Other", zips get ".zip", .tar.gz gets ".gz")
15. Now the only thing left to do is update the product download page and announce on the forums.
16. The "old" newest release is removed and replaced by the "new" newest release, including links to Sourceforge etc.
17. Release announcement is made on the JBossIDE http://jboss.com/index.html?module=bb&op=viewforum&f=201 and http://jboss.com/index.html?module=bb&op=viewforum&f=162. You can find an example announcement http://jboss.com/index.html?module=bb&op=viewtopic&t=78678
18. After the announcement is made, all of the people watching on Sourceforge are notified.
--------------------------------------------------------------
16 years, 2 months
[JBoss ESB Development] New message: "Re: Smooks problem"
by Maurice Zeijen
JBoss development,
A new message was posted in the thread "Smooks problem":
http://community.jboss.org/message/520978#520978
Author : Maurice Zeijen
Profile : http://community.jboss.org/people/mzeijen
Message:
--------------------------------------------------------------
Hi Gilles,
I am glad that you solved the problem and that there is no bug in the Smooks Persistence code .
*One important note:* I see in you code that you create a new Smooks instance for every message. This is a performance killer. You should make the Smooks a field of the GillesSmooksAction object and instantiate it in the '*http://www.jboss.org/jbossesb/docs/4.7/javadoc/esb/org/jboss/soa/esb/actions/AbstractActionLifecycle.html#initialise%28%29*' method. Then don't forget to close the Smooks object in the '*http://www.jboss.org/jbossesb/docs/4.7/javadoc/esb/org/jboss/soa/esb/actions/AbstractActionLifecycle.html#destroy%28%29*() ' method. The Smooks object is thread safe, however the ExecutionContext not. So the ExectionContext needs to be created in the 'process' method, but that is very cheap. For more tips to boost the performance of Smooks take a look here: http://www.smooks.org/mediawiki/index.php?title=V1.2:Smooks_v1.2_User_Gui.... If you process a lot of messages concurrently then you should certainly upgrade to the latest 1.2 version of Smooks and use the new feature to pool the reader instances. You need to create a pool with the same size as the number of threads that are used to execute the action.
Regards,
Maurice
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/520978#520978
16 years, 2 months