[JBoss Seam] - Re: Get Request problems with Seam 2 CR1
by smithbstl
Ok, I have it working now but a few things seem rather odd about what I am doing and why it is working.
I changed pages.xml to this
<page view-id="/servicerequest.xhtml">
| <param name="serviceRequestId" value="#{serviceRequestManager.serviceRequestId}"
| converterId="javax.faces.Long"/>
| <begin-conversation join="true" pageflow="serviceRequestCreation"/>
| </page>
|
|
| <page view-id="/addressrequestlisting.xhtml">
| <param name="serviceRequestId" value="#{serviceRequestManager.serviceRequestId}"
| converterId="javax.faces.Long"/>
| <begin-conversation join="true" pageflow="serviceRequestCreation"/>
| <action execute="#{serviceRequestManager.loadServiceRequest(serviceRequestManager.serviceRequestId)}"/>
| </page>
And added the redirect back into the pageflow
<page name="serviceRequestListing" view-id="/addressrequestlisting.xhtml"
| back="enabled">
| <transition name="viewServiceRequest" to="serviceRequest"/>
| </page>
|
| <page name="serviceRequest" view-id="/servicerequest.xhtml"
| back="enabled">
| <redirect/>
| <transition name="viewAssignments" to="assignmentListing"/>
| </page>
Now a few things strike me as odd
1. When I hover the mouse over this link
<s:link action="viewServiceRequest"
| value="#{req.serviceRequestNumber}">
| <f:param name="serviceRequestId" value="#{req.serviceRequestId}" />
| </s:link>
the browser is displaying
http://localhost:8080/srms/addressrequestlisting.seam?serviceRequestId=1&...
in the status bar instead of http://localhost:8080/srms/servicerequest.seam......
since that is where the pageflow is pointing.
2. When I go directly to
http://localhost:8080/srms/servicerequest.seam?serviceRequestId=1
#{serviceRequestManager.loadServiceRequest(serviceRequestId)} is called eventhough I have removed the action it was defined in from pages.xml where servicerequest.xhml is defined. I have no idea how Seam knows to call this method especially since its NOT annotated using @Factory or @Create
It seems there is some magic going on somewhere that I can't seem to lay a handle on.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088058#4088058
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088058
18 years, 7 months
[JBoss AOP] - Dynamic AOP
by sylobsa
Hi,
I use JBoss AS 4.2.0, JDK 5.0, JBoss AOP 1.5.5.
I have a J2EE application and I'd like to use dynamic AOP on it. I want to aspectize only a few classes, so I annotated those classes with :
@Prepare ("all(this)")
Now I want to compile them.
I added the following lines after class compilation task.
<taskdef name="aopc" classname="org.jboss.aop.ant.AopC"
| classpathref="aop.path"/>
|
| <aopc compilerclasspathref="aop.path" verbose="true">
| <classpath path="${classes.dir}"/>
| <src path="${classes.dir}"/>
| <include name="**/*.class"/>
| </aopc>
|
I get an error on a class where there is no annotation at all.
[aopc] [debug] javassist.CtConstructor@2a5330[public DeletePlanAction ()V] matches no pointcuts
[aopc] org.jboss.aop.instrument.TransformationException: Failed to aspectize class com.company.war.commun.uc.managePlan.DeletePlanAction. Could not find class it references com.company.war.commun.uc.managePlan.DeletePlanAction It may not be in your classpath and you may not be getting field and constructor weaving for this class.
[aopc] at org.jboss.aop.instrument.Instrumentor.convertReferences(Instrumentor.java:665)
[aopc] at org.jboss.aop.instrument.Instrumentor.transform(Instrumentor.java:719)
[aopc] at org.jboss.aop.AspectManager.translate(AspectManager.java:909)
[aopc] at org.jboss.aop.AspectManager.transform(AspectManager.java:821)
[aopc] at org.jboss.aop.standalone.Compiler.compileFile(Compiler.java:345)
[aopc] at org.jboss.aop.standalone.Compiler.compile(Compiler.java:234)
[aopc] at org.jboss.aop.standalone.Compiler.main(Compiler.java:90)
[aopc] Exception in thread "main" org.jboss.aop.instrument.TransformationException: Failed to aspectize class com.company.war.commun.uc.managePlan.DeletePlanAction. Could not find class it references com.company.war.commun.uc.managePlan.DeletePlanAction It may not be in your classpath and you may not be getting field and constructor weaving for this class.
[aopc] at org.jboss.aop.instrument.Instrumentor.convertReferences(Instrumentor.java:665)
[aopc] at org.jboss.aop.instrument.Instrumentor.transform(Instrumentor.java:719)
[aopc] at org.jboss.aop.AspectManager.translate(AspectManager.java:909)
[aopc] at org.jboss.aop.AspectManager.transform(AspectManager.java:821)
[aopc] at org.jboss.aop.standalone.Compiler.compileFile(Compiler.java:345)
[aopc] at org.jboss.aop.standalone.Compiler.compile(Compiler.java:234)
[aopc] at org.jboss.aop.standalone.Compiler.main(Compiler.java:90)
I want to aspectize only the classes where there is @Prepare annotations, and define pointcuts dynamically at runtime using a xxx-aop.xml file in my deploy directory.
Can somebody tell me what I missed and what I must do to make it work ?
Regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088057#4088057
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088057
18 years, 7 months
[JBoss AOP] - Dynamic AOP
by sylobsa
Hi,
I use JBoss AS 4.2.0, JDK 5.0, JBoss AOP 1.5.5.
I have a J2EE application and I'd like to use dynamic AOP on it. I want to aspectize only a few classes, so I annotated those classes with :
@Prepare ("all(this)")
Now I want to compile them.
I added the following lines after class compilation task.
<taskdef name="aopc" classname="org.jboss.aop.ant.AopC"
| classpathref="aop.path"/>
|
| <aopc compilerclasspathref="aop.path" verbose="true">
| <classpath path="${classes.dir}"/>
| <src path="${classes.dir}"/>
| <include name="**/*.class"/>
| </aopc>
|
I get an error on a class where there is no annotation at all.
[aopc] [debug] javassist.CtConstructor@2a5330[public DeletePlanAction ()V] matches no pointcuts
[aopc] org.jboss.aop.instrument.TransformationException: Failed to aspectize class com.company.war.commun.uc.managePlan.DeletePlanAction. Could not find class it references com.company.war.commun.uc.managePlan.DeletePlanAction It may not be in your classpath and you may not be getting field and constructor weaving for this class.
[aopc] at org.jboss.aop.instrument.Instrumentor.convertReferences(Instrumentor.java:665)
[aopc] at org.jboss.aop.instrument.Instrumentor.transform(Instrumentor.java:719)
[aopc] at org.jboss.aop.AspectManager.translate(AspectManager.java:909)
[aopc] at org.jboss.aop.AspectManager.transform(AspectManager.java:821)
[aopc] at org.jboss.aop.standalone.Compiler.compileFile(Compiler.java:345)
[aopc] at org.jboss.aop.standalone.Compiler.compile(Compiler.java:234)
[aopc] at org.jboss.aop.standalone.Compiler.main(Compiler.java:90)
[aopc] Exception in thread "main" org.jboss.aop.instrument.TransformationException: Failed to aspectize class com.company.war.commun.uc.managePlan.DeletePlanAction. Could not find class it references com.company.war.commun.uc.managePlan.DeletePlanAction It may not be in your classpath and you may not be getting field and constructor weaving for this class.
[aopc] at org.jboss.aop.instrument.Instrumentor.convertReferences(Instrumentor.java:665)
[aopc] at org.jboss.aop.instrument.Instrumentor.transform(Instrumentor.java:719)
[aopc] at org.jboss.aop.AspectManager.translate(AspectManager.java:909)
[aopc] at org.jboss.aop.AspectManager.transform(AspectManager.java:821)
[aopc] at org.jboss.aop.standalone.Compiler.compileFile(Compiler.java:345)
[aopc] at org.jboss.aop.standalone.Compiler.compile(Compiler.java:234)
[aopc] at org.jboss.aop.standalone.Compiler.main(Compiler.java:90)
I want to aspectize only the classes where there is @Prepare annotations, and define pointcuts dynamically at runtime using a xxx-aop.xml file in my deploy directory.
Can somebody tell me what I missed and what I must do to make it work ?
Regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088056#4088056
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088056
18 years, 7 months
[JBoss Portal] - Re: http not serving out requests
by PeterJ
Hmm, I was going to point you to the readme.html file that accompanies the JBoss AS download, to this section and bullet item:
anonymous wrote : Configuration Issues
| JBossAS 4.2.0.GA
| * JBossAS now binds its services to localhost (127.0.0.1) *by default*, instead of binding to all available interfaces (0.0.0.0). This was primarily done for security reasons because of concerns of users going to production without having secured their servers properly. To enable remote access by binding JBoss services to a particular interface, simply run jboss with the -b option. To bind to all available interfaces and re-enable the legacy behaviour use -b 0.0.0.0. In any case, be aware you still need to secure you server properly.
Unfortunately, that readme.html file does not appear in the Portal + AS bundle. I am not sure how someone downloading the bundle would know to use the -b option if the bundle does not include the readme.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088053#4088053
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088053
18 years, 7 months
[EJB 3.0] - references an unknown entity
by Sukar1205
I am having a problem when I start the JBoss server.
The server keeps failing because of an unknown entity.
this is the code, its a bunch of getters and setters thats all. If you can help why is the server failing that would be great. Please I need to solve this issue fast. I have 2 instance variables projectID and projectID1. Please look at the error below
Many Thanks
| //This is the error
| State: FAILED
| Reason: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on EntityBean.KnowledgeBase.projectID references an unknown entity: java.lang.Integer
|
THis is the code
|
|
| /**
| * Entity class KnowledgeBase
| *
| * @author amer.ramamni
| */
| @Entity
| @Table(name = "tblKnowledgeBase")
| @NamedQueries( {
| @NamedQuery(name = "KnowledgeBase.findByKnowledgeID", query = "SELECT k FROM KnowledgeBase k WHERE k.knowledgeID = :knowledgeID"),
| @NamedQuery(name = "KnowledgeBase.findByKnowledgeName", query = "SELECT k FROM KnowledgeBase k WHERE k.knowledgeName = :knowledgeName"),
| @NamedQuery(name = "KnowledgeBase.findByKnowledgeCategory", query = "SELECT k FROM KnowledgeBase k WHERE k.knowledgeCategory = :knowledgeCategory"),
| @NamedQuery(name = "KnowledgeBase.findByDeleted", query = "SELECT k FROM KnowledgeBase k WHERE k.deleted = :deleted")
| })
| public class KnowledgeBase implements Serializable {
|
| @Id
| @Column(name = "knowledgeID", nullable = false)
| private Integer knowledgeID;
|
| @Column(name = "knowledgeName", nullable = false)
| private String knowledgeName;
|
| @Column(name = "knowledgeCategory")
| private String knowledgeCategory;
|
| @Column(name = "deleted", nullable = false)
| private int deleted;
|
| @JoinColumn(name = "projectID", referencedColumnName = "projectID")
| @ManyToOne
| private Project projectID;
|
| @JoinColumn(name = "projectID", referencedColumnName = "projectID")
| @ManyToOne
| private Project projectID1;
|
| /** Creates a new instance of KnowledgeBase */
| public KnowledgeBase() {
| }
|
| public KnowledgeBase(Integer knowledgeID) {
| this.knowledgeID = knowledgeID;
| }
|
| public KnowledgeBase(Integer knowledgeID, String knowledgeName, int deleted) {
| this.knowledgeID = knowledgeID;
| this.knowledgeName = knowledgeName;
| this.deleted = deleted;
| }
|
| public Integer getKnowledgeID() {
| return this.knowledgeID;
| }
|
| public void setKnowledgeID(Integer knowledgeID) {
| this.knowledgeID = knowledgeID;
| }
|
| public String getKnowledgeName() {
| return this.knowledgeName;
| }
|
| public void setKnowledgeName(String knowledgeName) {
| this.knowledgeName = knowledgeName;
| }
|
| public String getKnowledgeCategory() {
| return this.knowledgeCategory;
| }
|
| public void setKnowledgeCategory(String knowledgeCategory) {
| this.knowledgeCategory = knowledgeCategory;
| }
|
| public int getDeleted() {
| return this.deleted;
| }
|
| public void setDeleted(int deleted) {
| this.deleted = deleted;
| }
|
| public Project getProjectID() {
| return this.projectID;
| }
|
| public void setProjectID(Project projectID) {
| this.projectID = projectID;
| }
|
| public Project getProjectID1() {
| return this.projectID1;
| }
|
| public void setProjectID1(Project projectID1) {
| this.projectID1 = projectID1;
| }
|
| @Override
| public int hashCode() {
| int hash = 0;
| hash += (this.knowledgeID != null ? this.knowledgeID.hashCode() : 0);
| return hash;
| }
|
| @Override
| public boolean equals(Object object) {
| // TODO: Warning - this method won't work in the case the id fields are not set
| if (!(object instanceof KnowledgeBase)) {
| return false;
| }
| KnowledgeBase other = (KnowledgeBase)object;
| if (this.knowledgeID != other.knowledgeID && (this.knowledgeID == null || !this.knowledgeID.equals(other.knowledgeID))) return false;
| return true;
| }
|
| @Override
| public String toString() {
| return "EntityBean.KnowledgeBase[knowledgeID=" + knowledgeID + "]";
| }
|
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088044#4088044
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088044
18 years, 7 months