[Beginner's Corner] - Communication between AppServer and Client via multicast
by boltimuss
Hello forums, I am new to the forums and to JBOSS. I am trying to write an mBean that will communicate from within the AS across a multicast channel using JGroups. The code I'm using in my mBean is below...
| public void create() throws Exception {
| channel=new JChannel("test/udp.xml");
| channel.connect("ChatCluster");
| }
|
| public void sendMsg() throws ChannelNotConnectedException,
| ChannelClosedException {
| channel.send(new org.jgroups.Message(
| null,null, "hello from the server!"));
| }
|
I also created a client that is listening on the channel, but the two are not communicating .. Here is the XML for the channel ..
| <UDP
| mcast_port="45700"
| mcast_addr="224.0.0.11"
| tos="8"
| ucast_recv_buf_size="20000000"
| ucast_send_buf_size="640000"
| mcast_recv_buf_size="25000000"
| mcast_send_buf_size="640000"
| loopback="true"
| discard_incompatible_packets="true"
| max_bundle_size="64000"
| max_bundle_timeout="30"
| ip_ttl="${jgroups.udp.ip_ttl:32}"
| enable_bundling="true"
| enable_diagnostics="true"
| thread_naming_pattern="cl"
|
| thread_pool.enabled="true"
| thread_pool.min_threads="2"
| thread_pool.max_threads="8"
| thread_pool.keep_alive_time="5000"
| thread_pool.queue_enabled="true"
| thread_pool.queue_max_size="10000"
| thread_pool.rejection_policy="discard"
|
| oob_thread_pool.enabled="true"
| oob_thread_pool.min_threads="1"
| oob_thread_pool.max_threads="8"
| oob_thread_pool.keep_alive_time="5000"
| oob_thread_pool.queue_enabled="false"
| oob_thread_pool.queue_max_size="100"
| oob_thread_pool.rejection_policy="Run"/>
|
Any help would be greatly appreciated as I have spent some tie on this and am trying to figure this out. I would prefer to use some other echanism for communication, however I am limited to just using multicast ... long story..
Thanks!!!
~Bolt
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262742#4262742
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4262742
16 years, 6 months
[jBPM Users] - Re: [JBPM4 Error]Getting error while 2 tasks are created on
by nilspreusker
Sushant, try this:
JUnit Test Case:
package org.jbpm.examples.task.multiple1;
|
| import java.util.List;
|
| import org.jbpm.api.ProcessInstance;
| import org.jbpm.api.task.Task;
| import org.jbpm.test.JbpmTestCase;
|
| public class MultipleTasksTest1 extends JbpmTestCase {
|
| String deploymentId;
|
| protected void setUp() throws Exception {
| super.setUp();
|
| // deploy the process definition
| deploymentId = repositoryService.createDeployment()
| .addResourceFromClasspath(
| "org/jbpm/examples/task/multiple1/process.jpdl.xml")
| .deploy();
|
| // create actor
| identityService.createUser("johndoe", "John", "Doe", "john@doe");
| }
|
| protected void tearDown() throws Exception {
|
| }
|
| public void testMultipleTasks() {
| ProcessInstance processInstance = executionService
| .startProcessInstanceByKey("MultipleTasks");
|
| String processInstanceId = processInstance.getId();
|
| assertTrue(executionService.createProcessInstanceQuery()
| .processInstanceId(processInstanceId).uniqueResult().isActive(
| "task1"));
|
| List<Task> taskList = taskService.findPersonalTasks("johndoe");
| assertEquals(1, taskList.size());
| Task task = taskList.get(0);
| assertEquals("task1", task.getName());
| assertEquals("johndoe", task.getAssignee());
|
| // submit the task
| taskService.completeTask(task.getId(), "to task2");
|
| // verify that the next task is active and has been assigned to
| // 'johndoe'
| taskList = taskService.findPersonalTasks("johndoe");
| assertEquals(1, taskList.size());
| task = taskList.get(0);
| assertEquals("task2", task.getName());
| assertEquals("johndoe", task.getAssignee());
|
| // submit the task
| taskService.completeTask(task.getId(), "to task3");
|
| // verify that the next task is active and has been assigned to
| // 'johndoe'
| taskList = taskService.findPersonalTasks("johndoe");
| assertEquals(1, taskList.size());
| task = taskList.get(0);
| assertEquals("task3", task.getName());
| assertEquals("johndoe", task.getAssignee());
| }
|
| }
|
Process Definition (process.jpdl.xml):
<?xml version="1.0" encoding="UTF-8"?>
|
| <process name="MultipleTasks" xmlns="http://jbpm.org/4.0/jpdl">
| <start g="38,16,48,48" name="start1">
| <transition g="-48,-19" name="to task1" to="task1"/>
| </start>
| <task assignee="johndoe" g="16,96,92,52" name="task1">
| <transition g="-48,-19" name="to task2" to="task2"/>
| </task>
| <task assignee="johndoe" g="16,180,92,52" name="task2">
| <transition name="to task3" to="task3" g="-48,-19"/>
| </task>
| <task assignee="johndoe" name="task3" g="16,264,92,52"/>
|
| </process>
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262739#4262739
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4262739
16 years, 6 months
[Persistence] - Locking problem uses all connections in pool
by fabianignacio
Hi
We are using JBoss 4.2.3GA, EJB 3.0 (SessionBeans, EntityManager and EntityBeans) to an Oracle 10g.
We are having some issues with a concurrency scenario and the db connection pool. In a particular moment a persist or remove or merge or ejb query or native query locks a table or a row, and the other connection requests begings to been blocked, and therefore all connections in the pool are used and blocked until we getting java.sql.SQLException: Closed Connection for new requests.
We are not specifing any transaction isolation level, so we know that we are using Oracle's default READ COMMITTED, but for some reason we don't know, the locks are not been release and new requests are been blocked as well. We don't get any DEADLOCK exception, and we query the gv_$lock table to check the tables and queries, and every time is a different one. This happend no so often, but in a short time frame. If we kill the first lock in the database, the other ones are release. Some other times, we didn't need to kill the lock, it release the connection after several minutes and then the other requests execute normally, causing very ugly effects in our application.
The only thing that could be a clue on this, is maybe that something in our entity model relationship is making Oracle to lock the tables and rows. We have object with one-to-many, many-to-one and many-to-many relationships. But again, with READ COMMITTED should be an issue.
We though implementing the @Version annotation in the Entity model, but once again, it shouldn't be an issue because of the READ COMMITTED isolation level in the DB.
Any thought would be appreciate
Thanks a lot
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4262718#4262718
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4262718
16 years, 6 months