[JBoss/Spring Integration] - classpath problem: jboss-spring.xml + ejb module
by bucegiomu
Hi,
In an EAR, I have an EJB module containing an EJB facade and lots of classes below it and I would like to use InjectionInterceptor in the classes below the facade. Is there a way to have the ejb module recognized as both ejb and spring module? The point is that I do not want to refactor out all classes involved in this spring injection in a separate ".spring" module, but still I would like to use this spring deployer from Ales Justin. I tried to externalize only the jboss-spring.xml in a ".spring" jar declared in the application.xml (where the ejb module involved is also declared), but the spring is not seeing the classes in the ejb module:
| <module>
| <java>admin-ejb.spring</java>
| </module>
| <module>
| <ejb>admin-ejb.jar</ejb>
| </module>
|
Also I tried to rename the EJB module to have the ".spring" extension (and of course having updated the application xml like in the listing below) and keeping the jboss-spring.xml in the EJB module (instead of being in a separate jar), but in this case the EJB is not deployed anymore:
| <module>
| <ejb>admin-ejb.spring</ejb>
| </module>
|
Any ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4016259#4016259
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4016259
19Â years, 2Â months
[JBoss Seam] - Re: pagination control (10.3) missing transaction
by baz
Finally i have found the reason:
anonymous wrote : @Transactional
| @Override
| public Long getResultCount()
| {
| if (resultCount==null || isAnyParameterDirty())
| {
| org.hibernate.Query query = createCountQuery();
| resultCount = query==null ?
| null : (Integer) query.uniqueResult();
| }
| return resultCount.longValue();
| }
|
query.uniqueResult returns a Long value. If resultcount is changed to Long (instead of Integer) all is well.
For this i used the cvs version from yesterday. I had to disable page security for my tests. ( tag in pages.xml) Because of an, for me, unknown reason all access to my pages are forbidden.
So i cant't use this seam library for my app.:-( Waiting for a new release fixing my problem.
Ciao,
Carsten
BTW: i have reopened the corresponding JIRA issue
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4016258#4016258
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4016258
19Â years, 2Â months
[EJB 3.0] - LockModeType.WRITE NPE
by Uniman
We were investigating a problem in our application where we had a situation in which we needed LockModeType.WRITE - but we ran into troubles with it. Therefore I created a small test session and a simple entitybean with an id, name and description field.
We are using JBoss 4.0.5.GA as obtained through the forum.
Session bean code;
public void modThingy(Thingy thingy) {
| Thingy dbThingy = manager.find(Thingy.class, thingy.getId());
| dbThingy.setDescription(thingy.getDescription());
| manager.lock(dbThingy, LockModeType.READ);
| manager.persist(dbThingy);
| }
We can add and delete entitybeans through the session bean, but as soon as we try to use the modify method on the SB, which contains the write lock statement, we get the NPE.
Exception in thread "main" javax.ejb.EJBException: java.lang.NullPointerException
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
|
| ...
|
| Caused by: java.lang.NullPointerException
| at org.hibernate.persister.entity.AbstractEntityPersister.lock(AbstractEntityPersister.java:1290)
| at org.hibernate.event.def.AbstractLockUpgradeEventListener.upgradeLock(AbstractLockUpgradeEventListener.java:88)
| at org.hibernate.event.def.DefaultLockEventListener.onLock(DefaultLockEventListener.java:64)
| at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:584)
| at org.hibernate.impl.SessionImpl.lock(SessionImpl.java:576)
| at org.hibernate.ejb.AbstractEntityManagerImpl.lock(AbstractEntityManagerImpl.java:375)
| at org.jboss.ejb3.entity.TransactionScopedEntityManager.lock(TransactionScopedEntityManager.java:101)
I already found the following posts from half a year ago on this problem;
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3940780#3940780
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3961545#3961545
If I remove the manager.lock() statement, no exceptions are thrown. If I replace the LockModeType.WRITE with a LockModeType.READ - also no exceptions are thrown.
Is this still a known problem in JBoss 4.0.5.GA ?
If yes, is there any plan on resolving this issue ?
Are there alternatives for using LockModeType.WRITE ?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4016256#4016256
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4016256
19Â years, 2Â months
[JBoss Eclipse IDE (users)] - Polimorphism problem
by przemjaskier
Polimorphism problem
** Problem: I cannot customize content of a template, depending on a type of returned hibernate @Entity.
** Environment: MyFaces 1.1.4, Facelets 1.1.12, Seam 1.1.6, Hibernate 3.2.1.
** Situation:
I have three Hibernate entities:
1. Item - annotated with @Inheritance(strategy=InheritanceType.SINGLE_TABLE), @DiscriminatorColumn, @DiscriminatorValue, @Entity
public void getProperty();
isExtendedFlagSet(); //returning true only when this is instance of
//ExtendedItem below (I need such flags in
//general)
2. ExtendedItem extends Item - annotated with @DiscriminatorValue, @Entity
public void getExtendedProperty();
3. ItemHolder - annotated with @Entity
Item getItem();
And an EVENT scope backer:
currentItemProvider getting ItemHolder proxies/instances from Hibernate.
And two jsf+facelets templates, which I want to render different in case when ItemHolder.getItem()
returns instance if ExtendedItem than when it returns instance of Item.
** My (not working completely) solution:
Using custom, render-time-if component, which renders children when "currentItemProvider.itemholder.item.extendedFlagSet" is true,
enable fragment of page:
<h:outputText value="#{currentItemProvider.itemholder.item.property}"/>
<mycomp:renderTimeIf condition="#{currentItemProvider.itemholder.item.extendedFlagSet}">
<h:outputText value="#{currentItemProvider.itemholder.item.extendedProperty}"/>
</mycomp:renderTimeIf>
1. WORKS OK, when placed in a render-time loop of ui:repeat. Different item appear
on a page rendered according to their isExtendedFlagSet value
2. But DOESN'T work when put in compile-time ui:decorate or direct in a template. I get:
SEVERE: Error Rendering View[/itemDetails.xhtml]
javax.faces.el.PropertyNotFoundException: /WEB-INF/templates/itemtemplate.xhtml @18,132 value="#{currentItemProvider.itemholder.item.extendedProperty}":
Bean: package.Item$$EnhancerByCGLIB$$b215fa4e, property: extendedProperty
at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:58)
at javax.faces.component.UIOutput.getValue(UIOutput.java:77)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getStringValue(RendererUtils.java:217)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.renderOutput(HtmlTextRendererBase.java:69)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlTextRendererBase.encodeEnd(HtmlTextRendererBase.java:57)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
** Question: how to deal with such instance-dependent customization? I have a huge, complex domain (above is only a simplified illustration)
and would gladly stay with this consistent isFlasSet() approach, but if it should be done in a different way, please suggest.
Regards,
Przemek
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4016255#4016255
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4016255
19Â years, 2Â months
[JBoss jBPM] - JBPM 3.1.4 tutorial examples not working in JBPM 3.2b2?
by efip10
Hi,
I'm trying to run a proof-of-concept project using jBPM 3.2 beta2.
When running an (included in 3.1.4 but omitted from 3.2b2) HelloWorldDbTest, I get the following exception:
org.jbpm.JbpmException: no jbpm tx service configured
| at org.jbpm.persistence.db.DbPersistenceService.isRollbackOnly(DbPersistenceService.java:317)
| at org.jbpm.persistence.db.DbPersistenceService.endTransaction(DbPersistenceService.java:220)
| at org.jbpm.persistence.db.DbPersistenceService.close(DbPersistenceService.java:170)
| at org.jbpm.svc.Services.close(Services.java:222)
| at org.jbpm.JbpmContext.close(JbpmContext.java:139)
| at org.jbpm.tutorial.db.HelloWorldDbTest.deployProcessDefinition(HelloWorldDbTest.java:138)
| at org.jbpm.tutorial.db.HelloWorldDbTest.testSimplePersistence(HelloWorldDbTest.java:100)
I understand that transaction management has changed in 3.2b2, since the previous implementation of DbPersistenceService reads:
public void close() {
| if ( (session!=null)
| && (transaction==null)
| && (isRollbackOnly)
| ) {
and the new version reads:
public void close() {
| if ( (session!=null)
| && (transaction==null)
| && (isRollbackOnly())
| ) {
If there is something I should do to configure jbpm tx service? I can't find any description in the docs accompanying 3.2b2.
Thanks,
efi
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4016253#4016253
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4016253
19Â years, 2Â months