[Tomcat, HTTPD, Servlets & JSP] - Migrate existing Tomcat-application - using session together
by tomka
Hello.
we want to migrate our existing tomcat bases web application to a JBoss architecture. In the first step of the migration process we want to use both systems together: new parts of the application should be integrated with JBoss, existing parts should be used from the old application.
I think it should work like this:
- We build a new web application with JBoss.
- We copy the war-file of the existing application to the tomcat and register the context.
- In the menu of the new application we integrate some links to the .jsp-files of the old application.
- Users log in at the JBoss web app.
- When a user click in the menu on one of the menuitems of the old application he does not have to login a second time - the tomcat session is the same for the JBoss web app and the new one.
- No data-exchange exept of user-handling has to be done between the two applications. Perhaps the old application can use some webservices from the JBoss
Does this scenario work?
Are there any integration-problems in general?
Thanks for answers, Tomka.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131143#4131143
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131143
18 years, 2 months
[JBossCache] - Viewing replication activity
by a045103
Greetings,
I am working with JBoss Cache as a second level hibernate cache, where Hibernate is used via Spring DAO support.
By virtue of Hibernate logging I can tell the cache is working as expected, and that data is being replicated. However, I have not been able to figure out the right log settings to view the replication activity via the logs.
Ideally, in a two JVM cluster, I'd like to see all activity related to replication in the logs (for my own edification) -- logging related to the 2 phase commit (for REPL_SYNC), logging related to data transfer, etc.
I can glean the fact data is being replicated by setting the serialization logging to debug, but I'm really after a higher level picture of the communication between the cluster members. When replication is occurring, for example, I don't see any indication of JGroups activity.
Here's my logging configuration (this is all running in the latest GA JBoss app server).
| <?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
|
|
| <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
|
|
| <!-- A time/date based rolling appender -->
| <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
| <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
| <param name="File" value="${jboss.server.log.dir}/server.log"/>
| <param name="Append" value="false"/>
|
| <!-- Rollover at midnight each day -->
| <param name="DatePattern" value="'.'yyyy-MM-dd"/>
|
| <layout class="org.apache.log4j.PatternLayout">
| <!-- The default pattern: Date Priority [Category] Message\n -->
| <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
|
| </layout>
| </appender>
|
| <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
| <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
| <param name="Target" value="System.out"/>
| <param name="Threshold" value="DEBUG"/>
|
| <layout class="org.apache.log4j.PatternLayout">
| <!-- The default pattern: Date Priority [Category] Message\n -->
| <!-- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/> -->
| <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
| </layout>
| </appender>
|
| <category name="org.hibernate">
| <priority value="DEBUG"/>
| </category>
|
| <category name="org.springframework">
| <priority value="DEBUG"/>
| </category>
|
| <category name="org.jgroups">
| <priority value="DEBUG"/>
| </category>
|
| <category name="org.jboss.cache">
| <priority value="DEBUG"/>
| </category>
|
| <category name="org.jboss.serial">
| <priority value="DEBUG"/>
| </category>
|
| <category name="test">
| <priority value="DEBUG"/>
| </category>
|
| <category name="org.jboss">
| <priority value="INFO"/>
| </category>
|
| <category name="com.arjuna">
| <priority value="INFO"/>
| </category>
|
| <category name="org.jnp">
| <priority value="INFO"/>
| </category>
|
| <!-- ================ -->
| <!-- Limit categories -->
| <!-- ================ -->
|
| <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
| <category name="org.apache">
| <priority value="INFO"/>
| </category>
|
| <!-- Limit the jacorb category to WARN as its INFO is verbose -->
| <category name="jacorb">
| <priority value="WARN"/>
| </category>
|
| <!-- Limit the org.quartz category to INFO as its DEBUG is verbose -->
| <category name="org.quartz">
| <priority value="INFO"/>
| </category>
|
| <!-- Limit the JSR77 categories -->
| <category name="org.jboss.management">
| <priority value="INFO"/>
| </category>
|
| <root>
| <appender-ref ref="CONSOLE"/>
| <appender-ref ref="FILE"/>
| </root>
|
| </log4j:configuration>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131140#4131140
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131140
18 years, 2 months
[JBoss jBPM] - Re: Token.signal() ---> 2 tokens?
by pojomonkey
"mputz" wrote : IMO, you shouldn't signal the root token once it has arrived in the fork:
|
|
| | Token root = processInstance.getRootToken();
| | // root token is already on the fork, signal children instead
| | // root.signal();
| |
OK, but how should the root token progress to the matching join? And what about the example I've given where on of the execuation paths forks again?
What is the logic to determine when I can signal which tokens? In my test - see below - from fork1, I would expect to be signalling token t20 - but when that arrives at fork2, should I cease signalling t20? Then how is it to join finally?
"mputz" wrote : I've found a (rejected) feature request to prevent the root token from being signaled on a fork node: http://jira.jboss.com/jira/browse/JBPM-642
I'll be reading that shortly...
It may explain why I can get the root token to the last state in the process when it's children haven't all joined yet. Seems to me that the join is operating like a discriminator..
| package forktest;
|
| import java.util.Map;
|
| import junit.framework.TestCase;
|
| import org.jbpm.JbpmConfiguration;
| import org.jbpm.JbpmContext;
| import org.jbpm.context.exe.ContextInstance;
| import org.jbpm.graph.def.Node;
| import org.jbpm.graph.def.ProcessDefinition;
| import org.jbpm.graph.exe.ProcessInstance;
| import org.jbpm.graph.exe.Token;
| import org.jbpm.persistence.db.DbPersistenceServiceFactory;
| import org.jbpm.svc.Services;
| import org.jbpm.taskmgmt.exe.TaskInstance;
|
| public class ForkUnitTest extends TestCase
| {
| /**
| * Some helpers
| */
| JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
| DbPersistenceServiceFactory dbPersistenceServiceFactory = (DbPersistenceServiceFactory) jbpmConfiguration.getServiceFactory(Services.SERVICENAME_PERSISTENCE);
|
| JbpmContext jbpmContext;
|
| private ProcessInstance processInstance;
|
| private long processInstanceId;
| private ContextInstance contextInstance;
| // private TaskMgmtInstance taskMgmtInstance;
|
| public ForkUnitTest()
| {
| }
|
| /**
| * Set up the basic in-memory DB, deploy the process description and
| * set up a jBPM context.
| * @see jBPM docs wrt jbpm configuration file
| */
| protected void setUp() throws Exception
| {
| super.setUp();
| dbPersistenceServiceFactory.createSchema();
| deployProcess();
| jbpmConfiguration.startJobExecutor();
| jbpmContext = jbpmConfiguration.createJbpmContext();
| }
|
| /**
| * Tidy up.
| */
| protected void tearDown() throws Exception
| {
| super.tearDown();
| jbpmContext.close();
| dbPersistenceServiceFactory.dropSchema();
| jbpmContext = null;
| }
|
| /**
| *
| */
| public void newTransaction()
| {
| jbpmContext.close();
| jbpmContext = jbpmConfiguration.createJbpmContext();
| processInstance = jbpmContext.loadProcessInstanceForUpdate(processInstanceId);
| // processInstanceId = processInstance.getId();
| }
|
| /**
| * Get the process description file, parse it and deploy the
| * process definition.
| */
| private void deployProcess()
| {
| JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
| try
| {
| ProcessDefinition processDefinition =
| ProcessDefinition.parseXmlResource("ForkProcess/processdefinition.xml");
| jbpmContext.deployProcessDefinition(processDefinition);
| } finally
| {
| jbpmContext.close();
| }
| }
|
| /**
| * Each subsequent test will need a new process instance
| * @return a TaskInstance, or null if there is no start task defined.
| */
| private TaskInstance createNewProcessInstance()
| {
| processInstance = jbpmContext.newProcessInstanceForUpdate("ForkTest");
| processInstanceId = processInstance.getId();
| contextInstance = processInstance.getContextInstance();
| // taskMgmtInstance = processInstance.getTaskMgmtInstance();
| return processInstance.getTaskMgmtInstance().createStartTaskInstance();
| }
|
| public void testFork()
| {
| TaskInstance taskInstance = createNewProcessInstance();
| contextInstance.setVariable("choice", "OptionB");
| assertEquals("startstate", processInstance.getRootToken().getNode().getName());
| processInstance.signal();
| jbpmContext.save(processInstance);
|
| newTransaction();
|
| assertEquals("optionb", processInstance.getRootToken().getNode().getName());
| processInstance.signal("ok");
| jbpmContext.save(processInstance);
|
| newTransaction();
|
| assertEquals("nextstate", processInstance.getRootToken().getNode().getName());
| processInstance.signal("ok");
| jbpmContext.save(processInstance);
|
| newTransaction();
|
| Token root = processInstance.getRootToken();
| root.signal();
|
| jbpmContext.save(processInstance);
|
| newTransaction();
|
| root = processInstance.getRootToken();
| Map map = root.getChildren();
| assertEquals(2, map.size());
|
| Token tk_t10 = (Token) map.get("t10");
| assertEquals("t10", tk_t10.getName());
|
| ProcessInstance pi = tk_t10.getProcessInstance();
| assertEquals(processInstanceId, pi.getId());
| Node node = tk_t10.getNode();
| assertEquals("track", node.getName());
| // tk_t10.signal("ok");
| jbpmContext.save(processInstance);
|
| newTransaction();
|
| root = processInstance.getRootToken();
| map = root.getChildren();
| assertEquals(2, map.size());
|
| tk_t10 = (Token) map.get("t10");
| assertEquals("t10", tk_t10.getName());
|
| Token tk_t20 = (Token) map.get("t20");
| assertEquals("t20", tk_t20.getName());
|
| pi = tk_t20.getProcessInstance();
| assertEquals(processInstanceId, pi.getId());
| node = tk_t20.getNode();
| assertEquals("proceed", node.getName());
| tk_t20.signal();
| node = tk_t20.getNode();
| assertEquals("fork2", node.getName());
|
| map = tk_t20.getChildren();
| assertEquals(2, map.size());
|
| assertEquals("track", processInstance.getRootToken().getNode().getName());
|
| node = tk_t10.getNode();
| assertEquals("track", node.getName());
| tk_t10.signal("ok");
| node = tk_t10.getNode();
| assertEquals("join2", node.getName());
| jbpmContext.save(processInstance);
|
| newTransaction();
|
| root = processInstance.getRootToken();
| root.signal();
| assertEquals("join2", processInstance.getRootToken().getNode().getName());
|
| root.signal();
| // FAILS on the next assert as root token is now on state 'complete'
| // but shouldn't be as token t20 is still at fork2!!!
| assertEquals("join2", processInstance.getRootToken().getNode().getName());
| }
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131138#4131138
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131138
18 years, 2 months
[Messaging, JMS & JBossMQ] - Problem deploying MDB
by cristi_cioriia
Hi,
I have tried to create a MDB to consume some messages posted to a message queue. The MDB looks like that:
| @MessageDriven(activationConfig = {@ActivationConfigProperty(propertyName= "destinationType", propertyValue="javax.jms.Queue")})
| public class AlertEmailSender implements MessageListener {
|
| @Override
| public void onMessage(Message message) {
| Logger log = Logger.getInstance(AlertEmailSender.class);
| //My code here...
| }
|
| }
|
I have also defined my own queue:
15:51:25,125 INFO [EmailQueue] Bound to JNDI name: queue/EmailQueue
| 15:51:25,140 INFO [A] Bound to JNDI name: queue/A
| 15:51:25,140 INFO [B] Bound to JNDI name: queue/B
| 15:51:25,140 INFO [C] Bound to JNDI name: queue/C
| 15:51:25,156 INFO [D] Bound to JNDI name: queue/D
| 15:51:25,156 INFO [ex] Bound to JNDI name: queue/ex
| 15:51:25,171 INFO [testTopic] Bound to JNDI name: topic/testTopic
| 15:51:25,171 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
| 15:51:25,203 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
| 15:51:25,218 INFO [testQueue] Bound to JNDI name: queue/testQueue
| 15:51:25,265 INFO [UILServerILService] JBossMQ UIL service available at : /127.0.0.1:8093
| 15:51:25,281 INFO [DLQ] Bound to JNDI name: queue/DLQ
| 15:51:25,390 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI
| name 'java:JmsXA'
Now, when I try to deploy my application into JBOSS I get the following exception:
| 15:51:35,390 WARN [ServiceController] Problem starting service jboss.j2ee:ear=wise-ear.ear,jar=wic-core.jar,name=AlertEmailSender,service=E
| JB3
| org.jboss.deployment.DeploymentException: Required config property RequiredConfigPropertyMetaData@b124fa[name=destination descriptions=[Desc
| riptionMetaData@195a626[language=pt]]] for messagingType 'javax.jms.MessageListener' not found in activation config [ActivationConfigPropert
| y(destinationType=javax.jms.Queue)] ra=jboss.jca:service=RARDeployment,name='jms-ra.rar'
| at org.jboss.resource.deployment.ActivationSpecFactory.createActivationSpec(ActivationSpecFactory.java:95)
I have googled for the exception, but didn't find much. The warning concerning this bean deployment is the only one that I get.Can u please point me what I am doing wrong? Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4131136#4131136
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4131136
18 years, 2 months