[Messaging, JMS & JBossMQ] - JMSQueueAppender
by vinodpol
I Have Used... JMSQueueAppender
import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.spi.LoggingEvent;
import org.apache.log4j.spi.ErrorHandler;
import org.apache.log4j.spi.ErrorCode;
import org.apache.log4j.helpers.LogLog;
import java.util.Hashtable;
import java.util.Properties;
import javax.jms.*;
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.naming.NameNotFoundException;
import javax.naming.NamingException;
/**
* A Simple JMS (P2P) Queue Appender.
*
* @author Ceki Gülcü
* @author Jamie Tsao
*/
public class JMSQueueAppender1 extends AppenderSkeleton {
protected QueueConnection queueConnection;
protected QueueSession queueSession;
protected QueueSender queueSender;
protected Queue queue;
String initialContextFactory;
String providerUrl;
String queueBindingName;
String queueConnectionFactoryBindingName;
public
JMSQueueAppender1() {
}
/**
* The InitialContextFactory option takes a string value.
* Its value, along with the ProviderUrl option will be used
* to get the InitialContext.
*/
public void setInitialContextFactory(String initialContextFactory) {
this.initialContextFactory = initialContextFactory;
}
/**
* Returns the value of the InitialContextFactory option.
*/
public String getInitialContextFactory() {
return initialContextFactory;
}
/**
* The ProviderUrl option takes a string value.
* Its value, along with the InitialContextFactory option will be used
* to get the InitialContext.
*/
public void setProviderUrl(String providerUrl) {
this.providerUrl = providerUrl;
}
/**
* Returns the value of the ProviderUrl option.
*/
public String getProviderUrl() {
return providerUrl;
}
/**
* The QueueConnectionFactoryBindingName option takes a
* string value. Its value will be used to lookup the appropriate
* QueueConnectionFactory from the JNDI context.
*/
public void setQueueConnectionFactoryBindingName(String queueConnectionFactoryBindingName) {
this.queueConnectionFactoryBindingName = queueConnectionFactoryBindingName;
}
/**
* Returns the value of the QueueConnectionFactoryBindingName option.
*/
public String getQueueConnectionFactoryBindingName() {
return queueConnectionFactoryBindingName;
}
/**
* The QueueBindingName option takes a
* string value. Its value will be used to lookup the appropriate
* destination Queue from the JNDI context.
*/
public void setQueueBindingName(String queueBindingName) {
this.queueBindingName = queueBindingName;
}
/**
Returns the value of the QueueBindingName option.
*/
public String getQueueBindingName() {
return queueBindingName;
}
/**
* Overriding this method to activate the options for this class
* i.e. Looking up the Connection factory ...
*/
public void activateOptions() {
QueueConnectionFactory queueConnectionFactory;
try {
Context ctx = getInitialContext();
queueConnectionFactory = (QueueConnectionFactory) ctx.lookup(queueConnectionFactoryBindingName);
queueConnection = queueConnectionFactory.createQueueConnection();
queueSession = queueConnection.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
Queue queue = (Queue) ctx.lookup(queueBindingName);
queueSender = queueSession.createSender(queue);
queueConnection.start();
ctx.close();
} catch(Exception e) {
errorHandler.error("Error while activating options for appender named ["+name+
"].", e, ErrorCode.GENERIC_FAILURE);
}
}
protected InitialContext getInitialContext() throws NamingException {
try {
Hashtable ht = new Hashtable();
//Populate property hashtable with data to retrieve the context.
ht.put(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory);
ht.put(Context.PROVIDER_URL, providerUrl);
return (new InitialContext(ht));
} catch (NamingException ne) {
LogLog.error("Could not get initial context with ["+initialContextFactory + "] and [" + providerUrl + "].");
throw ne;
}
}
protected boolean checkEntryConditions() {
String fail = null;
if(this.queueConnection == null) {
fail = "No QueueConnection";
} else if(this.queueSession == null) {
fail = "No QueueSession";
} else if(this.queueSender == null) {
fail = "No QueueSender";
}
if(fail != null) {
errorHandler.error(fail +" for JMSQueueAppender named ["+name+"].");
return false;
} else {
return true;
}
}
/**
* Close this JMSQueueAppender. Closing releases all resources used by the
* appender. A closed appender cannot be re-opened.
*/
public synchronized // avoid concurrent append and close operations
void close() {
if(this.closed)
return;
LogLog.debug("Closing appender ["+name+"].");
this.closed = true;
try {
if(queueSession != null)
queueSession.close();
if(queueConnection != null)
queueConnection.close();
} catch(Exception e) {
LogLog.error("Error while closing JMSQueueAppender ["+name+"].", e);
}
// Help garbage collection
queueSender = null;
queueSession = null;
queueConnection = null;
}
/**
* This method called by {@link AppenderSkeleton#doAppend} method to
* do most of the real appending work. The LoggingEvent will be
* be wrapped in an ObjectMessage to be put on the JMS queue.
*/
public void append(LoggingEvent event) {
if(!checkEntryConditions()) {
return;
}
try {
ObjectMessage msg = queueSession.createObjectMessage();
msg.setObject(event);
queueSender.send(msg);
} catch(Exception e) {
errorHandler.error("Could not send message in JMSQueueAppender ["+name+"].", e,
ErrorCode.GENERIC_FAILURE);
}
}
public boolean requiresLayout() {
return false;
}
}
in log4j.xml i have used...
appender name="JMS" class="JMSQueueAppender1"
param name="InitialContextFactory" value="org.jnp.interfaces.NamingContextFactory"
param name="ProviderUrl" value="jnp://localhost:1099"/
param name="QueueConnectionFactoryBindingName" value="QueueConnectionFactory"/
param name="QueueBindingName" value="queue/testQueue"
appender
it is giving error.....
log4j:ERROR Error while activating options for appender named [JMS].
javax.naming.CommunicationException: Could not obtain connection to any of these
urls: 10.10.10.252:1099 and discovery failed with error: javax.naming.Communica
tionException: Receive timed out [Root exception is java.net.SocketTimeoutExcept
ion: Receive timed out] [Root exception is javax.naming.CommunicationException:
Failed to connect to server 10.10.10.252:1099 [Root exception is javax.naming.Se
rviceUnavailableException: Failed to connect to server 10.10.10.252:1099 [Root e
xception is java.net.ConnectException: Connection refused: connect]]]
Can AnyBody Help me out.... Any help will be appreciated.....
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993084#3993084
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993084
19 years, 7 months
[JBoss jBPM] - Desicion; Bug?
by JimKnopf
My Desicion:
| <task-node name="inputFromXYZ">
| <task name="task1" swimlane="mrX">
| <controller>
| <variable name="myVar" access="read,write,required" mapped-name="myVar"></variable>
| </controller>
| </task>
| <transition name="" to="b"></transition>
| </task-node>
|
| <decision name="myDecision">
| <transition name="a" to="timer">
| <condition expression="#{contextInstance.variables.myVar eq 'n'}" />
| </transition>
| <transition name="b" to="xyz">
| <condition expression="#{contextInstance.variables.myVar eq 'y'}" />
| </transition>
| </decision>
|
This one is running fine. But only if mapped-name == name if they are different, the decision didn't work.
Is it my mistake or is it a Bug?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993077#3993077
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993077
19 years, 7 months
[JBossCache] - Re: JBoss PojoCache 2.0: Bug in CachedListImpl?
by chasta
Hi,
I've ran the test, and indeed it works in its current form - but not when using optimistic locking (e.g. subsistute 'local-service.xml' in 'replAsync-optimistic-service' in the setUp() method). Results of running unit tests from yesterday's CVS version:
| Before (using local-service.xml):
| [junit] Running org.jboss.cache.pojo.collection.CachedListTest
| [junit] Tests run: 9, Failures: 0, Errors: 0, Time elapsed: 15.437 sec
| [junit] Running org.jboss.cache.pojo.collection.CachedListTxTest
| ?
|
| After (using replAsync-optimistic-service.xml):
| [junit] Running org.jboss.cache.pojo.collection.CachedListTest
| [junit] Tests run: 9, Failures: 7, Errors: 0, Time elapsed: 43.203 sec
| [junit] Test org.jboss.cache.pojo.collection.CachedListTest FAILED
|
I think the problem is that the getChildren() call goes to an OptimisticTreeNode and not to a WorkspaceNode (though WorkspaceNodeImpl doesn't handle getChildren() at all?). The children are not taken from the workspace and so the check of the list size by using getChildren() does not work correctly in optimistic locking mode. Perhaps a simpler way for checking the size (w/o getting the children set) is possible.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993076#3993076
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993076
19 years, 7 months
[JBossWS] - Re: NullPointerException in WSDL11Reader
by NicoSchl
Hi Thomas,
This occurred with jbossws 1.0.0.GA shipped with JBoss 4.0.4.GA.
I have also tried upgrading to jbossws 1.0.4 GA, but the exception is still there.
| java.lang.NullPointerException
| at org.jboss.ws.metadata.wsdl.WSDL11Reader.processOperationInput(WSDL11Reader.java:487)
| at org.jboss.ws.metadata.wsdl.WSDL11Reader.processPortTypeOperations(WSDL11Reader.java:473)
| at org.jboss.ws.metadata.wsdl.WSDL11Reader.processPortType(WSDL11Reader.java:459)
| at org.jboss.ws.metadata.wsdl.WSDL11Reader.processBinding(WSDL11Reader.java:741)
| at org.jboss.ws.metadata.wsdl.WSDL11Reader.processPort(WSDL11Reader.java:1110)
| at org.jboss.ws.metadata.wsdl.WSDL11Reader.processPorts(WSDL11Reader.java:1093)
| at org.jboss.ws.metadata.wsdl.WSDL11Reader.processServices(WSDL11Reader.java:1066)
| at org.jboss.ws.metadata.wsdl.WSDL11Reader.processDefinition(WSDL11Reader.java:128)
| at org.jboss.ws.metadata.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:145)
| at org.jboss.ws.metadata.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:263)
| at org.jboss.ws.deployment.JSR109ServerMetaDataBuilder.buildMetaData(JSR109ServerMetaDataBuilder.java:90)
| at org.jboss.ws.deployment.ServiceEndpointDeployer.create(ServiceEndpointDeployer.java:85)
| at org.jboss.ws.integration.jboss.DeployerInterceptor.create(DeployerInterceptor.java:80)
| at org.jboss.ws.integration.jboss.DeployerInterceptorEJB.create(DeployerInterceptorEJB.java:44)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy42.create(Unknown Source)
| at org.jboss.deployment.MainDeployer.create(MainDeployer.java:953)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:807)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:771)
| at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy6.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
|
Nico
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993070#3993070
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993070
19 years, 7 months
[Beginners Corner] - Help me!!! ERROR [MainDeployer] Could not create deployment.
by vkokodyn
17:43:27,550 INFO [Server] Starting JBoss (MX MicroKernel)...
17:43:27,566 INFO [Server] Release ID: JBoss [Zion] 4.0.3SP1 (build: CVSTag=JBoss_4_0_3_SP1 date=200510231054)
17:43:27,566 INFO [Server] Home Dir: C:\JBoss\jboss-4.0.3SP1
17:43:27,566 INFO [Server] Home URL: file:/C:/JBoss/jboss-4.0.3SP1/
17:43:27,566 INFO [Server] Patch URL: null
17:43:27,566 INFO [Server] Server Name: default
17:43:27,566 INFO [Server] Server Home Dir: C:\JBoss\jboss-4.0.3SP1\server\default
17:43:27,566 INFO [Server] Server Home URL: file:/C:/JBoss/jboss-4.0.3SP1/server/default/
17:43:27,566 INFO [Server] Server Temp Dir: C:\JBoss\jboss-4.0.3SP1\server\default\tmp
17:43:27,566 INFO [Server] Root Deployment Filename: jboss-service.xml
17:43:28,050 INFO [ServerInfo] Java version: 1.5.0_02,Sun Microsystems Inc.
17:43:28,050 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.5.0_02-b09,Sun Microsystems Inc.
17:43:28,050 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
17:43:28,832 INFO [Server] Core system initialized
17:43:32,317 INFO [WebService] Using RMI server codebase: http://kleynod:8083/
17:43:32,379 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
17:43:32,895 INFO [NamingService] Started jndi bootstrap jnpPort=1099, rmiPort=1098, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
17:43:40,224 INFO [Embedded] Catalina naming disabled
17:43:41,193 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
17:43:41,208 INFO [Catalina] Initialization processed in 859 ms
17:43:41,208 INFO [StandardService] Starting service jboss.web
17:43:41,224 INFO [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.5
17:43:41,318 INFO [StandardHost] XML validation disabled
17:43:41,380 INFO [Catalina] Server startup in 172 ms
17:43:41,630 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=.../deploy/http-invoker.sar/invoker.war/
17:43:42,521 INFO [WebappLoader] Dual registration of jndi stream handler: factory already defined
17:43:43,474 INFO [TomcatDeployer] deploy, ctxPath=/ws4ee, warUrl=.../tmp/deploy/tmp43365jboss-ws4ee-exp.war/
17:43:43,787 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=.../deploy/jbossweb-tomcat55.sar/ROOT.war/
17:43:44,271 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=.../deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
17:43:48,709 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=.../deploy/management/console-mgr.sar/web-console.war/
17:43:51,147 INFO [MailService] Mail Service bound to java:/Mail
17:43:52,101 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-local-jdbc.rar
17:43:52,366 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-ha-xa-jdbc.rar
17:43:52,616 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-local-jdbc.rar
17:43:52,851 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jboss-xa-jdbc.rar
17:43:53,085 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/jms/jms-ra.rar
17:43:53,288 INFO [RARDeployment] Required license terms exist, view META-INF/ra.xml in .../deploy/mail-ra.rar
17:43:55,335 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'
17:43:55,867 INFO [A] Bound to JNDI name: queue/A
17:43:55,867 INFO [B] Bound to JNDI name: queue/B
17:43:55,882 INFO [C] Bound to JNDI name: queue/C
17:43:55,882 INFO [D] Bound to JNDI name: queue/D
17:43:55,882 INFO [ex] Bound to JNDI name: queue/ex
17:43:55,929 INFO [testTopic] Bound to JNDI name: topic/testTopic
17:43:55,945 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
17:43:55,945 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
17:43:55,945 INFO [testQueue] Bound to JNDI name: queue/testQueue
17:43:56,054 INFO [UILServerILService] JBossMQ UIL service available at : /0.0.0.0:8093
17:43:56,164 INFO [DLQ] Bound to JNDI name: queue/DLQ
17:43:56,601 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
17:43:56,820 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=MSSQLDS' to JNDI name 'java:MSSQLDS'
17:43:57,179 WARN [verifier] EJB spec violation:
Bean : Product
Method : public abstract ProductLocal create() throws CreateException
Section: 12.2.11
Warning: Each create(...) method in the entity bean's local home interface must have a matching ejbCreate(...) method in the entity bean's class.
17:43:57,179 ERROR [MainDeployer] Could not create deployment: file:/C:/JBoss/jboss-4.0.3SP1/server/default/deploy/EJBEntity.jar/
org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:575)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy24.create(Unknown Source)
at org.jboss.deployment.MainDeployer.create(MainDeployer.java:935)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:789)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy9.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:319)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:507)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:192)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:265)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:274)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:230)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:943)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:428)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:285)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:989)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:790)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:753)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:737)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:118)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:127)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:245)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:453)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:330)
at org.jboss.Main.boot(Main.java:187)
at org.jboss.Main$1.run(Main.java:438)
at java.lang.Thread.run(Thread.java:595)
17:43:57,242 INFO [TomcatDeployer] deploy, ctxPath=/HelloWeb, warUrl=.../tmp/deploy/tmp43420HelloWeb-exp.war/
17:43:57,586 INFO [TomcatDeployer] deploy, ctxPath=/SimpleWeb, warUrl=.../tmp/deploy/tmp43421SimpleWeb-exp.war/
17:43:57,883 INFO [TomcatDeployer] deploy, ctxPath=/WebClient, warUrl=.../tmp/deploy/tmp43422WebClient-exp.war/
17:43:58,164 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
17:43:58,429 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
--- Incompletely deployed packages ---
org.jboss.deployment.DeploymentInfo@86af42ea { url=file:/C:/JBoss/jboss-4.0.3SP1/server/default/deploy/EJBEntity.jar/ }
deployer: MBeanProxyExt[jboss.ejb:service=EJBDeployer]
status: Deployment FAILED reason: Verification of Enterprise Beans failed, see above for error messages.
state: FAILED
watch: file:/C:/JBoss/jboss-4.0.3SP1/server/default/deploy/EJBEntity.jar/META-INF/ejb-jar.xml
altDD: null
lastDeployed: 1164815036882
lastModified: 1164808456742
mbeans:
17:43:58,695 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
17:43:59,101 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
17:43:59,148 INFO [JkMain] Jk running ID=0 time=0/93 config=null
17:43:59,164 INFO [Server] JBoss (MX MicroKernel) [4.0.3SP1 (build: CVSTag=JBoss_4_0_3_SP1 date=200510231054)] Started in 31s:598ms
=========================EJB_JAR===============
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar >
<![CDATA[No Description.]]>
<display-name>Generated by XDoclet</display-name>
<enterprise-beans>
<!-- Session Beans -->
<!--
To add session beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called session-beans.xml that contains
the markup for those beans.
-->
<!-- Entity Beans -->
<![CDATA[Description for Product]]>
<display-name>Name for Product</display-name>
<ejb-name>Product</ejb-name>
com.beans.interfaces.ProductHome
com.beans.interfaces.Product
<local-home>com.beans.interfaces.ProductLocalHome</local-home>
com.beans.interfaces.ProductLocal
<ejb-class>com.beans.ejb.ProductBMP</ejb-class>
<persistence-type>Bean</persistence-type>
<prim-key-class>com.beans.interfaces.ProductPK</prim-key-class>
False
<!--
To add entity beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called entity-beans.xml that contains
the markup for those beans.
-->
<!-- Message Driven Beans -->
<!--
To add message driven beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called message-driven-beans.xml that contains
the <message-driven></message-driven> markup for those beans.
-->
</enterprise-beans>
<!-- Relationships -->
<!-- Assembly Descriptor -->
<!--
To specify your own assembly descriptor info here, add a file to your
XDoclet merge directory called assembly-descriptor.xml that contains
the <assembly-descriptor></assembly-descriptor> markup.
-->
<assembly-descriptor >
<!--
To specify additional security-role elements, add a file in the merge
directory called ejb-security-roles.xml that contains them.
-->
<!-- method permissions -->
<!--
To specify additional method-permission elements, add a file in the merge
directory called ejb-method-permissions.ent that contains them.
-->
<!-- finder permissions -->
<!-- transactions -->
<!--
To specify additional container-transaction elements, add a file in the merge
directory called ejb-container-transaction.ent that contains them.
-->
<!-- finder transactions -->
<!--
To specify an exclude-list element, add a file in the merge directory
called ejb-exclude-list.xml that contains it.
-->
</assembly-descriptor>
</ejb-jar>
==================JBOSS====================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss>
<enterprise-beans>
<!--
To add beans that you have deployment descriptor info for, add
a file to your XDoclet merge directory called jboss-beans.xml that contains
the , and <message-driven></message-driven>
markup for those beans.
-->
<ejb-name>Product</ejb-name>
<jndi-name>ejb/Product</jndi-name>
<local-jndi-name>ProductLocal</local-jndi-name>
<method-attributes>
</method-attributes>
</enterprise-beans>
<deployment-descriptor>
</deployment-descriptor>
<resource-managers>
</resource-managers>
<!--
| for container settings, you can merge in jboss-container.xml
| this can contain <invoker-proxy-bindings/> and <container-configurations/>
-->
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993067#3993067
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993067
19 years, 7 months
[EJB 3.0] - Re: EJB 3.0 String injection at deploying time?
by Marco.Pehla
So, finially it works. I've made a mistake and put the ejb-jar.xml file in the EAR archive instead of the JAR archive.
But I found out that it is much more easy to make a injection with the resource annotation.
inside the EJB3:
| ...
| @Resource(mappedName="java:comp/env/translationURL") private String translationURL;
| ...
| @WebMethod
| public doSomething() {
| System.out.println("injected String: " + translationURL);
| ...
| }//doSomething()
|
inside the ejb-jar.xml:
| ...
| <session>
| <ejb-name>YourClassName</ejb-name>
| <ejb-class>yourpackage.YourClassName</ejb-class>
| <env-entry>
| <env-entry-name>translationURL</env-entry-name>
| <env-entry-type>java.lang.String</env-entry-type>
| <env-entry-value>content of your String</env-entry-value>
| <injection-target>
| <injection-target-class>yourpackage.YourClassName</injection-target-class>
| <injection-target-name>translationURL</injection-target-name>
| </injection-target>
| </env-entry>
| </session>
| ...
|
That's all. Really simple.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993063#3993063
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993063
19 years, 7 months
[Persistence, JBoss/CMP, Hibernate, Database] - Inner Join
by ama55
Dear all:
I have 3 tables in the database (Companies, Departments and Extensions)
There is a One-Many relation between Companies and Extensions
a One-Many relation between Companies and Departments
and a One-Many relation between Departments and Extensions
I am trying to implement a seach function. this function will look for requested input in all the fields of the 3 tables and return the result as list. (ie. return a list of extensions and in this list a link to its departments and Companies).
i am trying 2 create an inner join between the extensions table and the other 2 tables, but that is not working it is returning an empty list.
when i create an inner join between the extensions table and one of the other 2 tables then a the query is returning the correct result
here is part of my code
| queryString.append (" select extension from Extensions extension");
| queryString.append (" inner join extension.companies as company");
| queryString.append (" inner join extension.departments as department");
| queryString.append (" where extension.fullname like :searchQuery");
| queryString.append (" or extension.extension like :searchQuery");
| parameters.put ("searchQuery", '%' + example.getFullname() + '%');
|
any idea how to solve that
Best Regards
ama55
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993050#3993050
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993050
19 years, 7 months
[EJB 3.0] - Entity name confusion
by xrcat
I have two different applications deployed on the same jboss4.0.4.GA server. Each application using its own persistence unit. Persistent units declared in persistent.xml (<persistence-unit name="app1">, <persistence-unit name="app2">). Both applications using ejb3 entity beans with same name. This name is very common (Event) and i have no possibility to refactor applications and rename beans. Jboss rises exception when applications deployed. Is it normal behavior?
| org.hibernate.AnnotationException: Use of the same entity name twice: Event
| at org.hibernate.cfg.annotations.EntityBinder.bindEntity(EntityBinder.java:221)
| at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:531)
| at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:452)
| at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:268)
| at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1039)
| at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1211)
| at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:154)
| at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:847)
| at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:385)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3993035#3993035
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3993035
19 years, 7 months