[JBoss Seam] - Re: JBoss scheduler (processor) problem on Tomcat...
by Stateless Bean
Instalation JDK 1.5.0_09 didn't helped.
I need to stay on Seam 1.2.1GA,
If this example seam pay works on tomcat I think this must be my problem.
Maybe I not installed somethink well. I tell u what I done when, moved my app from JBoss AS to Tomcat 5.5.
1. added components.properties,
2. changed components.xml to
| <?xml version="1.0" encoding="UTF-8"?>
| <components xmlns="http://jboss.com/products/seam/components"
| xmlns:core="http://jboss.com/products/seam/core"
| xmlns:security="http://jboss.com/products/seam/security"
| xmlns:drools="http://jboss.com/products/seam/drools"
| xmlns:web="http://jboss.com/products/seam/web"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation=
| "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.2.xsd
| http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.2.xsd
| http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.2.xsd
| http://jboss.com/products/seam/web http://jboss.com/products/seam/web-1.2.xsd
| http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-1.2.xsd">
|
| <core:init jndi-pattern="#{ejbName}/local" debug="true"/>
|
| <core:manager conversation-timeout="120000"
| concurrent-request-timeout="500"
| conversation-id-parameter="cid"
| conversation-is-long-running-parameter="clr"/>
|
| <core:transactionListener/>
|
| <core:ejb />
| <core:dispatcher/>
|
| <component name="org.jboss.seam.remoting.remoting">
| <property name="debug">false</property>
| <property name="pollTimeout">2</property>
| <property name="pollInterval">1</property>
| </component>
|
| <drools:rule-base name="securityRules">
| <drools:rule-files><value>/META-INF/security-rules.drl</value></drools:rule-files>
| </drools:rule-base>
|
| <security:identity authenticate-method="#{authenticator.authenticate}"/>
|
| <property name="persistenceUnitJndiName">java:/sguEntityManagerFactory</property>
| </component> -->
| <core:managed-persistence-context name="em"
| auto-create="true"
| persistence-unit-jndi-name="java:/sguEntityManagerFactory" />
|
| <factory name="remoteAddr" value="#{facesContext.externalContext.request.remoteAddr}" />
|
| <core:locale-selector cookie-enabled="true"/>
| </components>
3. changed jboss-beans.xml to like in booking example:
| <?xml version="1.0" encoding="UTF-8"?>
| <deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
| xmlns="urn:jboss:bean-deployer">
|
| <bean name="UniversumDatasourceBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
| <property name="driverClass">org.postgresql.Driver</property>
| <property name="connectionURL">jdbc:postgresql://localhost:5432/Universum</property>
| <property name="userName">postgres</property>
| <property name="password">root</property>
| <property name="jndiName">java:/UniversumDatasource</property>
| <property name="minSize">0</property>
| <property name="maxSize">10</property>
| <property name="blockingTimeout">1000</property>
| <property name="idleTimeout">100000</property>
| <property name="transactionManager"><inject bean="TransactionManager"/></property>
| <property name="cachedConnectionManager"><inject bean="CachedConnectionManager"/></property>
| <property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
| </bean>
|
| <bean name="UniversumDatasource" class="java.lang.Object">
| <constructor factoryMethod="getDatasource">
| <factory bean="UniversumDatasourceBootstrap"/>
| </constructor>
| </bean>
|
| </deployment>
4. and I added mc-conf.jar and also same libs like in booking example to war file.
Also files structure is same like in booking example.
Application now works fine, for me without this scheduler.
Scheduler processor and whole classes are same like in seam-pay example, I just copied them to my project and little changed.
| @Name("engineControler")
| public class EngineControler {
| public EngineControler() {}
|
| @In
| EngineProcessor processor;
|
and scheduler
| long interval = 2 * 1000;
| @SuppressWarnings("unused")
| Timer timer = processor.scheduleBuildings(new Date(), interval, null);
|
my method scheduleBuildings is empty, just System.out....
maybe I must install somethink else, I read about microcontainer, but don't know if this must be installed?
Any idea?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069992#4069992
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069992
17Â years, 3Â months
[EJB 3.0] - Re: JBoss and PostgreSQL 8.1
by fermat42
For sure I can. Sorry I copied only one of the ID Fields:
Server.java:
package de.douglas2a.components;
import java.io.Serializable;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.ManyToMany;
@Entity
@IdClass(ComponentPK.class)
public class Server implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Id
private Long sessionId;
private String hostname;
private String ip;
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public Long getSessionId() {
return sessionId;
}
public String getHostname() {
return hostname;
}
public void setHostname(String hostname) {
this.hostname = hostname;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public Server() {
}
public Server(Long sessionId) {
this.sessionId = sessionId;
}
@Override
public int hashCode() {
int hash = 0;
hash += (this.id != null ? this.id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Server)) {
return false;
}
Server other = (Server)object;
if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) return false;
return true;
}
@Override
public String toString() {
return "de.upb.vdrive.components.Server[id=" + id + "]";
}
}
ComponentPK.java:
package de.douglas2a.components;
public class ComponentPK implements java.io.Serializable {
private Long id;
private Long sessionId;
public ComponentPK() {
}
public ComponentPK(Long id, Long sessionId) {
this.id = id;
this.sessionId = sessionId;
}
public boolean equals(Object obj) {
if (obj == this) return true;
if (!(obj instanceof ComponentPK)) return false;
ComponentPK pk = (ComponentPK)obj;
if (!id.equals(pk.id)) return false;
if (!sessionId.equals(pk.sessionId)) return false;
return true;
}
public int hashCode( ) {
int id = this.id.intValue();
int sid = this.sessionId.intValue();
return id + Integer.reverse(sid);
}
}
If needed I can also post my config-files for configuring Postgre as Datasource...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069990#4069990
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069990
17Â years, 3Â months
[JBoss Messaging] - Can a bridge work fine with the remote source and local targ
by jsnhsu
I create two queues on two JBoss. I call the queue locates on the JBoss along with the bridge as local queue and which is the target queue. The other one on remote JBoss is the source queue. I want to pull the messages from remote to local. However, it's not working. There is no error message in the console. It seems that the bridge is just not working. If I create another queue on local to simulate the remote one. The bridge works fine. Please advice if I configured wrong or missed something.
This is the configuation of the bridge.
| <mbean code="org.jboss.jms.server.bridge.BridgeService"
| name="jboss.messaging:service=Bridge,name=Remote2LocalBridge"
| xmbean-dd="xmdesc/Bridge-xmbean.xml">
| <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider,server=remoteServer</depends>
| <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
| <!--<depends>jboss.messaging.destination:service=Queue,name=remoteQueue</depends>-->
| <depends>jboss.messaging.destination:service=Queue,name=localQueue</depends>
| <attribute name="SourceDestinationLookup">/queue/remoteQueue</attribute>
| <attribute name="TargetDestinationLookup">/queue/localQueue</attribute>
| <attribute name="SourceUsername">remoteUser</attribute>
| <attribute name="SourcePassword">remotePassword</attribute>
| <attribute name="TargetUsername">localUser</attribute>
| <attribute name="TargetPassword">localPassword</attribute>
|
This is the configuration in *.ds.xml:
| <connection-factories>
| <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
| name="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider,server=remoteServer">
| <attribute name="ProviderName">RemoteJMSProvider</attribute>
| <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
| <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
| <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
| <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
| <attribute name="Properties">
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
| java.naming.provider.url=remoteServer:1099
| </attribute>
| </mbean>
| </connection-factories>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4069978#4069978
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4069978
17Â years, 3Â months