[EJB 3.0] - Unable to persist timer
by treespace
I added a timer service to a stateless EJB:
| private @Resource TimerService timer;
|
| public void startTimer()
| {
| timer.createTimer(1000, 1000, "clock");
| }
|
| @Timeout public void timeou(Timer timer)
| {
| logger.info("tick");
| }
|
This works wonderfully but there's a problem that ONLY appears when I'm running on Windows. I do not run in to this problem using the same app on OS X. I am using JBoss 4.0.4.GA. I get this error after killing and restarting JBoss a few times:
08:50:19,421 ERROR [TimerServiceImpl] Cannot create txtimer
java.lang.IllegalStateException: Unable to persist timer
at org.jboss.ejb.txtimer.DatabasePersistencePolicy.insertTimer(DatabasePersistencePolicy.java:126)
I am not given an opportunity to catch this exception (tried that) before it chokes so I cannot retry the create call. I resolve the problem by taking a clean copy of the default configuration and then redeploying my app.
Any suggestions appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961691#3961691
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961691
19 years, 8 months
[Beginners Corner] - JBoss 4.0.4, IDE 2.0, Eclipse 3.2 - cannot configure a serve
by jcurtin2ski
Hi all,
I'm trying to do an evaluation of JBoss as a lower cost option for our WAS servers. Today I downloaded JBoss 4.0.4 and used the Eclipse update site to download JBoss IDE 2.0 into my brand new Eclipse 3.2 IDE. I also downloaded org.eclipse.jst.server.jboss_1.0.0 which someone recommended but I still cannot get past the first step of configuring a server. I'm following these steps:
1. Open the 'Servers' tab in Eclipse
2. Right click, 'New', 'Server'. This brings up the 'Define a new server' dialog.
3. Click on JBoss/JBoss 4.0.x.
4. I get the error 'Missing classpath entry jboss-4.0.x\bin\run.jar
5. Set the App Server Directory and Classpath variables to 'C:\Program Files\jboss-4.0.4.GA\
6. New Error displayed = "C:\Program Files\jboss-4.0.4.GA\server\default\lib\javax.servlet.jar"
I know I'm missing something - but this is very frustrating. Does anyone have a clear set of instructions on how to integrate these 3 versions of each package?
Thanks in advance for the help!
John
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961688#3961688
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961688
19 years, 8 months
[JCA/JBoss] - Re: Can't connect to global namespace datasource from servle
by wmprice
The local java namespace is used for ApplicationComponents (ie Servlets, EJB's) residing in the same application server. It is known as the ENC (environment naming context).
anonymous wrote :
| - If it is local then can servlets on other servers access it?
|
No.Using a datasource outside of the local container is discouraged. It was put in place solely for TCK compatiblity. From the Wiki:
anonymous wrote :
| Note: JBoss does not recommend using this feature on a production environment. It requires accessing a connection pool remotely and this is an anti-pattern as connections are not serializable. Besides, transaction propagation is not supported and it could lead to connection leaks if the remote clients are unreliable (i.e crashes, network failure). If you do need to access a datasource remotely, JBoss recommends accessing it via a remote session bean facade.
|
anonymous wrote :
| What if it is a clustered environment?
|
Datasources are non-clusterable. Each datasource is particular to the node on which it resides.
anonymous wrote :
| - If that tag is present then I can access the DS using java:/jdbc/MySqlDS, not using java:/comp/env/jdbc/MySqlDS.
|
You could, but this would defeat the purpose of using an resource-ref. A resource-ref is a logical binding of a resource-ref name to an actual JNDI name. You could very well lookup the DataSource directly from JNDI, but if the JNDI name were to change, your code would have to change. The resource-ref shields you 'hard-coding' the JNDI name in your application.
This is the purpose of the java:comp/env namespace. Basically it's a read-only JNDI namespace reserved for application components to store references to J2EE resources.
anonymous wrote :
| - Are these the only files I need to modify to make the DS available?
|
Yes.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961686#3961686
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961686
19 years, 8 months
[JBossWS] - 1.0.2: client exception when receiving an array Long[]
by Juergen.Zimmermann
My webservice server transmits an array. The log looks ok:
2006-07-29 16:45:22,695 DEBUG org.jboss.ws.soap.SOAPContentElement - getXMLFragment from Object [xmlType={http://de.hska.ws/jaws}Long.Array,javaType=class [Ljava.lang.Long;]
| 2006-07-29 16:45:22,705 DEBUG org.jboss.ws.soap.SOAPContentElement - xmlFragment: <result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><ns_value:value xmlns:ns_value="http://de.hska.ws/jaws">1</ns_value:value><ns_value:value xmlns:ns_value="http://de.hska.ws/jaws">2</ns_value:value><ns_value:value xmlns:ns_value="http://de.hska.ws/jaws">3</ns_value:value></result>
|
However, the client throws the following exception. Any hint is appreciated!
2006-07-29 16:45:22,635 DEBUG org.jboss.ws.soap.SOAPContentElement - setObjectValue: Alpha
| 2006-07-29 16:45:22,645 DEBUG org.jboss.ws.soap.SOAPContentElement - getXMLFragment from Object [xmlType={http://www.w3.org/2001/XMLSchema}string,javaType=class java.lang.String]
| 2006-07-29 16:45:22,645 DEBUG org.jboss.ws.soap.SOAPContentElement - xmlFragment: <String_1>Alpha</String_1>
| 2006-07-29 16:45:22,715 DEBUG org.jboss.ws.soap.SOAPContentElement - setXMLFragment: <result xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><ns_value:value xmlns:ns_value='http://de.hska.ws/jaws'>1</ns_value:value><ns_value:value xmlns:ns_value='http://de.hska.ws/jaws'>2</ns_value:value><ns_value:value xmlns:ns_value='http://de.hska.ws/jaws'>3</ns_value:value></result>
| 2006-07-29 16:45:22,725 DEBUG org.jboss.ws.soap.SOAPContentElement - getObjectValue [xmlType={http://de.hska.ws/jaws}Long.Array,javaType=class [Ljava.lang.Long;]
| 2006-07-29 16:45:22,735 ERROR org.jboss.ws.jaxrpc.CallImpl - Call invocation failed with unkown Exception
| javax.xml.rpc.JAXRPCException: org.jboss.ws.binding.BindingException: org.jboss.ws.jaxb.UnmarshalException: Failed to parse source: {http://de.hska.ws/jaws}value not found as a child of result
| at org.jboss.ws.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:292)
| at org.jboss.ws.binding.EndpointInvocation.transformPayloadValue(EndpointInvocation.java:233)
| at org.jboss.ws.binding.EndpointInvocation.getReturnValue(EndpointInvocation.java:182)
| at org.jboss.ws.jaxrpc.CallImpl.syncOutputParams(CallImpl.java:873)
| at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:704)
| at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:404)
| at org.jboss.ws.jaxrpc.CallProxy.invoke(CallProxy.java:148)
| at $Proxy7.findIdsByNachname(Unknown Source)
| at de.hska.test.WebServicesTest.findIdsByNachname(Unknown Source)
| 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.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
| at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
| at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
| at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
| at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
| at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:71)
| at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
| at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
| at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
| at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
| at junit.framework.JUnit4TestAdapter.run(JUnit4TestAdapter.java:32)
| at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:361)
| at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:809)
| at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:670)
| Caused by: org.jboss.ws.binding.BindingException: org.jboss.ws.jaxb.UnmarshalException: Failed to parse source: {http://de.hska.ws/jaws}value not found as a child of result
| at org.jboss.ws.jaxrpc.encoding.JAXBDeserializer.deserialize(JAXBDeserializer.java:100)
| at org.jboss.ws.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:229)
| ... 26 more
| Caused by: org.jboss.ws.jaxb.UnmarshalException: Failed to parse source: {http://de.hska.ws/jaws}value not found as a child of result
| at org.jboss.ws.jaxb.JBossXBUnmarshallerImpl.unmarshal(JBossXBUnmarshallerImpl.java:67)
| at org.jboss.ws.jaxrpc.encoding.JAXBDeserializer.deserialize(JAXBDeserializer.java:92)
| ... 27 more
| Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: {http://de.hska.ws/jaws}value not found as a child of result
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:156)
| at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:126)
| at org.jboss.ws.jaxb.JBossXBUnmarshallerImpl.unmarshal(JBossXBUnmarshallerImpl.java:63)
| ... 28 more
| Caused by: org.jboss.xb.binding.JBossXBRuntimeException: {http://de.hska.ws/jaws}value not found as a child of result
| at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.startElement(SundayContentHandler.java:198)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.startElement(SaxJBossXBParser.java:301)
| at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
| at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
| at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
| at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
| at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:152)
| ... 30 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961685#3961685
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961685
19 years, 8 months
[JBoss Messaging] - Re: messaging flow control related question
by timfox
Raghu-
Thanks for your test program.
I have been experimenting with it, and here are my findings:
If CONSUMER_SLEEP_TIME and RELAYER_SLEEP_TIME are set to a small value e.g. 1000, then the entire test runs through successfully - this is because the messages are being relayed and consumed at approximately the same rate as they are being sent, so they do not build up in the topic subscriptions.
If CONSUMER_SLEEP_TIME and RELAYER_SLEEP_TIME are set to a large value e.g. 150000, then a great many messages get sent before they start being consumed. Since each message you are sending is about 100K in size, and (on my machine) about 3000 get sent before they start being consumed, this is too much to be stored in RAM at once in my JBoss4.0.4 installation since I am using -Xmx100M.
I therefore configured the paging parameters for the topic so a maximum of 200 messages would be stored in memory at once and the rest paged to storage:
<mbean code="org.jboss.jms.server.destination.Topic"
name="jboss.messaging.performance:service=Topic,name=raguTopic"
xmbean-dd="xmdesc/Topic-xmbean.xml">
<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer
200
10
10
With this config the test also completes successfully - albeit more slowly since it has the added overhead of reading and writing from the database. I am using MySQL 5.
Finally I tried increasing the amount of memory for the server to 1.2GB (-XMx1200M), this should allow all 10000 messages to be stored in memory without having to page to the db.
For this setup I also changed fullSize to 10000, so if more than 10000 messages arrive then we won't get an OutOfMemory error.
Again this test ran through fine.
After the tests have completed I am not seeing any messages or message references in the database, which is correct bahviour.
I can repeat the tests multiple times without seeing any significant change in memory on ther server.
I am using the HEAD codebase, which is what will be in RC4 when it is released in a few days. I have made many changes in compared to RC3 but not sure if they are responsible for seeing the difference in behaviour that you are seeing.
Probably your best bet is to upgrade to RC4 when it comes out and see if you still have your problems.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961680#3961680
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3961680
19 years, 8 months