-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Annoying message at server start up
PostPosted: Fri Feb 11, 2005 6:51 am 
Beginner
Beginner

Joined: Tue Feb 08, 2005 1:29 pm
Posts: 20
Hi,

I am sending you that message because I scanned through my soruce and I am only facing the problems for two of hibernate mappings.

The following message is appearing in the console:
[ReflectHelper] reflection optimizer disabled for: xxxxx, NullPointerException.

Thanks.
DvJ


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 21, 2005 9:25 am 
Beginner
Beginner

Joined: Tue Feb 08, 2005 1:29 pm
Posts: 20
Any one to help please?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 21, 2005 11:47 am 
Regular
Regular

Joined: Thu Dec 18, 2003 2:14 am
Posts: 103
Location: Brooklyn, NY
ingenu wrote:
Any one to help please?

As the posting guidelines state, please give us your mappings and classes so we can help. Your post is too vague right now.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 21, 2005 11:56 am 
Beginner
Beginner

Joined: Tue Feb 08, 2005 1:29 pm
Posts: 20
As requested:

public class Order extends Object implements IOrder, Comparable, Serializable {

private String productId;
private int orderNo;
private String direction;
private int quantity;
private double limit;
private Timestamp timestamp;
private Date validity;
private String userId;
private int executedQty;
private String onBehalf;
private String accountType;
private String mbrIntOrdNum;
private String text;

static final long serialVersionUID = 4557539103552154028L;

public Order() {
}

public Order(String productId, String userId,
String direction, int quantity, double limit, Date validity, String actType, String text, String mIOrdNum, Timestamp timestamp, int orderNo) {
setProductId(productId);
setOrderNo(orderNo);
setDirection(direction);
setQuantity(quantity);
setLimit(limit);
setValidity(validity);
setText(text);
setMbrIntOrdNum(mIOrdNum);
setAccountType(actType);
setTimestamp(timestamp);
setUserId(userId);
setExecutedQty(0);
}

public IProduct getProduct() {
return TradingPlatform.productManager.getProduct(productId);
}

public void setProductId(String ID) {
productId = ID;
}

public void setOrderNo(int n) {
orderNo = n;
}

public void setDirection(String d) {
direction = d;
}

public void setQuantity(int q) {
quantity = q;
}

public void setLimit(double l) {
limit = l;
}

public void setValidity(Date d) {
validity = d;
}

public void setTimestamp(Timestamp d) {
timestamp = d;
}

public void setUserId(String ID) {
userId = ID;
}

public void setExecutedQty(int i) {
executedQty = i;
}

public void setOnBehalf(String ID) {
onBehalf = ID;
}

public void setAccountType(String a) {
accountType = a;
}

public void setMbrIntOrdNum(String s) {
mbrIntOrdNum = s;
}

public void setText(String t) {
text = t;
}

public String getProductId() {
return productId;
}

public int getOrderNo() {
return orderNo;
}

public String getDirection() {
return direction;
}

public double getLimit() {
return limit;
}

public int getQuantity() {
return quantity;
}

public Timestamp getTimestamp() {
return timestamp;
}

public Date getValidity() {
return validity;
}

public String getUserId() {
return userId;
}

public int getExecutedQty() {
return executedQty;
}

public int getRemainingQty() {
return getQuantity() - getExecutedQty();
}

public String getOnBehalf() {
return onBehalf;
}

public String getAccountType() {
return accountType;
}

public String getMbrIntOrdNum() {
return mbrIntOrdNum;
}

public String getText() {
return text;
}

/*
* <code>IAuditable</code> implementation.
*/
public String getAuditCode() {
return ORDERAUDIT;
}
public String getMemberId() {
return getUserId().substring(0, 6);
}

/*
* The database is storing the timestamp under the form of big integer.
*/
protected long getTimestampDB() {
return timestamp.getTime();
}
protected void setTimestampDB(long t) {
timestamp = new Timestamp(t);
}

/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
public int hashCode() {
return getOrderNo();
}

/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Order)) return false;

final Order order = (Order) o;

// An order is identified by its ID.
if (getOrderNo() != order.getOrderNo()) return false;

return true;
}

/*
* (non-Javadoc)
*
* @see java.lang.Comparable#compareTo(java.lang.Object)
*/
public int compareTo(Object o) {
final Order order = (Order) o;

// An order is identified by its orderNo.
if (getOrderNo() == order.getOrderNo()) return 0;

// First, comparaison between buy and sell orders
if (getDirection() == BUY_ORDER && order.getDirection() == SELL_ORDER) {
return -1;
}
if (getDirection() == SELL_ORDER && order.getDirection() == BUY_ORDER) {
return 1;
}

// Comparing now the limits
// If buy order, decreasing limits. If sell order, increasing limits.
if (getLimit() != order.getLimit()) {
if (getDirection().equals(BUY_ORDER)) {
if (getLimit() < order.getLimit()) {
return 1;
}
return -1;
}
if (getLimit() < order.getLimit()) {
return -1;
}
return 1;
}

// Same direction, same limit, let's compare the timestamp
return getTimestamp().compareTo(order.getTimestamp());
}
}

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping SYSTEM "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<hibernate-mapping package="com.etil.sudetp.business.manager.orderbook.impl" >
<class name="Order" table="ORDERBOOK" >
<composite-id>
<key-property name="productId" />
<key-property name="orderNo" />
</composite-id>
<property name="direction" type="string" column="DIRECTION" />
<property name="limit" type="double" column="PRICE" />
<property name="quantity" type="integer" column="QUANTITY" />
<property name="timestampDB" type="long" column="TIMESTAMP" />
<property name="validity" type="java.util.Date" column="VALIDITY" />
<property name="userId" type="string" column="USERID" />
<property name="executedQty" type="integer" column="EXEQTY" />
<property name="onBehalf" type="string" column="ONBEHALF" />
<property name="accountType" type="string" column="ACTTYP" />
<property name="mbrIntOrdNum" type="string" column="MIORDNUM" />
<property name="text" type="string" column="TEXT" />
</class>
</hibernate-mapping>

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
<session-factory>
<!-- properties -->
<property name="connection.username">root</property>
<property name="connection.password">puifefof</property>
<property name="connection.url">jdbc:mysql://localhost/mysql</property>
<property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="show_sql">true</property>
<property name="cglib.use_reflection_optimizer">false</property>

<!-- mapping files -->
<mapping resource="com/etil/sudetp/business/manager/orderbook/impl/Order.hbm.xml" />
</session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 21, 2005 12:20 pm 
Regular
Regular

Joined: Thu Dec 18, 2003 2:14 am
Posts: 103
Location: Brooklyn, NY
ingenu wrote:
<property name="cglib.use_reflection_optimizer">false</property>
</hibernate-configuration>

Set it to true to use cg_lib optimization.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.