[JBoss AOP] - Re: ATOMIC aspect weaving ?
by flavia.rainone@jboss.com
JBoss AOP applies the optimal solution according to the specific case. This means that:
- at compile, it checks class by class, verifying all bindings and aspect that apply to that class, and weaving its code. In this case, weaving on a per aspect basis would be costly, because it would force JBoss AOP to weave a single class more than once.
- at load time, it also checks the classes as they become loaded in the jvm. This is also the best solution because, as in the previous case, doing it the other way would force JBoss AOP to process a class more than once. And trying to figure out all classes afected by a specific class would force the load of all classes, which is not what we want
- at runtime (hotswap), JBossAOP weaves at a per dynamic operation basis. This means that, if you add one or more Binding on a single dynamic aop operation, JBoss AOP will first define all join points affected, and, only after this, perform the weaving of the affected classes. Plus, on JBoss AOP there is no flag involved, so, you won't have the unsetting flag cost if you use JBoss AOP in this case.
- at runtime (without hotswap) in this case, the class code has already been weaved, so JBoss AOP just adds the advices to the appropriete advice stacks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994944#3994944
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994944
19 years, 7 months
[JBoss jBPM] - Signaling Process causes never ending Loop
by Becka
I have currently some Problems with one of my Actionhandlers.
I want to Signal a Process automaticly from within an other.
To now that worked without Problems.
But since i added a Second Transition to the Task, that should be Signaled the Server gets into a never Ending loop due to Leaving and Entering the same Task without any Stop.
This is the Result of a "normal" Signal, just with .signal();
I thought the Name of the Transition in the Signal might help, but the Result is the Same.
The Signaled Task is "waiting for change ...".
It has 2 leaving Transitions "(POSITIVE)" and "(NEGATIVE)"
Here is a Part of the Log:
| 11:56:56,467 INFO [STDOUT] transitionVariableValue = (NEGATIVE)
| 11:56:56,467 INFO [STDOUT] Signaling -> (NEGATIVE)
| 11:56:56,498 DEBUG [GraphElement] event 'before-signal' on 'State(waiting for change ...)' for 'Token(/)'
| 11:56:56,498 DEBUG [GraphElement] event 'node-leave' on 'State(waiting for change ...)' for 'Token(/)'
| 11:56:56,608 DEBUG [GraphElement] executing action 'action[calculate priority]'
| 11:56:56,608 DEBUG [GraphElement] executing action 'action[set status]'
| 11:56:56,608 INFO [STDOUT] Sending signal() in Node State(waiting for change ...)
| 11:56:56,608 DEBUG [GraphElement] event 'before-signal' on 'State(waiting for change ...)' for 'Token(/)'
| 11:56:56,623 DEBUG [GraphElement] event 'node-leave' on 'State(waiting for change ...)' for 'Token(/)'
| 11:56:56,639 DEBUG [GraphElement] executing action 'action[calculate priority]'
| 11:56:56,655 DEBUG [GraphElement] executing action 'action[set status]'
| 11:56:56,655 INFO [STDOUT] Sending signal() in Node State(waiting for change ...)
|
And some code:
System.out.println("Signaling -> " + transitionName);
| ciProcessInstance.signal(transitionName);
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994942#3994942
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994942
19 years, 7 months
[JBoss Seam] - Cannot retrive data from session query to jsp (component not
by rrusinkiewicz
I have the following code in my jsp :
<h:form id="list">
<h:outputText value="No records to display" rendered="#{list.rowCount==0}"/>
<h:dataTable var="rec" value="#{list}" rendered="#{list.rowCount>0}">
<h:column>
<f:facet name="header">
<h:outputText value="Production order id"/>
</f:facet>
<h:outputText value="#{rec.T$PDNO}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Operation id"/>
</f:facet>
<h:outputText value="#{rec.T$OPNO}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Planned"/>
</f:facet>
<h:outputText value="#{rec.T$QPLN}"/>
</h:column>
<h:column>
<f:facet name="header">
<h:outputText value="Completed"/>
</f:facet>
<h:outputText value="#{rec.T$QPRD}"/>
</h:column>
</h:dataTable>
</h:form>
In my session bean I have the following code:
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.datamodel.DataModel;
@Name("reportoperationsseambean")
@Stateful(name="reportoperationsSeam")
public class ReportOperationsSeamBean implements ReportOperationsSeam,ReportOperationsSeamLocal {
@PersistenceContext
(
unitName="reportoperationsSeam",
type=PersistenceContextType.EXTENDED
)
protected EntityManager em;
@In
private Ttisfc010 ttisfc010;
@DataModel
private List<Ttisfc010> list;
@DataModel
private Ttisfc010 recordTtisfc010;
@DataModel
private Ttisfc001 recordTtisfc001;
@DataModel
private Ttihra100 recordTtihra100;
@DataModel private Tticst002 recordTticst002;
public ReportOperationsSeamBean() {
}
@Factory(value="list",scope=ScopeType.CONVERSATION)
public void getTtisfc010(int startRecord) {
String query="select * from Ttisfc010906";
Query q = em.createNativeQuery(query,Ttisfc010.class);
q.setFirstResult(startRecord);
q.setMaxResults(100);
list= q.getResultList();
}
And my components.xml looks as follows:
<components xmlns="http://jboss.com/products/seam/components"
xmlns:core="http://jboss.com/products/seam/core">
<core:init jndi-name="roc-web-seam/#{reportoperationsSeam}/local"/>
>From the jboss log file I can see that component list is not found.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994940#3994940
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994940
19 years, 7 months
[Persistence, JBoss/CMP, Hibernate, Database] - Re: Repeated column in mapping for entity
by smix007
Hello Stephen,
I' m hitting the same exact problem;
here my code:
TermProjPK.java
@Embeddable
| public class TermProjPK implements Serializable {
| private String auiw;
| @Column(name = "AUIS", nullable = false)
| private String auis;
|
TermProj.java
| public class TermProj implements Serializable {
| @EmbeddedId
| private TermProjPK termProjPK;
| //jointure avec la table TermSource
| @ManyToOne
| @JoinColumn (name = "AUIW")
| private TermSource auiw;
| public TermSource getAuiw() {
| return auiw;
| }
|
| public void setAuiw(TermSource auiw) {
| this.auiw = auiw;
| }
|
|
| //jointure avec la table SnomedInter
| @ManyToOne
| @JoinColumn (name = "AUIS")
| private SnomedInter auis;
| public SnomedInter getAuis() {
| return auis;
| }
|
| public void setAuis(SnomedInter auis) {
| this.auis = auis;
| }
| @Column(name = "MODIF")
| private String modif;
|
| @Column(name = "SRC", nullable = false)
| private String src;
TermSource.java
public class TermSource implements Serializable {
| @Id
| @Column(name = "AUIW", nullable = false)
| private String auiw;
| @OneToMany(mappedBy="auiw")
| private Collection<TermProj> termProjs;
|
| public Collection<TermProj> getTermProjs() {
| return termProjs;
| }
|
| public void setTermProjs(Collection<TermProj> termProjs) {
| this.termProjs = termProjs;
| }
SnomedInter.javapublic class SnomedInter implements Serializable {
| @Id
| @Column(name = "AUIS", nullable = false)
| private String auis;
| @OneToMany(mappedBy="auis")
| private Collection<TermProj> termProjs;
|
| public Collection<TermProj> getTermProjs() {
| return termProjs;
| }
|
| public void setTermProjs(Collection<TermProj> termProjs) {
| this.termProjs = termProjs;
| }
|
I always have the same error:
WARN [ServiceController] Problem starting service persistence.units:ear=Pharmacovigilance.ear,jar=Pharmacovigilance-ejb.jar,unitName=Pharmacovigilance-ejbPU
| org.hibernate.MappingException: Repeated column in mapping for entity: ejb.entity.TermProj column: AUIS (should be mapped with insert="false" update="false")
| at org.hibernate.mapping.PersistentClass.checkColumnDuplication(PersistentClass.java:575)
|
my servlet of tests is as follows:
[...]TermProjFacadeLocal termProjFacadeLocal = (TermProjFacadeLocal) lookupTermProjFacade();
|
|
|
| List news = termProjFacadeLocal.findAll();
|
|
| out.println("<TABLE align=\"center\" frame=\"border\" cellpadding=\"2\">");
| out.println("<TR style=\"color:blue\"> <TH align=\"center\" > AUIW </TH> <TH align=\"center\"> AUIS </TH> <TH align=\"center\"> MODIF </TH><TH align=\"center\"> SRC </TH></TR>");
| for (Iterator it = news.iterator(); it.hasNext();) {
| TermProj elem = (TermProj) it.next();
| out.println(" <TR> <TD> <b>" + elem.getTermProjPK().getAuiw() + " </b> </TD>");
| out.println(" <TD> <b>" + elem.getTermProjPK().getAuis() + " </b> </TD> ");
| out.println(" <TD> <b>" + elem.getModif() + " </b> </TD> ");
| out.println(" <TD> <b>" + elem.getSrc() + " </b> </TD> </TR>");
| }
| out.println("</TABLE>");
| [...]
|
were there any suggestions made? Any help is greatly appreciated :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994933#3994933
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994933
19 years, 7 months
[Beginners Corner] - NoSuchMethodError when calling from a Schedulable
by realberen
Hello,
I've made a ScheduleService that implements Schedulable and to start with I want it to be my cron-substitute. The function I call is:
public String importCSV(int limit) {
importCSV i = new importCSV();
i.importFromDB(limit);
return "OK";
}
where importCSV is found through
import saers.util.*;
importCSV.importFromDB() is defined as:
public void importFromDB(int limit)
I've set up an mbean for SchedulerService and one based on org.jboss.varia.scheduler.Scheduler. When it is called I get the exception listed under in the logs. The main problem seems to be:
Caused by: java.lang.NoSuchMethodError: saers.util.importCSV.importFromDB(I)V
but as I mentioned, it is already defined:
public void importFromDB(int limit)
so that seems correct, it takes an integer and returns void. Why am I getting a NoSuchMethodError??
Here is the complete log:
2006-12-19 11:29:03,009 DEBUG [org.jboss.varia.scheduler.Scheduler$Listener] MBeanListener.handleNotification(), notification: javax.management.timer.TimerNotification[source=jboss:service=Timer][type=Schedule][message=Scheduler Notification]
2006-12-19 11:29:03,010 DEBUG [org.jboss.varia.scheduler.Scheduler$Listener] Scheduler is started: true
2006-12-19 11:29:03,010 DEBUG [org.jboss.varia.scheduler.Scheduler$Listener] MBean Arguments are: []
2006-12-19 11:29:03,010 DEBUG [org.jboss.varia.scheduler.Scheduler$Listener] MBean Arguments Types are: []
11:29:03,040 ERROR [Scheduler$Listener] Invoke of the Schedulable MBean failed
javax.management.RuntimeErrorException
at org.jboss.mx.interceptor.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:178)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:163)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.varia.scheduler.Scheduler$MBeanListener.handleNotification(Scheduler.java:1346)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:153)
at $Proxy10.handleNotification(Unknown Source)
at javax.management.NotificationBroadcasterSupport.handleNotification(NotificationBroadcasterSupport.java:221)
at javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:184)
at javax.management.timer.Timer.sendNotification(Timer.java:1295)
at javax.management.timer.Timer.notifyAlarmClock(Timer.java:1264)
at javax.management.timer.TimerAlarmClock.run(Timer.java:1347)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: java.lang.NoSuchMethodError: saers.util.importCSV.importFromDB(I)V
at saers.scheduler.SchedulerService.importCSV(SchedulerService.java:53)
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:155)
... 17 more
2006-12-19 11:29:03,040 ERROR [org.jboss.varia.scheduler.Scheduler$Listener] Invoke of the Schedulable MBean failed
javax.management.RuntimeErrorException
at org.jboss.mx.interceptor.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:178)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:163)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.varia.scheduler.Scheduler$MBeanListener.handleNotification(Scheduler.java:1346)
at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerProxy.java:153)
at $Proxy10.handleNotification(Unknown Source)
at javax.management.NotificationBroadcasterSupport.handleNotification(NotificationBroadcasterSupport.java:221)
at javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:184)
at javax.management.timer.Timer.sendNotification(Timer.java:1295)
at javax.management.timer.Timer.notifyAlarmClock(Timer.java:1264)
at javax.management.timer.TimerAlarmClock.run(Timer.java:1347)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: java.lang.NoSuchMethodError: saers.util.importCSV.importFromDB(I)V
at saers.scheduler.SchedulerService.importCSV(SchedulerService.java:53)
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:155)
... 17 more
Cheers
Nik
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994932#3994932
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994932
19 years, 7 months
[EJB 3.0] - Hot-Deployment-Problem
by skidiver
Hello there,
there's a problem with the hot deployment on JBoss 4.0.5.GA.
I deploy a ejb-jar that contains a simple stateless session bean und a simple entity bean (ejb3). First time i call a session bean's method it works fine. If i do some code changes and redeploy the jar, the same operation fails with the following client stacktrace:
[java] javax.ejb.EJBException: java.lang.IllegalArgumentException: Wrong target. class com.company.project.PersonFacadeBean for public com.company.project.PersonPK com.company.project.PersonFacadeBean.insertPerson(com.company.project.Person)
| [java] at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
| [java] at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| [java] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:191)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
| [java] at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:102)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| [java] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| [java] at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:263)
| [java] at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
| [java] at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
| [java] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:828)
| [java] at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:681)
| [java] at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:358)
| [java] at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:398)
| [java] at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:239)
If i stop JBoss and restart it, the operation works fine. Same problem apears, if i delete the jar before reploying it. What's the problem ?
Thx, Malte
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994924#3994924
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994924
19 years, 7 months
[JBossWS] - JBossWS Client Without J2EE components
by danthony74
Hi,
I'm looking to deploy a Webservice client as part of a J2EE application. I want to deploy it as a static service class (or something similarly lightweight) rather than EJB's or other heavier components, and I want to keep it out of the presentation layer.
I'm trying to deploy the service class, plus the generated classes and CML into a jar, which is in turn part of a WAR.
Having generated the classes, and built the service class, it looks like my jaxrpc-mapping.xml file is not being picked up, I've tried putting it in various locations in the jar, including root and with the classes.
So... is it possible to deploy JBOSSWs in this manner (and use the generated classes - as opposed to the Calls etc), or do I need to use a SessionBean or Servlet, so I can have a ServiceRef - all the documentation looks to be around J2EE artifacts.
Thanks very much in advance.
Dan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994912#3994912
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994912
19 years, 7 months
[JBoss Seam] - Re: @NotNull annotation not working...
by waheed.murad
well i have understood the problem but cannot find solution for it.. well i have
h:outputText in my JSF page as
<h:inputText id="username" value="#{customer.username}">
which is mapped to the Entity bean
Entity
@Name("customer")
@Scope(SESSION)
@Table(name="ERegCustomer")
@SequenceGenerator(name="CUSTOMER_SEQUENCE", sequenceName="EREGCUSTOMER_SEQ")
public class ERegCustomer implements Serializable
{
private static final long serialVersionUID = 1881413500711441953L;
private Integer id;
private String username;
private String password;
....
....
....
And my session bean as
public class ERegCustomerAction implements ERegCustomerLocal {
@In
private Context sessionContext;
@In(required=false)
@Out(required=false)
private ERegCustomer customer;
public String registerCustomer()
{
.......
.........
......... /// here customer.getUsername returns empty String not null
when i submit the form with empty field, ........ customer.username have value. i mean it is assigined to empty string ("") not to null so abviously @NotNull anotation will not work. if this is the case then for what @NotNull is used for and if i am right then what mistake i made
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994911#3994911
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994911
19 years, 7 months
[JBoss Seam] - Re: Why
by Eekboom
Huh? That's exactly what I meant: The value of "embeddedEjb" is jardcoded to "false" in this snippet":
"gavin.king(a)jboss.com" wrote : Here is a quote from the ant build:
|
| <filter token="embeddedEjb" value="false"/>
| |
In another place in the build file it's hardcoded to "true".
So the value defined in component.properties is never used at all.
When I build with my IDE the ant filter tokens in component.xml are not replaced, but Seam is clever enough to dynamically retrieve the values from component.properties, which makes seam want to use the embedded ejb container, which fails in JBoss.
Not a big deal, but quite confusing.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994910#3994910
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994910
19 years, 7 months
[JBoss Seam] - Re: Basic Seam questions
by lightbulb432
anonymous wrote : That's right, I did notice a "cid" request parameter in the address bar. However, what confuses me is if I hit CONTROL+N (for a new window) or open a new tab, how does Seam know that you are now in a new conversation and not the same one? After all, isn't it the same "cid" in the request parameter?
|
| Similarly, with the back button, how does Seam know when it builds the component tree that these components belong to a NEW conversation and not an existing one? After all, if you click back and resubmit (with the same cid in the browser bar), wouldn't it "overwrite" the current conversation?
There are many things about conversations that I'm not able to understand, from the above questions. Could you provide some insight about those issues?
Another question I have is whether persist() is necessary in all cases? I have a conversation with a @Begin and @End. A view uses an entity as a backing bean; the action method on an SFSB and EXTENDED persistence context manipulates that entity's properties; then the method returns a String outcome.
No persist() method, but to my amazement it has persisted in the database after @End completes? Do my eyes deceive me!?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994904#3994904
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994904
19 years, 7 months
[EJB/JBoss] - Re: Unit Testing Practices
by tarantula
Hey,
I've been exploring the embedded EJB3 container that ships with Seam 1.1 GA for the past few days (since it was released) and it looks promising.
I managed to migrate a sizable domain model from pure Hibernate to the Java persistence API using EJB3 entities.
My very simple TestNG test case runs fine (after much wrangling about in my database) but what's really throwing me for a loop are the loopy error messages in the log files.
Anybody else seen this type of stuff?
01:44:27,250 WARN org.jboss.kernel.plugins.deployment.xml.BeanSchemaBinding:227 - You should use the 2.0 version of the Microcontainer xml. xmlns='urn:jboss:bean-deployer:2.0'
Or this?
01:44:32,968 FATAL org.hibernate.ejb.Ejb3Configuration:124 - default.persistence.propertiesO-:-Ofalse
01:44:32,968 FATAL org.hibernate.ejb.Ejb3Configuration:124 - ejb3-interceptors-aop.xmlO-:-Ofalse
01:44:33,062 FATAL org.hibernate.ejb.Ejb3Configuration:124 - embedded-jboss-beans.xmlO-:-Ofalse
01:44:33,062 FATAL org.hibernate.ejb.Ejb3Configuration:124 - import.sqlO-:-Ofalse
01:44:33,062 FATAL org.hibernate.ejb.Ejb3Configuration:124 - jboss-jms-beans.xmlO-:-Ofalse
01:44:33,062 FATAL org.hibernate.ejb.Ejb3Configuration:124 - jndi.propertiesO-:-Ofalse
01:44:33,062 FATAL org.hibernate.ejb.Ejb3Configuration:124 - log4j.dtdO-:-Ofalse
01:44:33,062 FATAL org.hibernate.ejb.Ejb3Configuration:124 - log4j.xmlO-:-Ofalse
01:44:33,062 FATAL org.hibernate.ejb.Ejb3Configuration:124 - login-config.xmlO-:-Ofalse
01:44:33,062 FATAL org.hibernate.ejb.Ejb3Configuration:124 - META-INF/application.xmlO-:-Ofalse
01:44:33,062 FATAL org.hibernate.ejb.Ejb3Configuration:124 - META-INF/ejb-jar.xmlO-:-Ofalse
I saw some posts indicating this one had been fixed in CSV/SVN but I'm not quite sure how to put together a custom out-of-container EJB3 testing environment from odd JARs.
Anyone else have some luck with this?
Should I just ignore these messages and get on with the work?
It would be a shame to turn off logging on the org.hibernate.ejb.Ejb3Configuration just to turn off this perplexing FATAL message.
What does it mean?
I much prefer actually dealing with issues in my logs than simply ignoring them! :)
Cheers,
tarantula
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994901#3994901
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994901
19 years, 7 months
[JBoss Seam] - @NotNull annotation not working...
by waheed.murad
i am working on registration form and i want that user cannot submit empty fields. i have marked the corresponding fields with @NotNull annotation in the Entity POJO but its not working. Other annotations @length etc are working fine. when form is submitted with empty fields, the session bean method is invoked and i have the following errors.
00:18:40,095 INFO [STDOUT] Hibernate: select EREGCUSTOMER_SEQ.nextval from dual
00:18:40,563 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
javax.faces.FacesException: Error calling action method of component with id registercustomerform:create
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
at javax.faces.component.UICommand.broadcast(UICommand.java:106)
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.faces.el.EvaluationException: Exception while invoking expression #{customerAction.registerCustomer}
at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:153)
at org.jboss.seam.actionparam.ActionParamBindingHelper.invokeTheExpression(ActionParamBindingHelper.java:58)
at org.jboss.seam.actionparam.ActionParamMethodBinding.invoke(ActionParamMethodBinding.java:71)
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
... 27 more
Caused by: java.lang.RuntimeException: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=liberty/31, BranchQual=, localId=31] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.persistence.PersistenceException: org.hibernate.validator.InvalidStateException: validation failed for: org.com.pojo.ERegCustomer)
at org.jboss.aspects.tx.TxPolicy.handleEndTransactionException(TxPolicy.java:198)
at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:180)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:197)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:81)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:188)
at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
at $Proxy168.registerCustomer(Unknown Source)
at org.com.eventreg.ERegCustomerLocal$$FastClassByCGLIB$$176dc401.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:47)
at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:67)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:57)
at org.jboss.seam.interceptors.SynchronizationInterceptor.serialize(SynchronizationInterceptor.java:31)
at sun.reflect.GeneratedMethodAccessor165.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.seam.util.Reflections.invoke(Reflections.java:17)
at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:172)
at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:66)
at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:168)
at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:141)
at org.jboss.seam.intercept.RootInterceptor.aroundInvoke(RootInterceptor.java:128)
at org.jboss.seam.intercept.ClientSideInterceptor.interceptInvocation(ClientSideInterceptor.java:60)
at org.jboss.seam.intercept.ClientSideInterceptor.intercept(ClientSideInterceptor.java:47)
at org.com.eventreg.ERegCustomerLocal$$EnhancerByCGLIB$$5d429574.registerCustomer()
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.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
... 30 more
Caused by: org.jboss.tm.JBossRollbackException: Unable to commit, tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=liberty/31, BranchQual=, localId=31] status=STATUS_NO_TRANSACTION; - nested throwable: (javax.persistence.PersistenceException: org.hibernate.validator.InvalidStateException: validation failed for: org.com.pojo.ERegCustomer)
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:372)
at org.jboss.tm.TxManager.commit(TxManager.java:240)
at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
... 69 more
Caused by: javax.persistence.PersistenceException: org.hibernate.validator.InvalidStateException: validation failed for: org.com.pojo.ERegCustomer
at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:487)
at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1491)
at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1110)
at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)
... 71 more
Caused by: org.hibernate.validator.InvalidStateException: validation failed for: org.com.pojo.ERegCustomer
at org.hibernate.validator.event.ValidateEventListener.validate(ValidateEventListener.java:104)
at org.hibernate.validator.event.ValidateEventListener.onPreInsert(ValidateEventListener.java:127)
at org.hibernate.action.EntityInsertAction.preInsert(EntityInsertAction.java:139)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:44)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:232)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:139)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:993)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:340)
at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:475)
... 74 more
--------------------------
any advise Plz
Thanks in advacnce
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994896#3994896
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994896
19 years, 7 months
[Installation, Configuration & Deployment] - NoClassDefFoundError: org/jboss/system/ServiceMBean
by apate
Hi
Sorry if this is a complete newbie question...
I'm trying to move a set of .sars onto jboss 4.0.5 (from 3.something). One of the classes in the .sar extends org.jboss.system.ServiceMBean. But on attempting to deploy, I get the following error:
org.jboss.deployment.DeploymentException: - nested throwable: (java.lang.reflect.UndeclaredThrowableException)
at org.jboss.system.ServiceConfigurator.install(ServiceConfigurator.java:196)
at org.jboss.system.ServiceController.install(ServiceController.java:226)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
(lines removed)
Caused by: java.lang.NoClassDefFoundError: org/jboss/system/ServiceMBean
at java.lang.ClassLoader.findBootstrapClass(Native Method)
at java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:891)
at java.lang.ClassLoader.loadClass(ClassLoader.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:190)
at org.jboss.mx.loading.UnifiedLoaderRepository3.loadClassFromClassLoader(UnifiedLoaderRepository3.java:277)
I presume that this is some sort of class loader issue... but I'm not making a lot of progress after several hours.
Any suggestions gratefully received.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994895#3994895
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994895
19 years, 7 months