[Installation, Configuration & DEPLOYMENT] - Re: Deploying error with JBoss 4.x
by sridharkumarch
Hi JaiKiran,
I am trying to deploy my Oracle datasource. I have just modified <jndi-name> attribute in that file. The content of my datasource file is:
<?xml version="1.0" encoding="UTF-8"?>
<local-tx-datasource>
<jndi-name>jdbc/</jndi-name>
<connection-url>jdbc:oracle:thin:@203.199.164.114:1521:VSNLDB</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<user-name>test</user-name>
test
<!-- The minimum connections in a pool/sub-pool.
Pools are lazily constructed on first use -->
<min-pool-size>1</min-pool-size>
<!-- The maximum connections in a pool/sub-pool -->
<max-pool-size>5</max-pool-size>
<idle-timeout-minutes>0</idle-timeout-minutes>
<!-- <track-statements/> -->
<!-- Checks the Oracle error codes and messages for fatal errors -->
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<type-mapping>Oracle9i</type-mapping>
</local-tx-datasource>
and content of hsqldb-ds.xml is:::
<?xml version="1.0" encoding="UTF-8"?>
<!-- The Hypersonic embedded database JCA connection factory config
$Id: hsqldb-ds.xml,v 1.15 2004/09/15 14:37:40 loubyansky Exp $ -->
<local-tx-datasource>
<!-- The jndi name of the DataSource, it is prefixed with java:/ -->
<!-- Datasources are not available outside the virtual machine -->
<jndi-name>DefaultDS</jndi-name>
<!-- for tcp connection, allowing other processes to use the hsqldb
database. This requires the org.jboss.jdbc.HypersonicDatabase mbean.
<connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>
-->
<!-- for totally in-memory db, not saved when jboss stops.
The org.jboss.jdbc.HypersonicDatabase mbean necessary
<connection-url>jdbc:hsqldb:.</connection-url>
-->
<!-- for in-process persistent db, saved when jboss stops. The
org.jboss.jdbc.HypersonicDatabase mbean is necessary for properly db shutdown
-->
<connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}localDB</connection-url>
<!-- The driver class -->
<driver-class>org.hsqldb.jdbcDriver</driver-class>
<!-- The login and password -->
<user-name>sa</user-name>
<!--example of how to specify class that determines if exception means connection should be destroyed-->
<!--exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name-->
<!-- this will be run before a managed connection is removed from the pool for use by a client-->
<!--<check-valid-connection-sql>select * from something</check-valid-connection-sql> -->
<!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
<min-pool-size>5</min-pool-size>
<!-- The maximum connections in a pool/sub-pool -->
<max-pool-size>20</max-pool-size>
<!-- The time before an unused connection is destroyed -->
<!-- NOTE: This is the check period. It will be destroyed somewhere between 1x and 2x this timeout after last use -->
<!-- TEMPORARY FIX! - Disable idle connection removal, HSQLDB has a problem with not reaping threads on closed connections -->
<idle-timeout-minutes>0</idle-timeout-minutes>
<!-- sql to call when connection is created
<new-connection-sql>some arbitrary sql</new-connection-sql>
-->
<!-- sql to call on an existing pooled connection when it is obtained from pool
<check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
-->
<!-- example of how to specify a class that determines a connection is valid before it is handed out from the pool
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyValidConnectionChecker</valid-connection-checker-class-name>
-->
<!-- Whether to check all statements are closed when the connection is returned to the pool,
this is a debugging feature that should be turned off in production -->
<track-statements/>
<!-- Use the getConnection(user, pw) for logins
<application-managed-security/>
-->
<!-- Use the security domain defined in conf/login-config.xml -->
<security-domain>HsqlDbRealm</security-domain>
<!-- Use the security domain defined in conf/login-config.xml or the
getConnection(user, pw) for logins. The security domain takes precedence.
<security-domain-and-application>HsqlDbRealm</security-domain-and-application>
-->
<!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
<type-mapping>Hypersonic SQL</type-mapping>
<!-- This mbean can be used when using in process persistent hypersonic -->
jboss:service=Hypersonic,database=localDB
</local-tx-datasource>
<!-- This mbean should be used only when using tcp connections. Uncomment
when the tcp based connection-url is used.
1701
true
default
false
true
-->
<!-- This mbean can be used when using in process persistent db -->
localDB
true
Please tell where I have did mistake??
Thanks and Regards,
Sridhar
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104860#4104860
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104860
18 years, 8 months
[JBoss Seam] - Re: -Seam-gen PropertyNotFoundException after generate-entit
by nharrison
Here is my entity:
package org.hk.crossroads.shippingapp.model;
// Generated 15/11/2007 14:57:06 by Hibernate Tools 3.2.0.b10
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;
/**
* SApplication generated by hbm2java
*/
@Entity
@Table(name = "s_application", catalog = "shipping_nh")
public class SApplication implements java.io.Serializable {
private Integer applicationId;
private String shipmentCode;
private String region;
private String country;
private String province;
private String organisation;
private String contactPerson;
private String projectType;
private String projectBrief;
private String contentsRequired;
private String stateOfRegistration;
private String oldForms;
private String statusOfApplication;
private String referees;
private String outcomeOfApplication;
private String notes;
private String reviewFeedback;
private String status;
private Date dateEntered;
private String enteredByUser;
private String updatedByUser;
private Date dateLastUpdated;
private Set SCorrespondences = new HashSet(
0);
public SApplication() {
}
public SApplication(String shipmentCode, Date dateEntered,
Date dateLastUpdated) {
this.shipmentCode = shipmentCode;
this.dateEntered = dateEntered;
this.dateLastUpdated = dateLastUpdated;
}
public SApplication(String shipmentCode, String region, String country,
String province, String organisation, String contactPerson,
String projectType, String projectBrief, String contentsRequired,
String stateOfRegistration, String oldForms,
String statusOfApplication, String referees,
String outcomeOfApplication, String notes, String reviewFeedback,
String status, Date dateEntered, String enteredByUser,
String updatedByUser, Date dateLastUpdated,
Set SCorrespondences,
Set SCorrespondences_1) {
this.shipmentCode = shipmentCode;
this.region = region;
this.country = country;
this.province = province;
this.organisation = organisation;
this.contactPerson = contactPerson;
this.projectType = projectType;
this.projectBrief = projectBrief;
this.contentsRequired = contentsRequired;
this.stateOfRegistration = stateOfRegistration;
this.oldForms = oldForms;
this.statusOfApplication = statusOfApplication;
this.referees = referees;
this.outcomeOfApplication = outcomeOfApplication;
this.notes = notes;
this.reviewFeedback = reviewFeedback;
this.status = status;
this.dateEntered = dateEntered;
this.enteredByUser = enteredByUser;
this.updatedByUser = updatedByUser;
this.dateLastUpdated = dateLastUpdated;
this.SCorrespondences = SCorrespondences;
this.SCorrespondences_1 = SCorrespondences_1;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "Application_ID", unique = true, nullable = false)
public Integer getApplicationId() {
return this.applicationId;
}
public void setApplicationId(Integer applicationId) {
this.applicationId = applicationId;
}
@Column(name = "Shipment_Code", nullable = false, length = 10)
@NotNull
@Length(max = 10)
public String getShipmentCode() {
return this.shipmentCode;
}
public void setShipmentCode(String shipmentCode) {
this.shipmentCode = shipmentCode;
}
@Column(name = "Region", length = 25)
@Length(max = 25)
public String getRegion() {
return this.region;
}
public void setRegion(String region) {
this.region = region;
}
@Column(name = "Country", length = 100)
@Length(max = 100)
public String getCountry() {
return this.country;
}
public void setCountry(String country) {
this.country = country;
}
@Column(name = "Province", length = 100)
@Length(max = 100)
public String getProvince() {
return this.province;
}
public void setProvince(String province) {
this.province = province;
}
@Column(name = "Organisation")
public String getOrganisation() {
return this.organisation;
}
public void setOrganisation(String organisation) {
this.organisation = organisation;
}
@Column(name = "Contact_Person")
public String getContactPerson() {
return this.contactPerson;
}
public void setContactPerson(String contactPerson) {
this.contactPerson = contactPerson;
}
@Column(name = "Project_Type", length = 50)
@Length(max = 50)
public String getProjectType() {
return this.projectType;
}
public void setProjectType(String projectType) {
this.projectType = projectType;
}
@Column(name = "Project_Brief", length=2147483647)
public String getProjectBrief() {
return this.projectBrief;
}
public void setProjectBrief(String projectBrief) {
this.projectBrief = projectBrief;
}
@Column(name = "Contents_Required", length=2147483647)
public String getContentsRequired() {
return this.contentsRequired;
}
public void setContentsRequired(String contentsRequired) {
this.contentsRequired = contentsRequired;
}
@Column(name = "State_Of_Registration")
public String getStateOfRegistration() {
return this.stateOfRegistration;
}
public void setStateOfRegistration(String stateOfRegistration) {
this.stateOfRegistration = stateOfRegistration;
}
@Column(name = "Old_Forms")
public String getOldForms() {
return this.oldForms;
}
public void setOldForms(String oldForms) {
this.oldForms = oldForms;
}
@Column(name = "Status_Of_Application", length = 50)
@Length(max = 50)
public String getStatusOfApplication() {
return this.statusOfApplication;
}
public void setStatusOfApplication(String statusOfApplication) {
this.statusOfApplication = statusOfApplication;
}
@Column(name = "Referees", length=2147483647)
public String getReferees() {
return this.referees;
}
public void setReferees(String referees) {
this.referees = referees;
}
@Column(name = "Outcome_Of_Application")
public String getOutcomeOfApplication() {
return this.outcomeOfApplication;
}
public void setOutcomeOfApplication(String outcomeOfApplication) {
this.outcomeOfApplication = outcomeOfApplication;
}
@Column(name = "Notes", length=2147483647)
public String getNotes() {
return this.notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
@Column(name = "Review_Feedback", length=2147483647)
public String getReviewFeedback() {
return this.reviewFeedback;
}
public void setReviewFeedback(String reviewFeedback) {
this.reviewFeedback = reviewFeedback;
}
@Column(name = "Status", length = 25)
@Length(max = 25)
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
@Column(name = "Date_Entered", nullable = false, length = 0)
@NotNull
public Date getDateEntered() {
return this.dateEntered;
}
public void setDateEntered(Date dateEntered) {
this.dateEntered = dateEntered;
}
@Column(name = "Entered_By_User", length = 50)
@Length(max = 50)
public String getEnteredByUser() {
return this.enteredByUser;
}
public void setEnteredByUser(String enteredByUser) {
this.enteredByUser = enteredByUser;
}
@Column(name = "Updated_By_User", length = 50)
@Length(max = 50)
public String getUpdatedByUser() {
return this.updatedByUser;
}
public void setUpdatedByUser(String updatedByUser) {
this.updatedByUser = updatedByUser;
}
@Column(name = "Date_Last_Updated", nullable = false, length = 0)
@NotNull
public Date getDateLastUpdated() {
return this.dateLastUpdated;
}
public void setDateLastUpdated(Date dateLastUpdated) {
this.dateLastUpdated = dateLastUpdated;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "SApplication")
public Set getSCorrespondences() {
return this.SCorrespondences;
}
}
And here is the generated EntityHome:
package org.hk.crossroads.shippingapp.action;
import org.hk.crossroads.shippingapp.model.*;
import java.util.ArrayList;
import java.util.List;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;
@Name("sApplicationHome")
public class SApplicationHome extends EntityHome {
public void setApplicationId(Integer id) {
setId(id);
}
public Integer setApplicationId() {
return (Integer) getId();
}
@Override
protected SApplication createInstance() {
SApplication sApplication = new SApplication();
return sApplication;
}
public void wire() {
}
public boolean isWired() {
return true;
}
public SApplication getDefinedInstance() {
return isIdDefined() ? getInstance() : null;
}
public List getSCorrespondences() {
return getInstance() == null ? null : new ArrayList(
getInstance().getSCorrespondences());
}
}
And, finally, here is the generated EntityQuery that, I think, is broken
package org.hk.crossroads.shippingapp.action;
import org.hk.crossroads.shippingapp.model.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.List;
import java.util.Arrays;
@Name("sApplicationList")
public class SApplicationList extends EntityQuery {
private static final String[] RESTRICTIONS = {
"lower(sApplication.shipmentCode) like concat(lower(#{sApplicationList.sApplication.shipmentCode}),'%')",
"lower(sApplication.region) like concat(lower(#{sApplicationList.sApplication.region}),'%')",
"lower(sApplication.country) like concat(lower(#{sApplicationList.sApplication.country}),'%')",
"lower(sApplication.province) like concat(lower(#{sApplicationList.sApplication.province}),'%')",
"lower(sApplication.organisation) like concat(lower(#{sApplicationList.sApplication.organisation}),'%')",
"lower(sApplication.contactPerson) like concat(lower(#{sApplicationList.sApplication.contactPerson}),'%')",
"lower(sApplication.projectType) like concat(lower(#{sApplicationList.sApplication.projectType}),'%')",
"lower(sApplication.projectBrief) like concat(lower(#{sApplicationList.sApplication.projectBrief}),'%')",
"lower(sApplication.contentsRequested) like concat(lower(#{sApplicationList.sApplication.contentsRequested}),'%')",
"lower(sApplication.stateOfRegistration) like concat(lower(#{sApplicationList.sApplication.stateOfRegistration}),'%')",
"lower(sApplication.oldForms) like concat(lower(#{sApplicationList.sApplication.oldForms}),'%')",
"lower(sApplication.statusOfApplication) like concat(lower(#{sApplicationList.sApplication.statusOfApplication}),'%')",
"lower(sApplication.referees) like concat(lower(#{sApplicationList.sApplication.referees}),'%')",
"lower(sApplication.outcomeOfApplication) like concat(lower(#{sApplicationList.sApplication.outcomeOfApplication}),'%')",
"lower(sApplication.notes) like concat(lower(#{sApplicationList.sApplication.notes}),'%')",
"lower(sApplication.reviewFeedback) like concat(lower(#{sApplicationList.sApplication.reviewFeedback}),'%')",
"lower(sApplication.expectations) like concat(lower(#{sApplicationList.sApplication.expectations}),'%')",
"lower(sApplication.status) like concat(lower(#{sApplicationList.sApplication.status}),'%')",
"lower(sApplication.enteredByUser) like concat(lower(#{sApplicationList.sApplication.enteredByUser}),'%')",
"lower(sApplication.updatedByUser) like concat(lower(#{sApplicationList.sApplication.updatedByUser}),'%')",};
private SApplication sApplication = new SApplication();
@Override
public String getEjbql() {
return "select sApplication from SApplication sApplication";
}
@Override
public Integer getMaxResults() {
return 25;
}
public SApplication getSApplication() {
return sApplication;
}
@Override
public List getRestrictions() {
return Arrays.asList(RESTRICTIONS);
}
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104859#4104859
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104859
18 years, 8 months
[JBoss Seam] - Re: seam-gen entities: cascading bug or accepted behavior?
by sstrenn
Max,
Thanks for clearing that up. I'll submit a feature request to the hibernate tools project to adjust the cascade attribute so that it matches the database-defined behavior. I'll also submit a request to the seam team for a mention of this behavior in the "Getting started with Seam, using seam-gen" section of the reference.
BTW - just as an example of what can happen if one does not change the "default behavior":
Delete a (sales) employee. This cascades to delete all of the customers associated with that employee, which, in turn, cascades to delete all of the sales orders and line items associated with that customer. Also, if the employee table has a self-referential foreign key to identify the employee's boss, a whole chain of other employees (and their customers and sales orders) can be deleted...
Stephen
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4104850#4104850
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4104850
18 years, 8 months