[EJB 3.0] - Re: TopLink with Jboss 4.2.1 not working?
by mfobrien
Hi,
The following workaround has been checked in for EclipseLink M8 to work with JBoss 4.2.2 GA.
Container managed entities should predeploy/deploy and register now with/without static weaving.
When the UCL3 classLoader no longer causes a NPE (See JIRA http://jira.jboss.com/jira/browse/EJBTHREE-572 ) we will reenable dynamic weaving on EAR predeploy().
http://bugs.eclipse.org/229634
Workaround:
---------------------------------
EclipseLink will use the non-temporary classLoader instead of the one from getNewTempClassLoader() obtained from the JBoss PersistenceUnitInfo that throws a NPE on loadClass() or Class.forName().
We require that JBoss implementers statically weave container managed entities and reference JBoss as the target-server in persistence.xml.
Deployment Changes:
1) If weaving is required then static weave the entities before EAR packaging using either the command-line weaver or the weaving ant task.
2) All persistence units deployed to the JBoss container must contain the following property in persistence.xml or container managed entities will predeploy but fail to be managed at runtime.
JBoss AS 4.2.2 GA debugging:
----------------------------------------------------------
I debugged the UCL3 NullPointerException into the JBoss AS 4.2.2 GA source into the following segment of code.
In the following function the classloader parent tree is searched all the way to the root.
no clazz is returned and in the finally clause the last log.trace causes a RuntimeException on a NPE.
Curious though that the line number in Logger.trace() does not correspond to the JDK 1.5 src.
package org.jboss.mx.loading
public abstract class RepositoryClassLoader extends URLClassLoader
public Class loadClass(String name, boolean resolve)
throws ClassNotFoundException
...
finally
...
--->NPE log.trace("loadClass " + this + " name=" + name + " not found");
}
}
}
Thread [main] (Suspended)
UnifiedClassLoader3(RepositoryClassLoader).loadClass(String, boolean) line: 425
UnifiedClassLoader3(ClassLoader).loadClass(String) line: 251
UnifiedClassLoader3(ClassLoader).loadClassInternal(String) line: 319
Class.forName0(String, boolean, ClassLoader) line: not available [native method]
Class.forName(String, boolean, ClassLoader) line: 242
PrivilegedAccessHelper.getClassForName(String, boolean, ClassLoader) line: 85
XMLEntityMappings.getClassForName(String, ClassLoader) line: 120
XMLEntityMappings.getClassForName(String) line: 157
XMLEntityMappings.initPersistenceUnitClasses() line: 389
MetadataProcessor.initPersistenceUnitClasses() line: 188
MetadataProcessor.processEntityMappings() line: 298
Results:
--------
15:41:43,772 INFO [STDOUT] [EPS Warning]: 2008.05.02 15:41:43.755--Thread(Thread[main,5,jboss])--The temporary classLoader for PersistenceLoadProcessor [helloworld] is not available. Switching classLoader to [org.jboss.mx.loading.UnifiedClassLoader3@18b995c{ url=file:/C:/opt/jboss422/server/default/tmp/deploy/tmp13465jsfejb3.ear ,addedOrder=45}]. Weaving has been disabled for this session. EclipseLink may be unable to get a spec mandated temporary class loader from the server, you may be able to use static weaving as an optional workaround.
15:41:44,221 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=jsfejb3.ear,jar=app.jar,name=TodoDao,service=EJB3 with dependencies:
15:41:44,221 INFO [JmxKernelAbstraction] persistence.units:ear=jsfejb3.ear,jar=app.jar,unitName=helloworld
15:41:44,359 INFO [EJBContainer] STARTED EJB: TodoDao ejbName: TodoDao
15:42:45,344 INFO [STDOUT] [EPS Finer]: 2008.05.02 15:42:45.343--UnitOfWork(20862427)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--TX binding to tx mgr, status=STATUS_ACTIVE
15:42:45,344 INFO [STDOUT] [EPS Finest]: 2008.05.02 15:42:45.344--UnitOfWork(20862427)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--Execute query DoesExistQuery()
15:42:45,350 INFO [STDOUT] [EPS Finest]: 2008.05.02 15:42:45.350--UnitOfWork(20862427)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--PERSIST operation called on: Todo@15914f3.
thank you
/michael
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4148555#4148555
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4148555
16 years, 4 months
[Persistence, JBoss/CMP, Hibernate, Database] - Re: PersistenceUnitInfo
by mfobrien
Hi,
The following workaround has been checked in for EclipseLink M8 to work with JBoss 4.2.2 GA.
Container managed entities should predeploy/deploy and register now with/without static weaving.
When the UCL3 classLoader no longer causes a NPE (See JIRA http://jira.jboss.com/jira/browse/EJBTHREE-572 ) we will reenable dynamic weaving on EAR predeploy().
http://bugs.eclipse.org/229634
Workaround:
---------------------------------
EclipseLink will use the non-temporary classLoader instead of the one from getNewTempClassLoader() obtained from the JBoss PersistenceUnitInfo that throws a NPE on loadClass() or Class.forName().
We require that JBoss implementers statically weave container managed entities and reference JBoss as the target-server in persistence.xml.
Deployment Changes:
1) If weaving is required then static weave the entities before EAR packaging using either the command-line weaver or the weaving ant task.
2) All persistence units deployed to the JBoss container must contain the following property in persistence.xml or container managed entities will predeploy but fail to be managed at runtime.
JBoss AS 4.2.2 GA debugging:
----------------------------------------------------------
I debugged the UCL3 NullPointerException into the JBoss AS 4.2.2 GA source into the following segment of code.
In the following function the classloader parent tree is searched all the way to the root.
no clazz is returned and in the finally clause the last log.trace causes a RuntimeException on a NPE.
Curious though that the line number in Logger.trace() does not correspond to the JDK 1.5 src.
package org.jboss.mx.loading
public abstract class RepositoryClassLoader extends URLClassLoader
public Class loadClass(String name, boolean resolve)
throws ClassNotFoundException
...
finally
...
--->NPE log.trace("loadClass " + this + " name=" + name + " not found");
}
}
}
Thread [main] (Suspended)
UnifiedClassLoader3(RepositoryClassLoader).loadClass(String, boolean) line: 425
UnifiedClassLoader3(ClassLoader).loadClass(String) line: 251
UnifiedClassLoader3(ClassLoader).loadClassInternal(String) line: 319
Class.forName0(String, boolean, ClassLoader) line: not available [native method]
Class.forName(String, boolean, ClassLoader) line: 242
PrivilegedAccessHelper.getClassForName(String, boolean, ClassLoader) line: 85
XMLEntityMappings.getClassForName(String, ClassLoader) line: 120
XMLEntityMappings.getClassForName(String) line: 157
XMLEntityMappings.initPersistenceUnitClasses() line: 389
MetadataProcessor.initPersistenceUnitClasses() line: 188
MetadataProcessor.processEntityMappings() line: 298
Results:
--------
15:41:43,772 INFO [STDOUT] [EPS Warning]: 2008.05.02 15:41:43.755--Thread(Thread[main,5,jboss])--The temporary classLoader for PersistenceLoadProcessor [helloworld] is not available. Switching classLoader to [org.jboss.mx.loading.UnifiedClassLoader3@18b995c{ url=file:/C:/opt/jboss422/server/default/tmp/deploy/tmp13465jsfejb3.ear ,addedOrder=45}]. Weaving has been disabled for this session. EclipseLink may be unable to get a spec mandated temporary class loader from the server, you may be able to use static weaving as an optional workaround.
15:41:44,221 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=jsfejb3.ear,jar=app.jar,name=TodoDao,service=EJB3 with dependencies:
15:41:44,221 INFO [JmxKernelAbstraction] persistence.units:ear=jsfejb3.ear,jar=app.jar,unitName=helloworld
15:41:44,359 INFO [EJBContainer] STARTED EJB: TodoDao ejbName: TodoDao
15:42:45,344 INFO [STDOUT] [EPS Finer]: 2008.05.02 15:42:45.343--UnitOfWork(20862427)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--TX binding to tx mgr, status=STATUS_ACTIVE
15:42:45,344 INFO [STDOUT] [EPS Finest]: 2008.05.02 15:42:45.344--UnitOfWork(20862427)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--Execute query DoesExistQuery()
15:42:45,350 INFO [STDOUT] [EPS Finest]: 2008.05.02 15:42:45.350--UnitOfWork(20862427)--Thread(Thread[http-127.0.0.1-8080-1,5,jboss])--PERSIST operation called on: Todo@15914f3.
thank you
/michael
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4148554#4148554
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4148554
16 years, 4 months
[JBoss jBPM] - Problem using SelectItems inside selectOneMenu
by david_ling
Hi,
I am having some problems with using a <f:selectItems> element inside<h:selectOneMenu>.
To start off I created a Jbpm4Jsf tag/class that loads up a list of users, which I have tried to put into a Map and now a List. I return this Map/List as the target inside the page and then place the target as the SelectItems value.
Please see code below
| <ga:responseActions>
| <j4j:listAcademics target="#{academics}"/>
| </ga:responseActions>
|
| <jbpm:datacell>
| <f:facet name="header">
| <h:outputText value="Supervisor"/>
| </f:facet>
| <h:selectOneMenu value="#{var['potentialsupervisor']}">
| <f:selectItems value="#{academics}"/>
| </h:selectOneMenu>
| <!-- <h:inputText value="#{var['potentialsupervisor']}"/>-->
| </jbpm:datacell>
|
However, when I submit my form, it throws a bunch of exceptions
| javax.servlet.ServletException
| javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
|
|
| root cause
|
| java.lang.IllegalArgumentException
| javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:166)
| javax.faces.component.SelectItemsIterator.next(SelectItemsIterator.java:49)
| javax.faces.component.UISelectOne.matchValue(UISelectOne.java:165)
| javax.faces.component.UISelectOne.validateValue(UISelectOne.java:137)
| javax.faces.component.UIInput.validate(UIInput.java:868)
| javax.faces.component.UIInput.executeValidate(UIInput.java:1071)
| javax.faces.component.UIInput.processValidators(UIInput.java:663)
| javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1021)
| javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1021)
| javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1021)
| javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1021)
| javax.faces.component.UIForm.processValidators(UIForm.java:229)
| javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1021)
| javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1021)
| javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1021)
| javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:662)
| com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:100)
| com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
| com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
| javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
|
|
The tag/class I use to list all the academics is the following
| public final class ListAcademicsActionListener implements JbpmActionListener {
| private final ValueExpression targetExpression;
|
| public ListAcademicsActionListener(final ValueExpression targetExpression) {
| this.targetExpression = targetExpression;
| }
|
| public String getName() {
| return "listAcademics";
| }
|
| @SuppressWarnings ({"unchecked"})
| public void handleAction(JbpmJsfContext context, ActionEvent event) {
| try {
| final FacesContext facesContext = FacesContext.getCurrentInstance();
| final ELContext elContext = facesContext.getELContext();
| final Collection<SelectItem> academicsList = new Vector<SelectItem>();
| ... //queries DB some academics names and their userID
|
| while(academics.next()){
| SelectItem academic = new SelectItem(lecturerLogin, lecturer);
| academicsList.add(academic);
| }
| targetExpression.setValue(elContext, Collections.unmodifiableCollection(academicsList));
| context.selectOutcome("success");
| }
|
So far all the lecturer's names and logins come up fine, but the problem is when I submit the form. I've searched around and there seems to be similar problems, but never quite the same. Any help is appreciated.
Thanks
David
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4148550#4148550
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4148550
16 years, 4 months
[EJB/JBoss] - Re: error accessing an EJB via JNDI
by loucs
so the problem is caused by the isolation of classloading in my ear.
I tested by putting the attribute calledByValue in default/deploy/conf/jboss-service.xml and it worked, but it's not an acceptable solution as it has repercutions on all jndi lookups, and it increase a lot the ressource usage of such operations.
that's why i'd like to know how to force the calledbyvalue on an EJB3 lookup (and only on one EJB)
i'm searching a lot by myself, (maybe not the right way :), but any clues or link to a corresponding documentation would really help me. (i found some docs but all ejb2 / jboss < 4.2.2.GA related... i don"t has enought knowledge of EJB's to adapt those solution by myself (for now :)
thanks,
--
Lucas
Montes
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4148544#4148544
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4148544
16 years, 4 months
[JBoss Portal] - Re: problem while implementing portal identity API with a jn
by loucs
Ok, so i went forward throught this problem and it's caused by the fact my ear project uses Richfaces (3.2.0.GA) with seam (2.0.0.GA) in portlets. It work perfectlly well but the ear project had to be isolated, with the creation of a loader-repository for my ear. this prevent me to cast the proxy object i get from a jndi lookup outside of my ear in the local or remote interface of my ejb.
i have two solution : i can search for a way to make richfaces work without having to isolate the ear classloading (wich i'm doing looking at the richfaces + portal discussion (with the portletbridge, but i don't think it works differently ), or i can force the EJB to be called by value, but all the docs i find on the subject are about ejb 2.0 and older versions of JBoss (i'm using 4.2.2.GA).
I tested this last one by putting the attribute calledByValue in default/deploy/conf/jboss-service.xml and it worked, but it's not an acceptable solution as it has repercutions on all jndi lookups, and it increase a lot the ressource usage of such operations.
that's why i'd like to know how to force the calledbyvalue on an EJB3 lookup (and only on one EJB), or if possible a solution allowing not to isolate classloading in my ear.
i'm searching a lot by myself, (maybe not the right way :), but any clues or link to a corresponding documentation would really help me.
thanks,
--
Lucas
Montes
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4148542#4148542
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4148542
16 years, 4 months