[JNDI and Naming] - JBoss 5.0.1 GA mail-service jndi
by Ale Ale
Ale Ale [https://community.jboss.org/people/armun] created the discussion
"JBoss 5.0.1 GA mail-service jndi"
To view the discussion, visit: https://community.jboss.org/message/777948#777948
--------------------------------------------------------------
Hi i want send a mail from localhost.
My mail-service.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: mail-service.xml 62350 2007-04-15 16:50:12Z mailto:dimitris@jboss.org dimitris(a)jboss.org $ -->
<server>
<!-- ==================================================================== -->
<!-- Mail Connection Factory -->
<!-- ==================================================================== -->
<mbean code="org.jboss.mail.MailService"
name="jboss:service=Mail">
<attribute name="JNDIName">java:/Mail</attribute>
<attribute name="User">nobody</attribute>
<attribute name="Password">password</attribute>
<attribute name="Configuration">
<!-- A test configuration -->
<configuration>
<!-- Change to your mail server prototocol -->
<property name="mail.store.protocol" value="pop3"/>
<property name="mail.transport.protocol" value="smtp"/>
<!-- Change to the user who will receive mail -->
<property name="mail.user" value="nobody"/>
<!-- Change to the mail server -->
<property name="mail.pop3.host" value="pop3.nosuchhost.nosuchdomain.com"/>
<!-- Change to the SMTP gateway server -->
<property name="mail.smtp.host" value="localhost"/>
<!-- The mail server port -->
<property name="mail.smtp.port" value="25"/>
<!-- Change to the address mail will be from -->
<property name="mail.from" value=" mailto:nobody@nosuchhost.nosuchdomain.com nobody(a)nosuchhost.nosuchdomain.com"/>
<!-- Enable debugging output from the javamail classes -->
<property name="mail.debug" value="false"/>
</configuration>
</attribute>
<depends>jboss:service=Naming</depends>
</mbean>
</server>
my java class using JNDI java:/Mail
package it;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.naming.InitialContext;
import com.sun.mail.smtp.SMTPTransport;
public class SendEmail {
public static void main(String args[]) throws Exception {
String host = "localhost";
String from = "test@localhost";
String to = " mailto:anemail@email.it anemail(a)email.it";
// Get system properties
Properties properties = System.getProperties();
// Setup mail server
properties.setProperty("mail.smtp.host", host);
InitialContext ctx = new InitialContext();
Session session = (Session) ctx.lookup("java:/Mail");
// Create a default MimeMessage object.
MimeMessage message = new MimeMessage(session);
// Set the RFC 822 "From" header field using the
// value of the InternetAddress.getLocalAddress method.
message.setFrom(new InternetAddress(from));
// Add the given addresses to the specified recipient type.
message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
// Set the "Subject" header field.
message.setSubject("hi..!");
// Sets the given String as this part's content,
// with a MIME type of "text/plain".
message.setText("Hi ......");
message.setContent ("<h1>Hello world</h1>", "text/html");
Transport.send(message);
System.out.println("Message Send.....");
}
}
the output :
Exception in thread "main" javax.naming.NamingException: Lookup failed for 'java:/Mail' in SerialContext [Root exception is javax.naming.NamingException: Invocation exception: Got null ComponentInvocation ]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:439)
at javax.naming.InitialContext.lookup(Unknown Source)
at it.SendEmail.main(SendEmail.java:69)
Caused by: javax.naming.NamingException: Invocation exception: Got null ComponentInvocation
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.getComponentId(GlassfishNamingManagerImpl.java:722)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:639)
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:150)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:425)
... 2 more
I think localhost port 25 is disabled.
If i start another server like "freeSMTP server" it sent mail.
I can configure mail-service.xml or enable port 25 at localhost?
i m only interested to send, not receive email. So i'm interested to SMTP not POP3.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/777948#777948]
Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years
[jBPM] - about task operation request timed out
by johennes fan
johennes fan [https://community.jboss.org/people/johennes] created the discussion
"about task operation request timed out"
To view the discussion, visit: https://community.jboss.org/message/777306#777306
--------------------------------------------------------------
I even don't know what is problem.
The stacktrace is like this:
ERROR - Tue Nov 20 11:15:20 CST 2012: Error when creating task on task server for work item id 176. Error reported by task server: Task operation request timed out
java.lang.RuntimeException: Task operation request timed out
at org.jbpm.task.service.SyncTaskServiceWrapper.addTask(SyncTaskServiceWrapper.java:118)
at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler.executeWorkItem(GenericHTWorkItemHandler.java:145)
at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.internalExecuteWorkItem(JPAWorkItemManager.java:55)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.internalTrigger(WorkItemNodeInstance.java:105)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.trigger(NodeInstanceImpl.java:124)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerNodeInstance(NodeInstanceImpl.java:205)
at org.jbpm.workflow.instance.impl.NodeInstanceImpl.triggerCompleted(NodeInstanceImpl.java:164)
at org.jbpm.workflow.instance.impl.ExtendedNodeInstanceImpl.triggerCompleted(ExtendedNodeInstanceImpl.java:47)
at org.jbpm.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(StateBasedNodeInstance.java:162)
at org.jbpm.workflow.instance.node.StateBasedNodeInstance.triggerCompleted(StateBasedNodeInstance.java:143)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.triggerCompleted(WorkItemNodeInstance.java:239)
at org.jbpm.workflow.instance.node.HumanTaskNodeInstance.triggerCompleted(HumanTaskNodeInstance.java:90)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.workItemCompleted(WorkItemNodeInstance.java:301)
at org.jbpm.workflow.instance.node.WorkItemNodeInstance.signalEvent(WorkItemNodeInstance.java:277)
at org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl.signalEvent(WorkflowProcessInstanceImpl.java:326)
at org.drools.persistence.jpa.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:121)
at org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:69)
at org.drools.command.runtime.process.CompleteWorkItemCommand.execute(CompleteWorkItemCommand.java:32)
at org.drools.command.impl.DefaultCommandService.execute(DefaultCommandService.java:36)
at org.drools.persistence.SingleSessionCommandService.execute(SingleSessionCommandService.java:367)
at org.drools.command.impl.CommandBasedStatefulKnowledgeSession$1.completeWorkItem(CommandBasedStatefulKnowledgeSession.java:150)
at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler.handleCompletedTask(GenericHTWorkItemHandler.java:221)
at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler$1.run(GenericHTWorkItemHandler.java:187)
at java.lang.Thread.run(Thread.java:722)
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/777306#777306]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years
[JBoss Messaging] - Re: Problem upgrading to JBoss Messaging from 1.4.3 to 1.4.5 in JBoss 5.1
by Nitesh Mehta
Nitesh Mehta [https://community.jboss.org/people/niteshmehta] created the discussion
"Re: Problem upgrading to JBoss Messaging from 1.4.3 to 1.4.5 in JBoss 5.1"
To view the discussion, visit: https://community.jboss.org/message/777523#777523
--------------------------------------------------------------
OK, I thing I got it.
Although Code of
org.jboss.jms.server.ServerPeer
class look almost similar
But when I compared /xmdesc/ServerPeer-xmbean.xml file I found that
<attribute access="read-write" getMethod="getSecurityStore" setMethod="setSecurityStore">
<description>The SecurityStore implementation for the server.</description>
<name>SecurityStore</name>
<type>org.jboss.jms.server.SecurityStore</type>
</attribute>
Does not exist in JBM 1.4.5
Whereas two new attributes
<attribute access="read-write" getMethod="getSecurityDomain" setMethod="setSecurityDomain">
<description>The Security Domain to be used by the Server Peer</description>
<name>SecurityDomain</name>
<type>java.lang.String</type>
</attribute>
<attribute access="read-write" getMethod="getDefaultSecurityConfig" setMethod="setDefaultSecurityConfig">
<description>The Security config to use when the destination does not supply any</description>
<name>DefaultSecurityConfig</name>
<type>org.w3c.dom.Element</type>
</attribute>
has been added. These two attributes (DefaultSecurityConfig, SecurityDomain ) was part of SecurityStore bean @see SecurityStore bean above.
I copied these two entries directly into ServerPeer mbean
Now myServerPeer mbean looks something like
<mbean code="org.jboss.jms.server.ServerPeer"
name="jboss.messaging:service=ServerPeer"
xmbean-dd="xmdesc/ServerPeer-xmbean.xml">
<!-- The unique id of the server peer - in a cluster each node MUST have a unique value - must be an integer -->
<attribute name="ServerPeerID">${jboss.messaging.ServerPeerID:0}</attribute>
<!-- The default JNDI context to use for queues when they are deployed without specifying one -->
<attribute name="DefaultQueueJNDIContext">/queue</attribute>
<!-- The default JNDI context to use for topics when they are deployed without specifying one -->
<attribute name="DefaultTopicJNDIContext">/topic</attribute>
<attribute name="PostOffice">jboss.messaging:service=PostOffice</attribute>
<!-- The default Dead Letter Queue (DLQ) to use for destinations.
This can be overridden on a per destinatin basis -->
<attribute name="DefaultDLQ">jboss.messaging.destination:service=Queue,name=DLQ</attribute>
<!-- The default maximum number of times to attempt delivery of a message before sending to the DLQ (if configured).
This can be overridden on a per destinatin basis -->
<attribute name="DefaultMaxDeliveryAttempts">10</attribute>
<!-- The default Expiry Queue to use for destinations. This can be overridden on a per destinatin basis -->
<attribute name="DefaultExpiryQueue">jboss.messaging.destination:service=Queue,name=ExpiryQueue</attribute>
<!-- The default redelivery delay to impose. This can be overridden on a per destination basis -->
<attribute name="DefaultRedeliveryDelay">10000</attribute>
<!-- The periodicity of the message counter manager enquiring on queues for statistics -->
<attribute name="MessageCounterSamplePeriod">5000</attribute>
<!-- The maximum amount of time for a client to wait for failover to start on the server side after
it has detected failure -->
<attribute name="FailoverStartTimeout">60000</attribute>
<!-- The maximum amount of time for a client to wait for failover to complete on the server side after
it has detected failure -->
<attribute name="FailoverCompleteTimeout">300000</attribute>
<attribute name="StrictTck">false</attribute>
<!-- The maximum number of days results to maintain in the message counter history -->
<attribute name="DefaultMessageCounterHistoryDayLimit">-1</attribute>
<!-- The name of the connection factory to use for creating connections between nodes to pull messages -->
<attribute name="ClusterPullConnectionFactoryName">jboss.messaging.connectionfactory:service=ClusterPullConnectionFactory</attribute>
<!-- When redistributing messages in the cluster. Do we need to preserve the order of messages received
by a particular consumer from a particular producer? -->
<attribute name="DefaultPreserveOrdering">false</attribute>
<!-- Max. time to hold previously delivered messages back waiting for clients to reconnect after failover -->
<attribute name="RecoverDeliveriesTimeout">300000</attribute>
<!-- Set to true to enable message counters that can be viewed via JMX -->
<attribute name="EnableMessageCounters">false</attribute>
<attribute name="SuckerPassword">${queues.database.password}</attribute>
<attribute name="SecurityDomain">messaging</attribute>
<attribute name="DefaultSecurityConfig">
<![CDATA[
<security>
<role name="guest" read="true" write="true" create="true"/>
</security>
]]>
</attribute>
<!-- The name of the server aspects configuration resource
<attribute name="ServerAopConfig">aop/jboss-aop-messaging-server.xml</attribute>
-->
<!-- The name of the client aspects configuration resource
<attribute name="ClientAopConfig">aop/jboss-aop-messaging-client.xml</attribute>
-->
<depends optional-attribute-name="PersistenceManager">jboss.messaging:service=PersistenceManager</depends>
<depends optional-attribute-name="JMSUserManager">jboss.messaging:service=JMSUserManager</depends>
<depends>jboss.messaging:service=Connector,transport=bisocket</depends>
<depends>jboss.messaging:service=SecurityStore</depends>
</mbean>
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/777523#777523]
Start a new discussion in JBoss Messaging at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years
[jBPM] - JBPM 5.3 many process instance in jbpm-console
by franco80
franco80 [https://community.jboss.org/people/franco80] created the discussion
"JBPM 5.3 many process instance in jbpm-console"
To view the discussion, visit: https://community.jboss.org/message/776713#776713
--------------------------------------------------------------
Hello
when process is creating a see in jbpm-console many instance with the same id and when I click on one of them I recived:
16:29:55,126 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/gwt-console-server].[Resteasy]] (http-localhost-127.0.0.1-8080-5) Servlet.service() for servlet Resteasy threw exception: org.jboss.resteasy.spi.UnhandledException: javax.persistence.NonUniqueResultException: result returns more than one elements
my code is :
ut = (UserTransaction) new InitialContext()
.lookup("java:comp/UserTransaction");
ut.begin();
StatefulKnowledgeSession session = JbpmAPIUtil.getSession();
JPAWorkingMemoryDbLogger logger = new JPAWorkingMemoryDbLogger(session);
Map<String, Object> paramsOut = new HashMap<String, Object>();
paramsOut.put(EProcessParams.USER_ID.getValue(), ...);
ProcessInstance pi = session.startProcess(
EProcessParams.PROCESS_ID.getValue(), paramsOut);
Thread.sleep(3000);
TaskSummary task = JbpmAPIUtil.startTask(pi.getId(), user,
Egroup);
Map<String, Object> params = new HashMap<String, Object>();
...
JbpmAPIUtil.completeTask(pi.getId(), task.getId(), user,
group, nextUser,
nextGroup, params);
ut.commit();
logger.dispose();
why may be couse ?
regards
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/776713#776713]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years