[JBoss Messaging] - Re: EJB 3 MDB and Messaging
by jaink
Apologize for the typo.
@ActivationConfigProperty(propertyName="destinationType", propertyValue="javax.jms.Topic"),
@ActivationConfigProperty(propertyName="destination", propertyValue="topic/testTopic")
Here is the stack trace again....
07:33:51,776 INFO [Ejb3Deployment] EJB3 deployment time took: 20
07:33:52,077 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=mdb-e
xample.ejb3,name=EJB3MDBExample,service=EJB3 with dependencies:
07:33:52,087 INFO [EJBContainer] STARTED EJB: org.jboss.example.jms.ejb3mdb.EJB
3MDBExample ejbName: EJB3MDBExample
07:33:52,117 INFO [EJB3Deployer] Deployed: file:/C:/jboss-4.0.4.GA/server/messa
ging/deploy/mdb-example.ejb3
07:33:52,117 WARN [MDB] JMS provider failure detected:
javax.jms.JMSException: Error creating the dlq connection: null
at org.jboss.ejb3.mdb.DLQHandler.createService(DLQHandler.java:153)
at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBean
Support.java:260)
at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:
188)
at org.jboss.ejb3.mdb.MDB.setupDLQ(MDB.java:791)
at org.jboss.ejb3.mdb.MDB.innerCreate(MDB.java:294)
at org.jboss.ejb3.mdb.MDB.innerStart(MDB.java:225)
at org.jboss.ejb3.mdb.MDB.start(MDB.java:214)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3973534#3973534
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3973534
19 years, 7 months
[EJB 3.0] - Lazy byte array gets loaded on query
by agnadello
Hello,
I'm trying to specify a property in my entity bean (called Appendix) as lazy loaded by the following annotations:
| @Lob
| @Basic(fetch = FetchType.LAZY)
| @Column(name = "DOCUMENT", nullable = true)
| public byte[] getDocument() {
| return this.document;
| }
|
What I want is that this property ISN'T loaded unless I access it within the scope of the entity manager. When I search for an Appendix entity bean in the database using a EJB-QL query like:
| // Create traffic type query
| final EntityManager theEntityManager = this.getEntityManager();
| final Query theTrafficTypeQuery = theEntityManager.createQuery("from Appendix a where a.trafficType = :trafficType");
| theTrafficTypeQuery.setParameter("trafficType", theTrafficType);
| final List<Appendix> theAppendixes = theTrafficTypeQuery.getResultList();
|
I can see in the JBoss log that the property "DOCUMENT" gets loaded anyway.
| select appendix0_.APPENDIX_ID as APPENDIX1_0_, appendix0_.START_DATE as START2_0_, appendix0_.DESCRIPTION as DESCRIPT3_0_, appendix0_.DOCUMENT as DOCUMENT0_, appendix0_.EXTENSION_ID as EXTENSION9_0_, appendix0_.CREATE_DATE as CREATE5_0_, appendix0_.PAGE_ID as PAGE6_0_, appendix0_.PRODUCT_ID as PRODUCT7_0_, appendix0_.STOP_DATE as STOP8_0_ from APPENDIX appendix0_ where appendix0_.PRODUCT_ID=?
|
Does anyone know how I get my byte array property lazy loaded?
If I understand it correct, loading lazy loaded entities should use the EntityManager method getReference(...), but in my case I load the entities using a query.
In the following Hibernate reference docs I've read something about instrumentation, is it really necessary?
http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#performanc....
I've really tried to search the forum but doesn't find anything useful.
I'm using JBoss 4.0.4 GA and EJB3.0RC6.
Regards, Andreas
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3973531#3973531
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3973531
19 years, 7 months
[Beginners Corner] - JBoss AS support for Java EE 5
by jusi
Hi
Standard apologies for the potential inappropriateness of asking this question here, plus my dubious grasp of the terminology. Anyway ...
I am in the process of outlining a technical solution for an enterprise system. The decision has been taken to base it on Java EE technology, and I am inclined towards using JBoss as the application server. However I have slight concerns about the fact that JBoss AS does not currently fully support Java EE 5, nor can I find any details of when it will. I appreciate that there are elements of JEE5 that are supported (EJB3 and Java Persistence API being two key examples that we intend to make full use of), but it would reassure me to know that a JEE5-compliant JBoss AS is on the horizon.
Any ideas as to whether this the case, or how I can find out?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3973529#3973529
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3973529
19 years, 7 months
[JBoss Seam] - Interpolated Log String Causes Exception During TestNG Execu
by lowecg2004
Hi,
I have the following log statement within a SFSB action.
log.debug("Attempting to registister account for user: #{user.id}; account: number '#0'; postcode '#1'; telephone = '#2'", originalRef, postcode, phoneNumber);
When the action is invoked from the main application the log statement works as expected. However, when I invoke the same action from a TestNG test I get the following exception:
Caused by: java.lang.IllegalArgumentException: can't parse argument number user.id
| at java.text.MessageFormat.makeFormat(MessageFormat.java:1330)
| at java.text.MessageFormat.applyPattern(MessageFormat.java:450)
| at java.text.MessageFormat.<init>(MessageFormat.java:368)
| at org.jboss.seam.core.Interpolator.interpolate(Interpolator.java:62)
| at org.jboss.seam.log.LogImpl.interpolate(LogImpl.java:162)
| at org.jboss.seam.log.LogImpl.info(LogImpl.java:98)
| at com.triggersoft.business.RegisterSubscriptionAction.findSubscription(RegisterSubscriptionAction.java:60)
| 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.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:121)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:110)
The test is defined as follows:
new Script() {
| RegisterSubscription registerSubscription;
|
| @Override
| protected void applyRequestValues() {
| // add request parameters required by the @LoggedIn interceptor.
| Contexts.getSessionContext().set("loggedIn", true);
|
| final UserDao userDao = (UserDao) Component.getInstance("userDao", true);
|
| assert userDao != null;
|
| final User user = userDao.findById(44);
|
| assert user != null;
|
| Contexts.getSessionContext().set("user", user);
| }
|
|
| @Override
| protected void updateModelValues() throws Exception
| {
| // configure the action component
| registerSubscription = (RegisterSubscription)
| Component.getInstance("registerSubscription", true);
|
| registerSubscription.setOriginalRef("1234567");
| registerSubscription.setPhoneNumber("01234 678900");
| registerSubscription.setPostcode("A12 BB1");
| }
|
| @Override
| protected void invokeApplication()
| {
| assert Contexts.getSessionContext().get("user") != null;
|
| final String outcome = registerSubscription.findSubscription();
|
| assert "registerSubscriptionComplete".equals(outcome);
|
| final Account confirmAccount =
| (Account) Component.getInstance("confirmAccount", true);
|
| assert confirmAccount != null;
| }
| }.run();
The action also has the user component injected which I have verified is non null when at the log line during a debug session.
What am I doing wrong?
Cheers,
Chris.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3973526#3973526
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3973526
19 years, 7 months