[JBoss Seam] - Gotchas (so far)
by tony.herstellï¼ gmail.com
Excellent Framework.. got going very fast!
Issues with SEAM (Or facelets etc.)
1. Having a commented out section in a .xhtml file still gets processed! That was confusing!
2. Cannot have a javascript nugget to close the window. it just gets ignored.
| <tr>
| <td class="right">
| <input type="button" value="Logout" onclick="javascript:window.close();alert('hi');"/>
| </td>
| </tr>
|
3. Cannot have a "back" or "cancel" button on a screen that has validation as there is no-way that I can find to side-step the validation.
4.Running 1.0.1. on the latest JBoss.. must turn off
| <property name="myFacesLifecycleBug">false</property>
|
to remove startup exception
5. No examples on how to use the cool MyFaces widgets like Tree or any of the ADF widgets.
6. When a sesion times out I get a
| 16:49:56,978 WARN [Contexts] Could not destroy component: zoneSubscriptionManager
| javax.ejb.EJBNoSuchObjectException: Could not find Stateful bean: g4c1140-vg3lsk-eugakr48-1-eugb4i5c-d
| at org.jboss.ejb3.cache.simple.SimpleStatefulCache.get(SimpleStatefulCache.java:268)
|
No idea why, but no side effects (that I can see yet).
Seam looks very promising.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985296#3985296
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985296
19Â years, 7Â months
[Performance Tuning] - Slow remote database connection
by doktora
I have always used postgresql on the localhost, which was also running JBoss.
I have moved the DB to a separate computer on the LAN (gigabit), so now JBoss connects via port 5432 (default tcp/ip for postgresql).
It is performing terribly slow when fetching data from the remote DB.
If I connect from the localhost to the remote DB directly via psql -h , I can run the query faster by hand and get the results before JBoss comes around. So I believe the problem is in JBoss/Hibernate and not in my network.
Has anyone experienced this? Where do I begin to look in order to find this bottleneck?
I'm running the following config:
Release ID: JBoss [Zion] 4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)
Java VM: Java HotSpot(TM) Server VM 1.5.0_06-68,"Apple Computer, Inc."
OS-System: Mac OS X 10.4.8,i386
Postgresql 8.1.5 (built from source)
I'm running a single (non-clustered) instance of JBoss with EJB 3.0.
-- Dok
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985289#3985289
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985289
19Â years, 7Â months
[EJB 3.0] - Mapping Exception for subclass with inherited composite key
by JLuv
I'm getting the error below for what I believe to be a valid mapping. Am I doing something wrong? Any ideas?
org.hibernate.MappingException: Foreign key (FKFA49A91FAB488FB6:billing_document_lines [line_number])) must have same number of columns as the referenced primary key (document_lines [line_number,document_id])
Here's the code:
BillingDocument.java
| package document;
|
| import javax.persistence.Entity;
| import javax.persistence.Table;
|
| @Entity
| @Table(name = "billing_documents")
| public class BillingDocument extends Document {
|
| private static final long serialVersionUID = 1L;
|
| }
|
BillingDocumentLine.java
| package document;
|
| import javax.persistence.Entity;
| import javax.persistence.Table;
|
| @Entity
| @Table(name = "billing_document_lines")
| public class BillingDocumentLine extends DocumentLine {
|
| private static final long serialVersionUID = 1L;
|
| public BillingDocumentLine(BillingDocument document, short lineNumber) {
| super(document, lineNumber);
| }
|
| BillingDocumentLine() {
| }
|
| }
|
Document.java
| package document;
|
| import java.io.Serializable;
|
| import javax.persistence.Column;
| import javax.persistence.Id;
| import javax.persistence.Entity;
| import javax.persistence.Inheritance;
| import javax.persistence.InheritanceType;
| import javax.persistence.Table;
|
| @Entity
| @Table(name = "documents")
| @Inheritance(strategy = InheritanceType.JOINED)
| public abstract class Document implements Serializable {
|
| private static final long serialVersionUID = 1L;
|
| protected String documentID;
|
| protected Document() {
| }
|
| protected Document(String documentID) {
| setDocumentID(documentID);
| }
|
| @Override
| public int hashCode() {
| final int PRIME = 31;
| int result = 1;
| result = PRIME * result
| + ((documentID == null) ? 0 : documentID.hashCode());
| return result;
| }
|
| @Override
| public boolean equals(Object object) {
| if (object instanceof Document) {
| final Document document = (Document) object;
| if (documentID != null) {
| return documentID.equals(document.documentID);
| }
| }
| return false;
| }
|
| @Override
| public String toString() {
| return documentID;
| }
|
| @Id
| @Column(name = "document_id")
| public String getDocumentID() {
| return documentID;
| }
|
| protected void setDocumentID(String documentID) {
| this.documentID = documentID;
| }
| }
|
DocumentLine.java
| package document;
|
| import java.io.Serializable;
|
| import javax.persistence.EmbeddedId;
| import javax.persistence.Entity;
| import javax.persistence.Inheritance;
| import javax.persistence.InheritanceType;
| import javax.persistence.Table;
|
| @Entity
| @Table(name = "document_lines")
| @Inheritance(strategy = InheritanceType.JOINED)
| public abstract class DocumentLine implements Serializable {
|
| private static final long serialVersionUID = 1L;
|
| protected DocumentLinePK primaryKey;
|
| protected DocumentLine(Document document, short lineNumber) {
| setPrimaryKey(new DocumentLinePK(document, lineNumber));
| }
|
| protected DocumentLine() {
| }
|
| @Override
| public int hashCode() {
| final int PRIME = 31;
| int result = 1;
| result = PRIME * result
| + ((primaryKey == null) ? 0 : primaryKey.hashCode());
| return result;
| }
|
| @Override
| public boolean equals(Object object) {
| if (object instanceof DocumentLine) {
| final DocumentLine documentLine = (DocumentLine) object;
| if (primaryKey != null) {
| return primaryKey.equals(documentLine.primaryKey);
| }
| }
| return false;
| }
|
| @Override
| public String toString() {
| return primaryKey.toString();
| }
|
| @EmbeddedId
| public DocumentLinePK getPrimaryKey() {
| return primaryKey;
| }
|
| protected void setPrimaryKey(DocumentLinePK primaryKey) {
| this.primaryKey = primaryKey;
| }
| }
|
DocumentLinePK.java
| package document;
|
| import java.io.Serializable;
|
| import javax.persistence.Column;
| import javax.persistence.Embeddable;
| import javax.persistence.FetchType;
| import javax.persistence.JoinColumn;
| import javax.persistence.ManyToOne;
|
| @Embeddable
| public class DocumentLinePK implements Serializable {
|
| private static final long serialVersionUID = 1L;
|
| private Document document;
|
| private short lineNumber;
|
| public DocumentLinePK(Document document, short lineNumber) {
| setDocument(document);
| setLineNumber(lineNumber);
| }
|
| DocumentLinePK() {
| }
|
| @Override
| public int hashCode() {
| final int PRIME = 31;
| int result = 1;
| result = PRIME * result
| + ((document == null) ? 0 : document.hashCode());
| result = PRIME * result + lineNumber;
| return result;
| }
|
| @Override
| public boolean equals(Object object) {
| if (object == null) {
| return false;
| }
| if (getClass() == object.getClass()) {
| final DocumentLinePK primaryKey = (DocumentLinePK) object;
| if (document != null && lineNumber != 0) {
| return document.equals(primaryKey.document)
| && lineNumber == primaryKey.lineNumber;
| }
| }
| return false;
| }
|
| @Override
| public String toString() {
| return document.toString() + ":" + lineNumber;
| }
|
| @ManyToOne(optional = false, fetch = FetchType.LAZY)
| @JoinColumn(name = "document_id")
| public Document getDocument() {
| return document;
| }
|
| @Column(name = "line_number")
| public short getLineNumber() {
| return lineNumber;
| }
|
| protected void setDocument(Document document) {
| this.document = document;
| }
|
| protected void setLineNumber(short lineNumber) {
| this.lineNumber = lineNumber;
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3985287#3985287
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3985287
19Â years, 7Â months