Int to serializable
I have a file with a construction:
Serializable[] serializable = new int[n];
It was generated with jad.exe decompiler from .class file.
When I use javac compiler (java version v1.2.2)
it reports an error that the types java.io.Serializable and int is incompatible
any ideas?
PS
Sorry for my english
you need to use the object Integer and not the int primitive type:
Serializable[] serializable = new Integer[n];Talal
Similar Messages
-
I have a file with a construction:
Serializable[] serializable = new int[n];
It was generated with jad.exe decompiler from .class file.
When I use javac compiler (java version v1.2.2)
it reports an error that the types java.io.Serializable and int is incompatible
any ideas?
PS
Sorry for my englishI do not know why you change int to Serializable?
The Serializable is a interface that has no methods or fields and serves only to identify the semantics of being serializable. It means Serializable only a signal to tell compiler one class can be serializable. so I think use Serializable array may be a mistake.
The int is a basic type in Java, NOT a class. So it can not change to any class.
By away, one int array can be image to one object, actually the JVM treated the array ( include basic type and object ) as a object. -
'int' not serializable!?
Hello all,
When deploying my application to WLS 8.1, I keep getting warnings along the lines of
<Warning> <EJB> <BEA-012034> <The Remote interface method: '//snip// Foo.bar(java.lang.String,int) throws java.rmi.RemoteException //snip// contains a parameter of type: 'int' which is not Serializable. Though the EJB 'Foo' has call-by-reference set to false, this parameter is not Serializable and hence will be passed by reference. A parameter can be passed using call-by-value only if the parameter type is Serializable.>
This message completely confuses me. Since 'int' is a primitive, it cannot implement the Serializable interface. On the other hand this is not necessary since the JVM knows how to serialize primitives anyway. Furthermore, primitives are by Java specification always passed by value.
My assumption is that this message is essentially bogus, a weblogic bug if you want, and the int parameter will indeed be passed by value no matter what the warning says. I just cant se how WLS could pass it by reference given that it is running on a VM that implements the java standard.
Am I missing something here? Please give me your thoughts on this one. We have a customer who is very concerned about these warnings showing up in the log...
Thank you
Message was edited by:
[email protected]Hello, and thanks for taking a stab at this.
While it is great that the fix you ar putting into SP5 allows the administrator to supress BEA-012034 warnings all together, would it not be better to simply correct the code not to issue BEA-012034 warnings for ints, floats and other primitives? Enabeling your fix would indeed make these incorrect messages go away, but it will also supress correct BEA-012034 warnings should our ejb interface [heaven forbid :] contain non-serializable objects.
thanks -
Object Replacement with the existing one int the Serialization Stream..
when u readObject() from serialization its fine,but if u change any of its fields or value of variable and than store it back,it append new object to the Serialization Stream.
I want to store that object back to its original position in the stream.
please help me in this regard..you need to use (override) the readResolve() and writeReplace() methods in the classes that you'll be switching their instances/values/etc. with something else.
Look at the javadocs for the java.io.Serializable interface.
Another option is to subclass the ObjectInputStream and override the resolveObject method. (see java.io.ObjectInputStream). You'll probably also have to subclass ObjectOutputStream and override the writeObjectOverride method.
You really only need to use one of these mechanisms, not both.
- Andrew -
Btanks pkgbuild do not compile. serializator.os error 1
Hi!
I am trying to package btanks, http://aur.archlinux.org/packages.php?ID=12631
but is not working ok...
any idea?
g++ -o build/release/mrt/serializator.os -c -march=i686 -mtune=generic -O2 -pipe -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -fPIC -O3 -Wall -pedantic -Wno-long-long -pipe -pthread -DUSE_GLSDL -DV3_DISABLE_Z -D_REENTRANT -DRELEASE -DMRTAPI=DLLEXPORT -Ibuild/release/mrt -Imrt -Imrt -Ibuild/release/mrt/src -Imrt/src -Imrt/src -I. -Isrc mrt/serializator.cpp
mrt/serializator.cpp: In member function 'void mrt::Serializator::add(int)':
mrt/serializator.cpp:99: error: 'memcpy' was not declared in this scope
mrt/serializator.cpp: In member function 'void mrt::Serializator::add(const std::string&)':
mrt/serializator.cpp:123: error: 'memcpy' was not declared in this scope
mrt/serializator.cpp: In member function 'void mrt::Serializator::add(const mrt::Chunk&)':
mrt/serializator.cpp:134: error: 'memcpy' was not declared in this scope
mrt/serializator.cpp: In member function 'void mrt::Serializator::add(const void*, int)':
mrt/serializator.cpp:144: error: 'memcpy' was not declared in this scope
mrt/serializator.cpp: In member function 'void mrt::Serializator::get(int&) const':
mrt/serializator.cpp:190: warning: left shift count >= width of type
mrt/serializator.cpp: In member function 'void mrt::Serializator::get(void*, int) const':
mrt/serializator.cpp:237: error: 'memcpy' was not declared in this scope
mrt/serializator.cpp: In member function 'void mrt::Serializator::get(mrt::Chunk&) const':
mrt/serializator.cpp:253: error: 'memcpy' was not declared in this scope
scons: *** [build/release/mrt/serializator.os] Error 1
scons: building terminated because of errors.
==> ERROR: Fallo build()
Abortando...
Last edited by luuuciano (2008-04-21 14:48:36)thanks a lot!
-
Hello Forum,
I have a question regarding usage of a MySQL-Data-Source in combination with JPA
on the SAP NetWeaver Application Server, Java EE 5 Edition.
I have setup a custom datasource like explained in paper:
"Working with Database Tables, DataSources and JMS Resources"
- registered the database driver via telnet (Using mysql-connector-java-5.0.3-bin.jar)
- created the data-sources.xml file underneath the META-INF dir of the EAR project
[code]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE data-sources SYSTEM "data-sources.dtd" >
<data-sources>
<data-source>
<data-source-name>titan_cruises_ds</data-source-name>
<driver-name>mysql-connector-java-5.0.3-bin.jar</driver-name>
<init-connections>1</init-connections>
<max-connections>10</max-connections>
<max-time-to-wait-connection>60</max-time-to-wait-connection>
<expiration-control>
<connection-lifetime>600</connection-lifetime>
<run-cleanup-thread>60</run-cleanup-thread>
</expiration-control>
<sql-engine>native_sql</sql-engine>
<jdbc-1.x>
<driver-class-name>com.mysql.jdbc.Driver</driver-class-name>
<url>jdbc:mysql://ourHost.internal.com:3306/practise_titan_cruises</url>
<user-name>myUser</user-name>
<password>myPass</password>
</jdbc-1.x>
</data-source>
</data-sources>
[/code]
After that I manually created the persistence.xml underneath the META-INF dir of the EJB project.
[code]
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
<persistence-unit name="titan_cruises_pu">
<jta-data-source>titan_cruises_ds</jta-data-source>
</persistence-unit>
</persistence>
[/code]
After that I created the Entity named "Cabin" and the corresponding table within the db.
Entity code:
[code]
package de.collogia.beans.pojo.ship;
import java.io.IOException;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
This persisted POJO class models the cabin data.
<p>
In this class persistence annotations are placed on the getter methods
of the attributes. This tells the persistence manager to access them
via the corresponding get- and set-Methods.</p>
(Unfortunately this does not work on NetWeaver and I had to place them
on field level aggain...)
@author Henning Malzahn ([email protected])
svn-revision: $Rev:: 670 $:
svn-lasted-edited-by: $Author:: henning $:
svn-last-changed: $Date:: 2007-02-21 21:49:51 +0100 (Wed, 21 Feb 2007) $:
@Entity
@Table(name = "cabin")
public class Cabin implements Serializable {
/** The generated serial version UID used for serialization. */
private static final long serialVersionUID = -8522497314498903378L;
/** The actual version number of this class used for serialization. */
private static int actualVersion = 1;
/** The cabin's id. */
@Id
@GeneratedValue
@Column(name = "id")
private long id;
/** The cabin's name */
@Column(name = "name")
private String name;
/** The cabin's deck level */
@Column(name = "deck_level")
private int deckLevel;
/** The cabin's ship id */
@Column(name = "ship_id")
private int shipId;
/** The cabin's bed count */
@Column(name="bed_count")
private int bedCount;
/---- Serialization/ Deserialization methods -/
Method that is responsible for deserialization of the object.
@param in The <code>ObjectInputStream</code> object to read
the data from.
@throws IOException That may occur when reading from the
<code>ObjectInputStream</code> object
@throws ClassNotFoundException That may occur when invoking the default
deserialization mechanism.
private void readObject(final java.io.ObjectInputStream in)
throws IOException, ClassNotFoundException {
/* Invoke default deserialization mechanism. */
in.defaultReadObject();
/* Read the actual version number of the class. */
actualVersion = in.readInt();
} // End of readObject()
Method that is responsible for serialization of the object.
@param out The <code>ObjectOutputStream</code> object to write
the data to.
@throws IOException That may occur when writing to the
<code>ObjectOutputStream</code> object.
private void writeObject(final java.io.ObjectOutputStream out)
throws IOException {
/* Invoke default serialization mechanism. */
out.defaultWriteObject();
/* Write the actual version number of the class. */
out.writeInt(actualVersion);
} // End of writeObject()
/---- Defining constructors -/
Private default constructor.
private Cabin() {
} // End of default constructor
Full constructor.
@param name The cabin's name.
@param deckLevel The cabin's deck level.
@param shipId The cabin's ship id.
@param bedCount The cabin's bed count.
public Cabin(final String name,
final int deckLevel,
final int shipId,
final int bedCount) {
this.name = name;
this.deckLevel = deckLevel;
this.shipId = shipId;
this.bedCount = bedCount;
} // End of full constructor
/---- Overridden class methods -/
Returns a string representation of the cabin's data.
@see java.lang.Object#toString()
@Override
public String toString() {
StringBuffer strBuf = new StringBuffer();
strBuf.append(this.name);
strBuf.append("\n");
strBuf.append(this.deckLevel);
strBuf.append("\n");
strBuf.append(this.shipId);
strBuf.append("\n");
strBuf.append(this.bedCount);
return strBuf.toString();
} // End of toString()
/---- Defining instance methods -/
Get method for the member "<code>id</code>".
@return Returns the id.
public long getId() {
return this.id;
Set method for the member "<code>id</code>".
HTDODO hm: Check whether it is possible to have setId method
using private accesss level with NetWeaver JPA-Provider!
@param id The id to set.
private void setId(final long id) {
this.id = id;
Get method for the member "<code>name</code>".
@return Returns the name.
public String getName() {
return this.name;
Set method for the member "<code>name</code>".
@param name The name to set.
public void setName(final String name) {
this.name = name;
Get method for the member "<code>deckLevel</code>".
@return Returns the deckLevel.
public int getDeckLevel() {
return this.deckLevel;
Set method for the member "<code>deckLevel</code>".
@param deckLevel The deckLevel to set.
public void setDeckLevel(final int deckLevel) {
this.deckLevel = deckLevel;
Get method for the member "<code>shipId</code>".
@return Returns the shipId.
public int getShipId() {
return this.shipId;
Set method for the member "<code>shipId</code>".
@param shipId The shipId to set.
public void setShipId(final int shipId) {
this.shipId = shipId;
Get method for the member "<code>bedCount</code>".
@return Returns the bedCount.
public int getBedCount() {
return this.bedCount;
Set method for the member "<code>bedCount</code>".
@param bedCount The bedCount to set.
public void setBedCount(final int bedCount) {
this.bedCount = bedCount;
} // End of class Cabin
[/code]
After that I created the TravelAgentBean, a Stateless Session Bean, implementing
a remote interface that allows construction and persisting of new Cabin objects:
[code]
package de.collogia.beans.session.stateless;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import de.collogia.beans.pojo.ship.Cabin;
Class that implements the <code>TravelAgentRemote</code> interface
and defines the business methods of the TravelAgent service.
@author Henning Malzahn ([email protected])
svn-revision: $Rev:: 670 $:
svn-lasted-edited-by: $Author:: henning $:
svn-last-changed: $Date:: 2007-02-21 21:49:51 +0100 (Wed, 21 Feb 2007) $:
@Stateless
public class TravelAgentBean implements TravelAgentRemote {
/** The <code>Log</code> object for this class. */
// private static final Log LOGGER;
/** The <code>PersistenceManager</code> object. */
@PersistenceContext(unitName = "titan_cruises_pu")
EntityManager em;
/---- Static initializer -/
// static {
// LOGGER = LogFactory.getLog(TravelAgentBean.class);
// } // End of static initializer block
/---- Implementing remote interface methods -/
{@inheritDoc}
public void createCabin(final Cabin cabin) {
this.em.persist(cabin);
} // End of createCabin()
} // End of class TravelAgentBean
[/code]
After that I created a Controller class containing a main method that looks up the remote
interface of the TravelAgentBena like explained in document "Accessing Enterprise JavaBeans Using JNDI
in SAP NetWeaver Application Server, Java EE 5 Edition" written by Validimir Pavlov of SAP NetWeaver
development team.
Unfortunately I receive an Exception after invoking the createCabin(...) method.
On the console of the NWDS I receive:
[code]
javax.ejb.EJBException: Exception in getMethodReady() for stateless bean sap.com/test2Earannotation|test2Ejb.jarannotation|TravelAgentBean;
nested exception is: com.sap.engine.services.ejb3.util.pool.PoolException: javax.ejb.EJBException: Cannot perform injection over bean instance
Caused by: java.lang.RuntimeException: The persistence unit is inconsistent:
The entity >>de.collogia.beans.pojo.ship.Cabin<< is mapped to the table >>cabin<<, which does not exist.
[/code]
But if I look at the log file located in "C:\NWAS_JAVAEE5\JP1\JC00\j2ee\cluster\server0\log\defaultTrace.0.trc"
I see the real reason is:
[code]
[EXCEPTION]
#6#1064#42000#You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax
to use near '"cabin"' at line 1#collnx02.collogia.de:3306:null:practise_titan_cruises#select * from "cabin"#com.mysql.jdbc.exceptions.MySQLSyntaxErrorException:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"cabin"' at line 1
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2870)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1573)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3124)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1149)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1262)
at com.sap.sql.jdbc.basic.BasicPreparedStatement.executeQuery(BasicPreparedStatement.java:99)
at com.sap.sql.jdbc.direct.DirectPreparedStatement.executeQuery(DirectPreparedStatement.java:307)
at com.sap.sql.jdbc.direct.DirectPreparedStatement.executeQuery(DirectPreparedStatement.java:264)
at com.sap.engine.services.dbpool.wrappers.PreparedStatementWrapper.executeQuery(PreparedStatementWrapper.java:274)
[/code]
My goodness - what a long post - sorry for this - I hope I provided all information
necessary to deal with the issue.
Am I thinking in the right direction to blame attribute [code]<sql-engine>native_sql</sql-engine>[/code]
of file data-sources.xml for the beaviour? Are there any other argument options than native_sql?
Thanks in Advance!
Henning MalzahnHi Henning,
> Despite the fact it's working now I have to do some
> changes to my code currently
> developed using JBoss/ Hibernate combination.
> Hibernate allows you to have the
> default no-arg constructor with private visibility -
> any special reason for the fact that
> only protected is allowed on NetWeaver?
Here we strictly implemented the checks according to the requirements of the JPA specification. Technically, we could do with private constructors as well. But the JPA specifications requires the constructor to be protected to allow a JPA implementation to subclass entities if needed.
> The entities in the project are final classes
> so declaring a ctor protected doesn't really make
> sense...
For the same reason, your entities should not be final. Are we missing a check here ?
> Also the persistence.xml parameter
>
hibernate.hbm2ddl.auto
with the value of
> create-drop is very useful while
> developing the app - everytime you deploy the project
> you get a fresh database.
> Is there a comparable option for NetWeaver?
No, unfortunately, there is no comparable option in SAP JPA (yet). We understand that there is a need for forward mapping. We would have liked to delegate this task to the JPA design time (i.e. Dali). However, we had to discover that Dali does not perform this task properly and we can't recommend using it any more.
Consequently, there is no automatic schema generation in SAP JPA 1.0.
>
> Another thing is the extra TMP_SEQUENCE table which
> isn't necessary using JBoss and
> Hibernate - what's the reason for that?
With Hibernate Entity Manager, the id generation strategy in use with GenerationType.AUTO depends on the database dialect. This means that depending on the database dialect, IDENTITY columns, SEQUENCES or generator tables (TableHiLo) are required. As Hibernate has the before mentioned schema generation property this fact can be hidden to the user.
In SAP JPA, we are always using a table generator if GenerationType.AUTO is used. This allows for better portability across databases. It requires the table TMP_SEQUENCE. As we unfortunately do not have a schema generation capability, the user must create this table.
Best regards,
Adrian -
Oracle BRM / Win 7 Pro x64 / PIN_ERR_DM_CONNECT_FAILED:26
Hello all
I'm trying to install Oracle BRM but when running pin_setup.bat I have the output below.
I tried on Win 7 Pro x64 and on Windows XP Pro.
I also tried to see if there were any connection attempt when the errors "pcmdd: bad connect for PCWORK, errno 9" is shown, using Wireshark, but it seems that there is no connection attempt when this message is printed to the output.
As the error is exactly the same on Win 7 Pro and Win XP Pro, I think that this is not an operating system problem.
Do you know what I am doing wrong ?
Thanks
pin_setup.bat output :_
#===========================================================
# Installation started at Mon Sep 5 21:04:15 2011.
#===========================================================
cm: Generating pin.conf file
pin.conf is generated under C:/BRM/Portal/sys/cm/pin.conf
pin.conf is generated under C:/BRM/Portal/apps/pin_remit/pin.conf
dm_oracle: Generating pin.conf file
pin.conf is generated under C:/BRM/Portal/setup/scripts/pin.conf
pin.conf is generated under C:/BRM/Portal/sys/dm_oracle/pin.conf
dm_oracle: Configuring database
Creating Portal tablespaces ... this may take a few minutes
Creating main tablespace 'pin00'
Creating index tablespace 'pinx00'
Creating temporary tablespace 'PINTEMP'
Creating 'pin' user
Granting 'pin' correct permissions
Altering 'pin' user default tablespace
Altering 'pin' user temporary tablespace
Finished creating the Portal tablespaces
Continuing to Configure the database
Execute SQL statement from file C:/BRM/Portal/sys/dm_oracle/data/create_dd_UTF8.
source
Loading objects from file
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
pcmdd: bad connect for PCWORK, errno 9
errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UN
KNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
*** Error: Unable to update the Portal Base database.
Exiting from the install without finishing successfully.
Please check for errors in C:/BRM/Portal/setup/pin_setup.log
and then rerun this program.
Press enter to continue
content of pin_setup.log_
#===========================================================
# Log for installation started at Mon Sep 5 21:04:15 2011.
#===========================================================
cm: Generating pin.conf file
pin.conf is generated under C:/BRM/Portal/sys/cm/pin.conf
pin.conf is generated under C:/BRM/Portal/apps/pin_remit/pin.conf
dm_oracle: Generating pin.conf file
pin.conf is generated under C:/BRM/Portal/setup/scripts/pin.conf
pin.conf is generated under C:/BRM/Portal/sys/dm_oracle/pin.conf
dm_oracle: Configuring database
#--- Executing SQL statement:
set heading off;
set feedback off;
select FILE_NAME from dba_data_files where TABLESPACE_NAME = 'SYSTEM';
#------------- SQL Results:
Executing sqlplus -s system/oracle@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
#--- Executing SQL statement:
create tablespace pin00 datafile 'C:/ORACLE/PRODUCT/10.2.0/ORADATA/ORCL/pin00.dbf' size 600M reuse autoextend on next 100M extent management local segment space management manual;
#------------- SQL Results:
Executing sqlplus -s system/oracle@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
Tablespace created.
#--- Executing SQL statement:
create tablespace pinx00 datafile 'C:/ORACLE/PRODUCT/10.2.0/ORADATA/ORCL/pinx00.dbf' size 400M reuse autoextend on next 100M extent management local segment space management manual;
#------------- SQL Results:
Executing sqlplus -s system/oracle@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
Tablespace created.
#--- Executing SQL statement:
create tablespace PINTEMP datafile 'C:/ORACLE/PRODUCT/10.2.0/ORADATA/ORCL/PINTEMP.dbf' size 100M reuse autoextend on next 100M extent management local segment space management manual;
#------------- SQL Results:
Executing sqlplus -s system/oracle@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
Tablespace created.
#--- Executing SQL statement:
create user pin identified by pin;
#------------- SQL Results:
Executing sqlplus -s system/oracle@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
User created.
#--- Executing SQL statement:
grant resource, connect to pin;
#------------- SQL Results:
Executing sqlplus -s system/oracle@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
Grant succeeded.
#--- Executing SQL statement:
alter user pin default tablespace pin00;
#------------- SQL Results:
Executing sqlplus -s system/oracle@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
User altered.
#--- Executing SQL statement:
set heading off;
set feedback off;
select FILE_NAME from dba_data_files where TABLESPACE_NAME = 'SYSTEM';
#------------- SQL Results:
Executing sqlplus -s system/oracle@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
#--- Executing SQL statement:
-- @(#)%Portal Version: create_dd.source:BillingVelocityInt:4:2006-Sep-14 18:49:48 %
-- Copyright (c) 1996 - 2006 Oracle. All rights reserved.
-- This material is the confidential property of Oracle Corporation or its
-- licensors and may be used, reproduced, stored or transmitted only in
-- accordance with a valid Oracle license or sublicense agreement.
-- Create sequences
create sequence obj_ids start with 1000;
create sequence poid_ids2 start with 10000;
-- /dd/fields ARRAY PIN_FLD_FIELD
create table dd_fields_t (
obj_id0 int,
rec_id int,
field_name varchar2(255), -- PIN_FLD_FIELD_NAME
field_num int, -- PIN_FLD_FIELD_NUM
field_type int, -- PIN_FLD_FIELD_TYPE
descr varchar2(1023), -- PIN_FLD_DESCR
status int -- PIN_FLD_DESCR
) tablespace pin00 storage (initial 100k next 100k maxextents unlimited pctincrease 0 ) ;
-- /dd/objects ARRAY PIN_FLD_OBJ_DESC
create table dd_objects_t (
obj_id0 int,
name varchar2(255), -- PIN_FLD_NAME
mod_t number, -- PIN_FLD_MOD_T
state int, -- PIN_FLD_STATE
permission int, -- PIN_FLD_PERMISSION
label varchar2(255), -- PIN_FLD_LABEL
descr varchar2(1023), -- PIN_FLD_DESCR
sm_info varchar2(1023), -- PIN_FLD_SM_INFO
seq_start int, -- PIN_FLD_SEQ_START
read_access varchar2(1), -- PIN_FLD_READ_ACCESS
write_access varchar2(1), -- PIN_FLD_WRITE_ACCESS
create_access varchar2(1), -- PIN_FLD_CREATE_ACCESS
audit_flag int, -- PIN_FLD_AUDIT_FLAG
audit_scheme int, -- PIN_FLD_AUDIT_SCHEME
au_sm_info varchar2(1023), -- PIN_FLD_AU_SM_INFO
is_partitioned int, -- PIN_FLD_IS_PARTITIONED
partition_mode int, -- PIN_FLD_PARTITION_MODE
residency_type int -- PIN_FLD_RESIDENCY_TYPE
) tablespace pin00 storage (initial 100k next 100k maxextents unlimited pctincrease 0 ) ;
-- /dd/objects ARRAY PIN_FLD_OBJ_ELEM
create table dd_objects_fields_t (
obj_id0 int,
rec_id int,
parent_element_id int, -- PIN_FLD_PARENT_ELEMENT_ID
field_name varchar2(255), -- PIN_FLD_FIELD_NAME
field_type int, -- PIN_FLD_FIELD_TYPE
label varchar2(255), -- PIN_FLD_LABEL
descr varchar2(1023), -- PIN_FLD_DESCR
state int, -- PIN_FLD_STATE
permission int, -- PIN_FLD_PERMISSION
field_order int, -- PIN_FLD_ORDER
length int, -- PIN_FLD_LENGTH
sm_item_name varchar2(255), -- PIN_FLD_SM_ITEM_NAME
sm_item_vw_name varchar2(255), -- PIN_FLD_SM_ITEM_VW_NAME
sm_info varchar2(1023), -- PIN_FLD_SM_INFO
auditable int, -- PIN_FLD_AUDIT
queryable_on_audit int, -- PIN_FLD_QUERYABLE_ON_AUDIT
ignore_on_audit int, -- PIN_FLD_IGNORE_ON_AUDIT
encryptable int, -- PIN_FLD_ENCRYPT
serializable int -- PIN_FLD_SERIALIZABLE
) tablespace pin00 storage (initial 200k next 200k maxextents unlimited pctincrease 0 ) ;
-- New table for storing encrypted-Aes keys
-- cryptkey_t
create table cryptkey_t (
crypt_scheme varchar2(10), -- to store scheme name
crypt_key_id int, -- to store key_id
crypt_key varchar2(255) -- to store actual key
) tablespace pin00 storage (initial 100k next 100k maxextents unlimited pctincrease 0 ) ;
-- New table for storing the converted table information
create table aes_crypt_details_t (
table_name varchar2(32),
field_name varchar2(32),
old_size int,
new_size int
) tablespace pin00 storage (initial 100k next 100k maxextents unlimited pctincrease 0 ) ;
-- /dd
create unique index i_dd_objects__id on dd_objects_t ( obj_id0 )
tablespace pinx00 storage (initial 100k next 100k maxextents unlimited pctincrease 0 );
create unique index i_dd_objects_fields__id on dd_objects_fields_t ( obj_id0, rec_id, parent_element_id, field_name)
tablespace pinx00 storage (initial 200k next 200k maxextents unlimited pctincrease 0 );
create unique index i_dd_fields__id on dd_fields_t ( obj_id0, rec_id )
tablespace pinx00 storage (initial 100k next 100k maxextents unlimited pctincrease 0 );
-- crypt
create unique index i_cryptkey__scheme on cryptkey_t ( crypt_scheme, crypt_key_id )
tablespace pinx00 storage (initial 100k next 100k maxextents unlimited pctincrease 0 );
create unique index i_aes_crypt_details__dtls on aes_crypt_details_t ( table_name, field_name )
tablespace pinx00 storage (initial 100k next 100k maxextents unlimited pctincrease 0 );
#------------- SQL Results:
Executing sqlplus -s pin/pin@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
Sequence created.
Sequence created.
Table created.
Table created.
Table created.
Table created.
Table created.
Index created.
Index created.
Index created.
Index created.
Index created.
EBUF: errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UNKNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
#===========================================================
# Log for installation started at Mon Sep 5 21:13:05 2011.
#===========================================================
cm: Generating pin.conf file
pin.conf is generated under C:/BRM/Portal/sys/cm/pin.conf
pin.conf is generated under C:/BRM/Portal/apps/pin_remit/pin.conf
dm_oracle: Generating pin.conf file
pin.conf is generated under C:/BRM/Portal/setup/scripts/pin.conf
pin.conf is generated under C:/BRM/Portal/sys/dm_oracle/pin.conf
dm_oracle: Configuring database
#--- Executing SQL statement:
set heading off;
set feedback off;
select FILE_NAME from dba_data_files where TABLESPACE_NAME = 'SYSTEM';
#------------- SQL Results:
Executing sqlplus -s system/oracle@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
#--- Executing SQL statement:
create tablespace pin00 datafile 'C:/ORACLE/PRODUCT/10.2.0/ORADATA/ORCL/pin00.dbf' size 600M reuse autoextend on next 100M extent management local segment space management manual;
#------------- SQL Results:
Executing sqlplus -s system/oracle@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
create tablespace pin00 datafile 'C:/ORACLE/PRODUCT/10.2.0/ORADATA/ORCL/pin00.dbf' size 600M reuse autoextend on next 100M extent management local segment space management manual
ERROR at line 1:
ORA-01543: tablespace 'PIN00' already exists
#--- Executing SQL statement:
create tablespace pinx00 datafile 'C:/ORACLE/PRODUCT/10.2.0/ORADATA/ORCL/pinx00.dbf' size 400M reuse autoextend on next 100M extent management local segment space management manual;
#------------- SQL Results:
Executing sqlplus -s system/oracle@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
create tablespace pinx00 datafile 'C:/ORACLE/PRODUCT/10.2.0/ORADATA/ORCL/pinx00.dbf' size 400M reuse autoextend on next 100M extent management local segment space management manual
ERROR at line 1:
ORA-01543: tablespace 'PINX00' already exists
#--- Executing SQL statement:
create tablespace PINTEMP datafile 'C:/ORACLE/PRODUCT/10.2.0/ORADATA/ORCL/PINTEMP.dbf' size 100M reuse autoextend on next 100M extent management local segment space management manual;
#------------- SQL Results:
Executing sqlplus -s system/oracle@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
create tablespace PINTEMP datafile 'C:/ORACLE/PRODUCT/10.2.0/ORADATA/ORCL/PINTEMP.dbf' size 100M reuse autoextend on next 100M extent management local segment space management manual
ERROR at line 1:
ORA-01543: tablespace 'PINTEMP' already exists
#--- Executing SQL statement:
create user pin identified by pin;
#------------- SQL Results:
Executing sqlplus -s system/oracle@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
create user pin identified by pin
ERROR at line 1:
ORA-01920: user name 'PIN' conflicts with another user or role name
#--- Executing SQL statement:
grant resource, connect to pin;
#------------- SQL Results:
Executing sqlplus -s system/oracle@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
Grant succeeded.
#--- Executing SQL statement:
alter user pin default tablespace pin00;
#------------- SQL Results:
Executing sqlplus -s system/oracle@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
User altered.
#--- Executing SQL statement:
set heading off;
set feedback off;
select FILE_NAME from dba_data_files where TABLESPACE_NAME = 'SYSTEM';
#------------- SQL Results:
Executing sqlplus -s system/oracle@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF
#--- Executing SQL statement:
-- Copyright (c) 1996 - 2006 Oracle. All rights reserved.
-- This material is the confidential property of Oracle Corporation or its
-- licensors and may be used, reproduced, stored or transmitted only in
-- accordance with a valid Oracle license or sublicense agreement.
-- sql file to drop Infranet Snapshots;
set serveroutput on;
DECLARE
tname varchar2(40);
tcount number;
cid int;
BEGIN
select count(*) into tcount from user_tables where table_name like
'DD_OBJECTS_FIELDS_T';
if tcount = 0 then
cid := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE (cid,
'CREATE TABLE DD_OBJECTS_FIELDS_T ' ||
'(PARENT_ELEMENT_ID int, SM_ITEM_NAME VARCHAR2(255))',
dbms_sql.v7);
DBMS_SQL.CLOSE_CURSOR(cid);
end if;
END;
-- DROP THE SNAPSHOT LOGS
DECLARE
cursor c1 is
SELECT distinct master
FROM dd_objects_fields_t, USER_SNAPSHOTS where
UPPER(sm_item_name ) like '%' || master || '%';
cursor c2 is
SELECT distinct master
FROM dd_objects_fields_t, USER_SNAPSHOT_LOGS where
UPPER(sm_item_name ) like '%' || master || '%';
tname c1%ROWTYPE;
lname c2%ROWTYPE;
t_name varchar2(255);
l_name varchar2(255);
snapshot_count number(38) := 0;
cid int :=0;
BEGIN
-- drop existing multi-dB snapshot LOGS
FOR lname in c2
LOOP
dbms_output.enable(10000);
dbms_output.put_line(lname.master);
l_name := lname.master;
select count(*) into snapshot_count from
user_snapshot_LOGS where master LIKE '%' || UPPER(l_name) || '%';
if snapshot_count > 0 then
dbms_output.put_line('dropping SNAPSHOT LOG on ' ||
l_name || '...');
cid := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE (cid,
'DROP SNAPSHOT LOG ON ' ||
l_name,
dbms_sql.v7);
DBMS_SQL.CLOSE_CURSOR(cid);
else
dbms_output.put_line('No snapshot logs Found');
end if;
END LOOP;
-- drop existing multi-dB snapshots
FOR tname in c1
LOOP
dbms_output.enable(10000);
dbms_output.put_line(tname.master);
t_name := tname.master;
select count(*) into snapshot_count from
user_snapshots where master LIKE '%' || UPPER(t_name) || '%';
if snapshot_count > 0 then
dbms_output.put_line('dropping SNAPSHOT ' ||
t_name || '...');
cid := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE (cid,
'DROP SNAPSHOT ' ||
t_name,
dbms_sql.v7);
DBMS_SQL.CLOSE_CURSOR(cid);
else
dbms_output.put_line('No snapshots Found');
end if;
END LOOP;
END;
DECLARE
tcount number;
cid int;
BEGIN
select count(*) into tcount from user_tab_columns where table_name like
'DD_OBJECTS_FIELDS_T';
if tcount = 2 then
cid := DBMS_SQL.OPEN_CURSOR;
DBMS_SQL.PARSE (cid,
'DROP TABLE DD_OBJECTS_FIELDS_T ',
dbms_sql.v7);
DBMS_SQL.CLOSE_CURSOR(cid);
end if;
END;
#------------- SQL Results:
Executing sqlplus -s pin/pin@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
PL/SQL procedure successfully completed.
#--- Executing SQL statement:
-- Copyright (c) 2007 Oracle. All rights reserved.
-- This material is the confidential property of Oracle Corporation or its
-- licensors and may be used, reproduced, stored or transmitted only in
-- accordance with a valid Oracle license or sublicense agreement.
-- This file has been generated automatically at build time
-- from object specifications on Wed Sep 12 13:10:56 2007.
-- USE THIS FILE WITH CAUTION: NOT FOR USE IN PRODUCTION ENVIRONMENTS
declare
cursor c1 is select sm_item_name from dd_objects_fields_t where sm_item_name not like ':%';
tname c1%ROWTYPE;
cid int;
cnt int;
thename varchar(80);
begin
for tname in c1
loop
cid := DBMS_SQL.OPEN_CURSOR;
if tname.sm_item_name not like 'C%' then
select count(*) into cnt from user_tables where table_name = upper(tname.sm_item_name);
if (cnt > 0) then
DBMS_SQL.PARSE(cid, 'DROP TABLE ' || tname.sm_item_name, dbms_sql.v7);
end if;
else
cnt := instr(tname.sm_item_name, 'T=');
thename := substr(tname.sm_item_name, cnt + 2);
select count(*) into cnt from user_tables where table_name = upper(thename);
if (cnt > 0) then
DBMS_SQL.PARSE(cid, 'DROP TABLE ' || thename, dbms_sql.v7);
end if;
end if;
DBMS_SQL.CLOSE_CURSOR(cid);
end loop;
end;
drop table dd_objects_t;
drop table dd_objects_fields_t;
drop table dd_fields_t;
drop sequence obj_ids;
drop sequence poid_ids2;
drop table cryptkey_t;
drop table aes_crypt_details_t;
drop synonym event_v;
drop synonym event_bal_impacts_v;
drop synonym event_total_v;
drop synonym event_tax_jurisdictions_v;
#------------- SQL Results:
Executing sqlplus -s pin/pin@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
PL/SQL procedure successfully completed.
Table dropped.
Table dropped.
Table dropped.
Sequence dropped.
Sequence dropped.
Table dropped.
Table dropped.
drop synonym event_v
ERROR at line 1:
ORA-01434: private synonym to be dropped does not exist
drop synonym event_bal_impacts_v
ERROR at line 1:
ORA-01434: private synonym to be dropped does not exist
drop synonym event_total_v
ERROR at line 1:
ORA-01434: private synonym to be dropped does not exist
drop synonym event_tax_jurisdictions_v
ERROR at line 1:
ORA-01434: private synonym to be dropped does not exist
#--- Executing SQL statement:
drop package PIN_PARTITION;
#------------- SQL Results:
Executing sqlplus -s pin/pin@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
drop package PIN_PARTITION
ERROR at line 1:
ORA-04043: object PIN_PARTITION does not exist
#--- Executing SQL statement:
-- @(#)%Portal Version: create_dd.source:BillingVelocityInt:4:2006-Sep-14 18:49:48 %
-- Copyright (c) 1996 - 2006 Oracle. All rights reserved.
-- This material is the confidential property of Oracle Corporation or its
-- licensors and may be used, reproduced, stored or transmitted only in
-- accordance with a valid Oracle license or sublicense agreement.
-- Create sequences
create sequence obj_ids start with 1000;
create sequence poid_ids2 start with 10000;
-- /dd/fields ARRAY PIN_FLD_FIELD
create table dd_fields_t (
obj_id0 int,
rec_id int,
field_name varchar2(255), -- PIN_FLD_FIELD_NAME
field_num int, -- PIN_FLD_FIELD_NUM
field_type int, -- PIN_FLD_FIELD_TYPE
descr varchar2(1023), -- PIN_FLD_DESCR
status int -- PIN_FLD_DESCR
) tablespace pin00 storage (initial 100k next 100k maxextents unlimited pctincrease 0 ) ;
-- /dd/objects ARRAY PIN_FLD_OBJ_DESC
create table dd_objects_t (
obj_id0 int,
name varchar2(255), -- PIN_FLD_NAME
mod_t number, -- PIN_FLD_MOD_T
state int, -- PIN_FLD_STATE
permission int, -- PIN_FLD_PERMISSION
label varchar2(255), -- PIN_FLD_LABEL
descr varchar2(1023), -- PIN_FLD_DESCR
sm_info varchar2(1023), -- PIN_FLD_SM_INFO
seq_start int, -- PIN_FLD_SEQ_START
read_access varchar2(1), -- PIN_FLD_READ_ACCESS
write_access varchar2(1), -- PIN_FLD_WRITE_ACCESS
create_access varchar2(1), -- PIN_FLD_CREATE_ACCESS
audit_flag int, -- PIN_FLD_AUDIT_FLAG
audit_scheme int, -- PIN_FLD_AUDIT_SCHEME
au_sm_info varchar2(1023), -- PIN_FLD_AU_SM_INFO
is_partitioned int, -- PIN_FLD_IS_PARTITIONED
partition_mode int, -- PIN_FLD_PARTITION_MODE
residency_type int -- PIN_FLD_RESIDENCY_TYPE
) tablespace pin00 storage (initial 100k next 100k maxextents unlimited pctincrease 0 ) ;
-- /dd/objects ARRAY PIN_FLD_OBJ_ELEM
create table dd_objects_fields_t (
obj_id0 int,
rec_id int,
parent_element_id int, -- PIN_FLD_PARENT_ELEMENT_ID
field_name varchar2(255), -- PIN_FLD_FIELD_NAME
field_type int, -- PIN_FLD_FIELD_TYPE
label varchar2(255), -- PIN_FLD_LABEL
descr varchar2(1023), -- PIN_FLD_DESCR
state int, -- PIN_FLD_STATE
permission int, -- PIN_FLD_PERMISSION
field_order int, -- PIN_FLD_ORDER
length int, -- PIN_FLD_LENGTH
sm_item_name varchar2(255), -- PIN_FLD_SM_ITEM_NAME
sm_item_vw_name varchar2(255), -- PIN_FLD_SM_ITEM_VW_NAME
sm_info varchar2(1023), -- PIN_FLD_SM_INFO
auditable int, -- PIN_FLD_AUDIT
queryable_on_audit int, -- PIN_FLD_QUERYABLE_ON_AUDIT
ignore_on_audit int, -- PIN_FLD_IGNORE_ON_AUDIT
encryptable int, -- PIN_FLD_ENCRYPT
serializable int -- PIN_FLD_SERIALIZABLE
) tablespace pin00 storage (initial 200k next 200k maxextents unlimited pctincrease 0 ) ;
-- New table for storing encrypted-Aes keys
-- cryptkey_t
create table cryptkey_t (
crypt_scheme varchar2(10), -- to store scheme name
crypt_key_id int, -- to store key_id
crypt_key varchar2(255) -- to store actual key
) tablespace pin00 storage (initial 100k next 100k maxextents unlimited pctincrease 0 ) ;
-- New table for storing the converted table information
create table aes_crypt_details_t (
table_name varchar2(32),
field_name varchar2(32),
old_size int,
new_size int
) tablespace pin00 storage (initial 100k next 100k maxextents unlimited pctincrease 0 ) ;
-- /dd
create unique index i_dd_objects__id on dd_objects_t ( obj_id0 )
tablespace pinx00 storage (initial 100k next 100k maxextents unlimited pctincrease 0 );
create unique index i_dd_objects_fields__id on dd_objects_fields_t ( obj_id0, rec_id, parent_element_id, field_name)
tablespace pinx00 storage (initial 200k next 200k maxextents unlimited pctincrease 0 );
create unique index i_dd_fields__id on dd_fields_t ( obj_id0, rec_id )
tablespace pinx00 storage (initial 100k next 100k maxextents unlimited pctincrease 0 );
-- crypt
create unique index i_cryptkey__scheme on cryptkey_t ( crypt_scheme, crypt_key_id )
tablespace pinx00 storage (initial 100k next 100k maxextents unlimited pctincrease 0 );
create unique index i_aes_crypt_details__dtls on aes_crypt_details_t ( table_name, field_name )
tablespace pinx00 storage (initial 100k next 100k maxextents unlimited pctincrease 0 );
#------------- SQL Results:
Executing sqlplus -s pin/pin@ORCL < "C:/BRM/Portal/tmp/tmp.sql"
Sequence created.
Sequence created.
Table created.
Table created.
Table created.
Table created.
Table created.
Index created.
Index created.
Index created.
Index created.
Index created.
EBUF: errno=<PIN_ERR_DM_CONNECT_FAILED:26> location=<Unknown pin location:0> class=<UNKNOWN:0> field num=<0:0,0> recid=<0> reserved=<9>
Edited by: oracledigger on 5 sept. 2011 10:32I have checked the services (in services.msc) and I started the following ones :
- Portal Base Connection Manager
- Portal Base Oracle Data Manager
All other services cannot be started (Error 1067).
Anyway After starting these 2 services I have launched pin_setup.bat again and now the error is :
*** Error: Unable to update the Portal Base database.
Exiting from the install without finishing successfully.
Please check for errors in C:/BRM/Portal/setup/pin_setup.log
and then rerun this program.
In dm_oracle.pinlog There is the following output :
D 09/05/11 21:56:32 - dm:6360.4176 ../dm_oracle_stmt_cache.c:502 1:PCWORK:dm:6360:4176:0:1315245251:0
PINStmtPrepare: SQL Statement = select value from sys.nls_database_parameters where parameter='NLS_CHARACTERSET'
audsession-id: 30162; Statement-id: 42905160;
D 09/05/11 21:56:32 - dm:6360.4176 ../dm_oracle_stmt_cache.c:513 1:PCWORK:dm:6360:4176:0:1315245251:0
audsession-id: 30162; Statement-id: 42905160; Time taken by OCIStmtPrepare = 0.000000 milliseconds
D 09/05/11 21:56:32 - dm:6360.4176 dm_if_oracle.c(110):625 1:PCWORK:dm:6360:4176:0:1315245251:0
audsession-id: 30162; Statement-id: 42905160; Time taken by OCIStmtExecute = 0.000000 milliseconds
E 09/05/11 21:56:32 - dm:6360.4176 dm_if_oracle.c(110):2368 1:PCWORK:dm:6360:4176:0:1315245251:0
Invalid characterset AL32UTF8 for ORACLE database "ORCL"
W 09/05/11 21:56:32 - dm:6360.4176 dm_if_oracle.c(110):3288 1:PCWORK:dm:6360:4176:0:1315245251:0
dm_oracle_create_logins: failed to connect to database. It will try again after 10 seconds.
E 09/05/11 21:56:42 - dm:6360.4176 dm_if_oracle.c(110):3308 1:PCWORK:dm:6360:4176:0:1315245251:0
dm_oracle_create_logins: failed to create connection 1
D 09/05/11 21:56:42 - dm:6360.4176 pcm_tbls.c(21):313 1:PCWORK:dm:6360:4176:0:1315245251:0
pcmext.dll Library initialized
D 09/05/11 21:56:42 - dm:6360.4176 pcm_tbls.c(21):316 1:PCWORK:dm:6360:4176:0:1315245251:0
PCMEXT initialized with 0 function failures
E 09/05/11 21:56:42 - dm:6360.4176 dm_if_oracle.c(110):3852 1:PCWORK:dm:6360:4176:0:1315245251:0
bad initial dm_oracle_get_lda: err=43(PIN_ERR_STORAGE)
E 09/05/11 21:56:42 - dm:6360.4176 dm_back.c(12):443 1:PCWORK:dm:6360:4176:0:1315245251:0
can't do dm_if_init_process(), err 43
E 09/05/11 21:56:42 - dm:6360.4176 dm_main.c(26):1930 1:PCWORK:dm:6360:4176:0:1315245251:0
DM master dm_die: "", errno 0
After that the services "Portal Base Connection Manager" and "Portal Base Oracle Data Manager" is stopped.
Any idea :) ?
Edited by: oracledigger on 5 sept. 2011 11:02
Edited by: oracledigger on 5 sept. 2011 11:08 -
i m reading an array of int from ObjectOutPutStream. can any body tell how do we type cast an object to array ??
karansha:
I'm sure you mean you're trying to read in an int[] from an ObjectInputStream that was written to an ObjectOutputStream since you can't read from an OutputStream. Use something like this:
ObjectInputStream in = <whatever>;
int[] intArray = (int[])in.readObject();adramolek:
Why should you use an Integer[] instead of an int[] for serialization? All arrays of primitives -- boolean[], byte[], double[], float[], int[], long[], short[] -- are serializable as is; there is no need to convert them to arrays of their wrapper types simply to serialize them.
In fact, the output from the following piece of code shows exactly which interfaces are implements by an int[]:
Class cls = int[].class;
Class[] interfaces = cls.getInterfaces();
for (int i = 0; i < interfaces.length; i++) {
System.out.println(interfaces.getName());
The output is:
java.lang.Cloneable
java.io.SerializableThe output is identical for each of boolean[], byte[], double[], float[], int[], long[], and short[], showing that each type is both serializable [i]and cloneable.
Shaun -
Ios_base::trunc file open mode error
I am trying to create an fstream from a filename and an open mode. (Xcode 3.1.2 OS X leopard). I get a compile error :
std::fstream fileStream = std::fstream(filePath.c_str(), std::ios::trunc);
the error is :
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/iosfwd: In copy constructor 'std::basic_ios<char, std::char_traits<char> >::basic_ios(const std::basic_ios<char, std::char_traits<char> >&)':
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/bits/ios_base.h:779: error: 'std::iosbase::iosbase(const std::ios_base&)' is private
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/iosfwd:55: error: within this context
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/iosfwd: In copy constructor 'std::basic_fstream<char, std::char_traits<char> >::basic_fstream(const std::basic_fstream<char, std::char_traits<char> >&)':
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/iosfwd:95: warning: synthesized method 'std::basic_ios<char, std::char_traits<char> >::basic_ios(const std::basic_ios<char, std::char_traits<char> >&)' first required here
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/iosfwd: In copy constructor 'std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf(const std::basic_filebuf<char, std::char_traits<char> >&)':
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/streambuf:772: error: 'std::basicstreambuf<CharT, Traits>::basicstreambuf(const std::basicstreambuf<CharT, _Traits>&) [with _CharT = char, _Traits = std::char_traits<char>]' is private
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/iosfwd:86: error: within this context
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/iosfwd: In copy constructor 'std::basic_fstream<char, std::char_traits<char> >::basic_fstream(const std::basic_fstream<char, std::char_traits<char> >&)':
/Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/iosfwd:95: warning: synthesized method 'std::basic_filebuf<char, std::char_traits<char> >::basic_filebuf(const std::basic_filebuf<char, std::char_traits<char> >&)' first required here
/Users/dlsa/code/toolboxgeneral/trunk/src/DSTextFileSerializer.cpp: In member function 'int DSTextFileSerializer::setPath(std::string)':
/Users/dlsa/code/toolboxgeneral/trunk/src/DSTextFileSerializer.cpp:29: warning: synthesized method 'std::basic_fstream<char, std::char_traits<char> >::basic_fstream(const std::basic_fstream<char, std::char_traits<char> >&)' first required here
/Users/dlsa/code/toolboxgeneral/trunk/src/DSTextFileSerializer.cpp: In member function 'virtual int DSTextFileSerializer::serialize()':
I looked at the <ios> header and the constants are public.
Help!You are trying to copy the stream. Do this instead:
std::fstream fileStream(filePath.c_str(), std::ios::trunc);
Why are you using fstream and trunc? Just use ofstream and leave off the mode. -
I am pretty frustrated about having to write my own Serializable classes. I'm not sure if this is the right place to ask, but will the next version of Java supports Serializable 2D objects?
Further, I was trying to write my own class to extend java.awt.geom.GeneralPath to become Serializable, but it's declared "final". What should I do? (I had no problems with Rectangle2D.Double, Line2D.Double, etc.)
Any help is greatly appreciated.
SelwynYour code for serializing the state of the General path forgets two things:
1. the winding rule
2. the segments types!
You could use a vector, but I just directly wrote to the file:
private void writeObject(ObjectOutputStream oos) throws IOException
{ out.defaultWriteObject();
//write state of transient GeneralPath _gp;
out.writeInt(_gp.getWindingRule());
float[] coord = new float[6];
PathIterator i = _gp.getPathIterator(null);
while(!i.isDone())
{ int seg = i.currentSegment(coords);
writeInt(seg);
//switch on seg, writing correct # of floats from coords
i.next();
out.writeInt(-1); //sentinel for end-of-data: SEG_LINETO etc are [0,4]
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException
{ in.defaultReadObject();
int rule = in.readInt();
_gp = new GeneralPath(rule);
//etc...
}3. I'm just winging this code -- haven't tested it
--Nax -
Problem with writing and reading using serialization
I am having a problem with writing and reading an object that has another object in it. The purpose of the class is to write a order that has multiple items in it. And there will be several orders. This is for an IB project, where one of the requirements is to utilize a hierarchical composite data structure. That is, it is "one that contains more than one element and at least one of the elements is a composite data structure. Examples are, an array or linked list of records, a record that has one field that is another record, or an array". The code is shown below:
The error produced is
java.lang.NullPointerException
at SamsonRubberIndustries.CustomerOrderDetails.createCustOrdDetailsScreen(CustomerOrderDetails.java:150)
at SamsonRubberIndustries.CustomerOrderDetails$1.run(CustomerOrderDetails.java:78)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
public class CustOrdObject implements Serializable {
public int CustID;
public int CustOrderID;
public Object OrderDate;
public InnerCustOrdObject[] innerCustOrdObj;
public float GrandTotal;
public int MaxItems;
public CustOrdObject() {}
public CustOrdObject(InnerCustOrdObject[] innerCustOrdObj,
int CustID, int CustOrderID, Object OrderDate,
float GrandTotal, int innerarrlength, int innerarrpos, int MaxItems) {
this.CustID = CustID;
this.CustOrderID = CustOrderID;
this.OrderDate = OrderDate;
this.GrandTotal = GrandTotal;
this.MaxItems = MaxItems;
this.innerCustOrdObj = new InnerCustOrdObject[MaxItems];
public InnerCustOrdObject[] getInnerCustOrdObj() {
return innerCustOrdObj;
public void setInnerCustOrdObj(InnerCustOrdObject[] innerCustOrdObj) {
this.innerCustOrdObj = innerCustOrdObj;
public int getCustID() {
return CustID;
public void setCustID(int custID) {
CustID = custID;
public int getCustOrderID() {
return CustOrderID;
public void setCustOrderID(int custOrderID) {
CustOrderID = custOrderID;
public Object getOrderDate() {
return OrderDate;
public void setOrderDate(Object orderDate) {
OrderDate = orderDate;
public void setGrandTotal(float grandTotal) {
GrandTotal = grandTotal;
public float getGrandTotal() {
return GrandTotal;
public int getMaxItems() {
return MaxItems;
public void setMaxItems(int maxItems) {
MaxItems = maxItems;
public class InnerCustOrdObject implements Serializable{
public int ItemNumber;
public float UnitPrice;
public int QuantityRequired;
public float TotalPrice;
public InnerCustOrdObject() {}
public InnerCustOrdObject(int ItemNumber, float
UnitPrice, int QuantityRequired, float TotalPrice){
this.ItemNumber = ItemNumber;
this.UnitPrice = UnitPrice;
this.QuantityRequired = QuantityRequired;
this.TotalPrice = TotalPrice;
public int getItemNumber() {
return ItemNumber;
public void setItemNumber(int itemNumber) {
ItemNumber = itemNumber;
public int getQuantityRequired() {
return QuantityRequired;
public void setQuantityRequired(int quantityRequired) {
QuantityRequired = quantityRequired;
public float getTotalPrice() {
return TotalPrice;
public void setTotalPrice(float totalPrice) {
TotalPrice = totalPrice;
public float getUnitPrice() {
return UnitPrice;
public void setUnitPrice(float unitPrice) {
UnitPrice = unitPrice;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.DefaultTableModel;
public class CustomerOrderDetails extends CommonFeatures{
//TODO
private static int MAX_ORDERS = 200;
private static int MAX_ORDERITEMS = 100;
private static int MaxRecord;
private static int CurrentRecord = 1;
private static int currentItem;
private static int MaxItems;
private static boolean FileExists, recFileExists;
private static CustOrdObject[] orderDetails = new CustOrdObject[MAX_ORDERS];
private static InnerCustOrdObject[] innerCustOrdObj = new InnerCustOrdObject[MAX_ORDERITEMS];
private static File OrderDetailsFile = new File("CustOrdDetails.dat");
private static File OrdRecordNumStore = new File("OrdRecordNumStore.txt");
private static PrintWriter writeFile;
private static BufferedReader readFile;
private static ObjectOutputStream objOut;
private static ObjectInputStream objIn;
//Set format for date
SimpleDateFormat simpleDF = new SimpleDateFormat("dd MM yyyy");
//--<BEGINNING>--Declaring Interface Variables------------------------------------------//
private JPanel innertoppanel, innercenterpanel, innerbottompanel, innerrightpanel, innerleftpanel;
private JLabel CustIDLbl, CustOrderIDLbl, OrderedDateLbl, GrandTotLbl, ItemNumberLbl,UnitPriceLbl, QuantityReqLbl, TotPriceLbl;
private JTextField CustIDTxt, CustOrderIDTxt, OrderedDateTxt, GrandTotTxt, ItemNumberTxt, UnitPriceTxt, QuantityReqTxt, TotPriceTxt;
private JButton addrecordbtn, savebtn, externalprevbtn, externalnextbtn, internalprevbtn, internalnextbtn, gotorecordbtn, additemreqbtn;
//--<END>--Declaring Interface Variables------------------------------------------------//
public static void main(String[] args) {
final CustomerOrderDetails COD = new CustomerOrderDetails();
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
COD.createCustOrdDetailsScreen();
} catch (Exception eb) {
eb.printStackTrace();
//--<BEGINNING>--Creating CustomerOrderDetails Screen---------------------------------------//
public JFrame createCustOrdDetailsScreen() {
createDefaultFrame();
mainframe.setSize(800,500);
createContainerPanel();
containerpanel.add(createCustOrdDetailsTitle(), BorderLayout.NORTH);
containerpanel.add(createCustOrdDetailsMainPanel(), BorderLayout.CENTER);
//containerpanel.add(createCustOrdDetailsLeftNavButtons(), BorderLayout.WEST);
//containerpanel.add(createCustOrdDetailsRightNavButtons(), BorderLayout.EAST);
containerpanel.add(createCustOrdDetailsButtons(), BorderLayout.SOUTH);
mainframe.setContentPane(containerpanel);
mainframe.setLocationRelativeTo(null);
mainframe.setVisible(true);
//--<BEGINNING>--Checks to see whether CRecordNumberStore file exists-------------------------------//
if (OrdRecordNumStore.exists() == true) {
recFileExists = true;
}else {
recFileExists = false;
if (recFileExists == true) {
MaxRecord = readRecordNumber();
CurrentRecord = MaxRecord;
//readOrder();
//readInnerOrderRecord(CurrentRecord);
System.out.println("Current Record " +CurrentRecord);
System.out.println("Max Record " +MaxRecord);
}else{
MaxRecord = 1;
writeRecordNumber(MaxRecord);
CustOrderIDTxt.setText(""+MaxRecord);
System.out.println("Current Record " +CurrentRecord);
System.out.println("Max Record " +MaxRecord);
//--<END>--Checks to see whether CRecordNumberStore file exists--------------------------------------//
if(readOrder() != null){
orderDetails = (CustOrdObject[]) readOrder();
innerCustOrdObj = orderDetails[CurrentRecord].getInnerCustOrdObj();
MaxItems = orderDetails[CurrentRecord].getMaxItems();
if(CurrentRecord > 1 && CurrentRecord < MaxRecord){
externalnextbtn.setEnabled(true);
externalprevbtn.setEnabled(true);
if(CurrentRecord >= MaxRecord){
externalnextbtn.setEnabled(false);
getFieldText(CurrentRecord-1);
}else{
orderDetails[CurrentRecord] = new CustOrdObject();
currentItem = 1;
return mainframe;
//--<END>--Creating CustomerOrderDetails Screen---------------------------------------------//
public JPanel createCustOrdDetailsTitle(){
createTitlePanel();
titlepanel.setBackground(TxtfontColor);
label.setText("- Customer Order Details -");
labelpanel.setBackground(TxtfontColor);
label.setForeground(Color.white);
createbuttonpanel();
buttonpanel.setBackground(TxtfontColor) ;
buttonpanel.add(createReturnToMainMenuButton());
titlepanel.add(labelpanel, BorderLayout.WEST);
titlepanel.add(buttonpanel, BorderLayout.EAST);
return titlepanel;
public JPanel createCustOrdDetailsMainPanel(){
createmainpanel();
mainpanel.setBackground(TxtfontColor);
mainpanel.setLayout(new BorderLayout());
mainpanel.setBorder(BorderFactory.createTitledBorder(""));
mainpanel.add(createInnerTopPanel(), BorderLayout.NORTH);
mainpanel.add(createInnerCenterPanel(), BorderLayout.CENTER);
mainpanel.add(createInnerBottomPanel(), BorderLayout.SOUTH);
mainpanel.add(createInnerRightPanel(), BorderLayout.EAST);
mainpanel.add(createInnerLeftPanel(), BorderLayout.WEST);
return mainpanel;
public JPanel createInnerTopPanel(){
innertoppanel = new JPanel(new GridBagLayout());
innertoppanel.setBackground(TxtfontColor);
GridBagConstraints GBC = new GridBagConstraints();
GBC.fill = GridBagConstraints.HORIZONTAL;
//Setting Font Type and Size
Font font = new Font("Arial", Font.BOLD, 11);
CustIDLbl = new JLabel("Customer ID");
CustIDLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
CustIDLbl.setFont(font);
CustIDLbl.setForeground(LblfontColor);
GBC.gridx = 1;
GBC.gridy = 1;
innertoppanel.add(CustIDLbl, GBC);
CustIDTxt = new JTextField(20);
CustIDTxt.setEditable(true);
GBC.gridx = 2;
GBC.gridy = 1;
innertoppanel.add(CustIDTxt, GBC);
GBC.gridx = 3;
GBC.gridy = 1;
innertoppanel.add(Box.createHorizontalStrut(220), GBC);
OrderedDateLbl = new JLabel("Order Date");
OrderedDateLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
OrderedDateLbl.setFont(font);
OrderedDateLbl.setForeground(LblfontColor);
GBC.gridx = 4;
GBC.gridy = 1;
innertoppanel.add(OrderedDateLbl, GBC);
//Get today's date
Date todaydate = new Date();
OrderedDateTxt = new JTextField(simpleDF.format(todaydate), 20);
OrderedDateTxt.setHorizontalAlignment(JTextField.CENTER);
OrderedDateTxt.setEditable(false);
GBC.gridx = 5;
GBC.gridy = 1;
innertoppanel.add(OrderedDateTxt, GBC);
CustOrderIDLbl = new JLabel("Customer Order ID");
CustOrderIDLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
CustOrderIDLbl.setFont(font);
CustOrderIDLbl.setForeground(LblfontColor);
GBC.gridx = 1;
GBC.gridy = 2;
innertoppanel.add(CustOrderIDLbl, GBC);
CustOrderIDTxt = new JTextField(20);
CustOrderIDTxt.setEditable(false);
GBC.gridx = 2;
GBC.gridy = 2;
innertoppanel.add(CustOrderIDTxt, GBC);
return innertoppanel;
public JPanel createInnerCenterPanel(){
innercenterpanel = new JPanel(new GridBagLayout());
innercenterpanel.setBackground(TxtfontColor);
innercenterpanel.setBorder(BorderFactory.createLoweredBevelBorder());
GridBagConstraints GBC = new GridBagConstraints();
GBC.fill = GridBagConstraints.HORIZONTAL;
//Setting Font Type and Size
Font font = new Font("Arial", Font.BOLD, 11);
ItemNumberLbl = new JLabel("Item Number");
ItemNumberLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
ItemNumberLbl.setFont(font);
ItemNumberLbl.setForeground(LblfontColor);
GBC.gridx = 1;
GBC.gridy = 1;
innercenterpanel.add(ItemNumberLbl, GBC);
ItemNumberTxt = new JTextField(20);
GBC.gridx = 2;
GBC.gridy = 1;
innercenterpanel.add(ItemNumberTxt, GBC);
UnitPriceLbl = new JLabel("Unit Price");
UnitPriceLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
UnitPriceLbl.setFont(font);
UnitPriceLbl.setForeground(LblfontColor);
GBC.gridx = 1;
GBC.gridy = 2;
innercenterpanel.add(UnitPriceLbl, GBC);
UnitPriceTxt = new JTextField(20);
//UnitPriceTxt.setEditable(false);
GBC.gridx = 2;
GBC.gridy = 2;
innercenterpanel.add(UnitPriceTxt, GBC);
QuantityReqLbl = new JLabel("Quantity Required");
QuantityReqLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
QuantityReqLbl.setFont(font);
QuantityReqLbl.setForeground(LblfontColor);
GBC.gridx = 1;
GBC.gridy = 3;
innercenterpanel.add(QuantityReqLbl, GBC);
QuantityReqTxt = new JTextField(20);
//QuantityReqTxt.setEditable(false);
GBC.gridx = 2;
GBC.gridy = 3;
innercenterpanel.add(QuantityReqTxt, GBC);
TotPriceLbl = new JLabel("Total Price");
TotPriceLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
TotPriceLbl.setFont(font);
TotPriceLbl.setForeground(LblfontColor);
GBC.gridx = 1;
GBC.gridy = 4;
innercenterpanel.add(TotPriceLbl, GBC);
TotPriceTxt = new JTextField(20);
//TotPriceTxt.setEditable(false);
GBC.gridx = 2;
GBC.gridy = 4;
innercenterpanel.add(TotPriceTxt, GBC);
return innercenterpanel;
public JPanel createInnerBottomPanel(){
innerbottompanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
innerbottompanel.setBackground(TxtfontColor);
//Setting Font Type and Size
Font font = new Font("Arial", Font.BOLD, 11);
GrandTotLbl = new JLabel("Grand Total");
GrandTotLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
GrandTotLbl.setFont(font);
GrandTotLbl.setForeground(LblfontColor);
innerbottompanel.add(GrandTotLbl);
innerbottompanel.add(Box.createHorizontalStrut(30));
GrandTotTxt = new JTextField(20);
innerbottompanel.add(GrandTotTxt);
return innerbottompanel;
public JPanel createInnerRightPanel(){
innerrightpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
innerrightpanel.setBackground(TxtfontColor);
innerrightpanel.setLayout(new BoxLayout(navrightpanel, BoxLayout.Y_AXIS));
innerrightpanel.setBorder(BorderFactory.createLoweredBevelBorder());
innerrightpanel.setLayout(new GridBagLayout());
GridBagConstraints GBC = new GridBagConstraints();
GBC.fill = GridBagConstraints.HORIZONTAL;
internalnextbtn = new JButton(createNextButtonIcon());
GBC.gridx = 1;
GBC.gridy = 1;
internalnextbtn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
//getInnerFieldText(currentItem);
internalprevbtn.setEnabled(true);
if(currentItem < MaxItems){
++CurrentRecord;
//readOrder();
//readInnerOrderRecord(CurrentRecord);
setInnerFieldText(currentItem);
System.out.println(CurrentRecord);//Checking RECORD_NUM
if(currentItem == MaxItems){
internalnextbtn.setEnabled(false);
innerrightpanel.add(internalnextbtn, GBC);
return innerrightpanel;
public JPanel createInnerLeftPanel(){
innerleftpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
innerleftpanel.setBackground(TxtfontColor);
innerleftpanel.setBorder(BorderFactory.createLoweredBevelBorder());
innerleftpanel.setForeground(Color.BLACK);
innerleftpanel.setLayout(new GridBagLayout());
GridBagConstraints GBC = new GridBagConstraints();
GBC.fill = GridBagConstraints.HORIZONTAL;
internalprevbtn = new JButton(createPreviousButtonIcon());
GBC.gridx = 1;
GBC.gridy = 1;
internalprevbtn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
//getInnerFieldText(currentItem);
internalnextbtn.setEnabled(true);
if(currentItem == 1){
internalprevbtn.setEnabled(false);
if(currentItem > 0){
--currentItem;
//readOrder();
setInnerFieldText(currentItem);
innerleftpanel.add(internalprevbtn, GBC);
return innerleftpanel;
public JPanel createCustOrdDetailsButtons(){
createbuttonpanel();
buttonpanel.setBackground(TxtfontColor);
externalprevbtn = new JButton(createPreviousButtonIcon());
externalprevbtn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
getFieldText(CurrentRecord);
externalnextbtn.setEnabled(true);
if(CurrentRecord == 1){
externalprevbtn.setEnabled(false);
if(CurrentRecord > 0){
--CurrentRecord;
setFieldText(CurrentRecord);
System.out.println(CurrentRecord);//Checking RECORD_NUM
buttonpanel.add(externalprevbtn);
addrecordbtn = new JButton("Add Record", createAddButtonIcon());
addrecordbtn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
try{
MaxRecord = readRecordNumber();
MaxRecord++;
writeRecordNumber(MaxRecord);
//--<BEGINNING>--Clear Fields-------------------------------------------------------//
CustIDTxt.setText("");
CustOrderIDTxt.setText(""+MaxRecord);
//Get today's date
Date todaydate = new Date();
OrderedDateTxt.setText(""+simpleDF.format(todaydate));
ItemNumberTxt.setText("");
UnitPriceTxt.setText("");
QuantityReqTxt.setText("");
TotPriceTxt.setText("");
GrandTotTxt.setText("");
//--<END>--Clear Fields-------------------------------------------------------------//
externalnextbtn.setEnabled(false);
externalprevbtn.setEnabled(true);
System.out.println(MaxRecord);
} catch(Exception ec){ec.printStackTrace();}
buttonpanel.add(addrecordbtn);
savebtn = new JButton("Save Data", createSaveButtonIcon());
savebtn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
setFieldText(CurrentRecord);
writeOrder();
writeRecordNumber(MaxRecord);
System.out.println(CurrentRecord);
System.out.println(MaxRecord);
buttonpanel.add(savebtn);
java.net.URL imageURL_AddRowIcon = CommonFeatures.class.getResource("Icons/edit_add.png");
ImageIcon AddRowIcon = new ImageIcon(imageURL_AddRowIcon);
additemreqbtn = new JButton("Add Item", AddRowIcon);
additemreqbtn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
try{
//--<BEGINNING>--Clear Fields-------------------------------------------------------//
ItemNumberTxt.setText("");
UnitPriceTxt.setText("");
QuantityReqTxt.setText("");
TotPriceTxt.setText("");
//--<END>--Clear Fields-------------------------------------------------------------//
//CurrentRecord = MaxRecord;
currentItem++;
setInnerFieldText(currentItem);
internalnextbtn.setEnabled(false);
internalprevbtn.setEnabled(true);
System.out.println(MaxRecord);
} catch(Exception ec){ec.printStackTrace();}
buttonpanel.add(additemreqbtn);
externalnextbtn = new JButton(createNextButtonIcon());
externalnextbtn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
getFieldText(CurrentRecord);
externalprevbtn.setEnabled(true);
if(CurrentRecord < MaxRecord){
++CurrentRecord;
setFieldText(CurrentRecord);
System.out.println(CurrentRecord);//Checking RECORD_NUM
if(CurrentRecord == MaxRecord){
externalnextbtn.setEnabled(false);
buttonpanel.add(externalnextbtn);
return buttonpanel;
//TODO
public void setFieldText(int orderID){//TODO
orderDetails[orderID].setCustID(Integer.parseInt(CustIDTxt.getText()));
orderDetails[orderID].setCustOrderID(Integer.parseInt(CustOrderIDTxt.getText()));
orderDetails[orderID].setOrderDate(OrderedDateTxt.getText());
orderDetails[orderID].setInnerCustOrdObj(innerCustOrdObj);
orderDetails[orderID].setMaxItems(MaxItems);
setInnerFieldText(currentItem);
orderDetails[orderID].setGrandTotal(Float.parseFloat(GrandTotTxt.getText()));
public void setInnerFieldText(int currentItem){//TODO
innerCustOrdObj[currentItem] = new InnerCustOrdObject();
innerCustOrdObj[currentItem].setItemNumber(Integer.parseInt(ItemNumberTxt.getText()));
innerCustOrdObj[currentItem].setUnitPrice(Float.parseFloat(UnitPriceTxt.getText()));
innerCustOrdObj[currentItem].setQuantityRequired(Integer.parseInt(QuantityReqTxt.getText()));
innerCustOrdObj[currentItem].setTotalPrice(Float.parseFloat(TotPriceTxt.getText()));
public void getFieldText(int orderID){
CustIDTxt.setText(Integer.toString(orderDetails[orderID].getCustID()));
CustOrderIDTxt.setText(Integer.toString(orderDetails[orderID].getCustOrderID()));
OrderedDateTxt.setText(""+orderDetails[orderID].getOrderDate());
currentItem = orderDetails[orderID].getMaxItems();
System.err.println("currentItem" + currentItem);
getInnerFieldText(currentItem);
GrandTotTxt.setText(Float.toString(orderDetails[orderID].getGrandTotal()));
public void getInnerFieldText(int currentItem){
ItemNumberTxt.setText(Integer.toString(innerCustOrdObj[currentItem].getItemNumber()));
UnitPriceTxt.setText(Float.toString(innerCustOrdObj[currentItem].getUnitPrice()));
QuantityReqTxt.setText(Integer.toString(innerCustOrdObj[currentItem].getQuantityRequired()));
TotPriceTxt.setText(Float.toString(innerCustOrdObj[currentItem].getTotalPrice()));
public void writeOrder(){//TODO
try {
objOut = new ObjectOutputStream(new FileOutputStream(OrderDetailsFile));
objOut.writeObject(orderDetails);
System.out.println("WORKING!");
objOut.flush();
objOut.close();
} catch (IOException e) {
e.printStackTrace();
public Object readOrder(){
Object temporaryObj;
try{
objIn = new ObjectInputStream(new FileInputStream(OrderDetailsFile));
temporaryObj = objIn.readObject();
CustOrdObject[] blah = (CustOrdObject[]) temporaryObj;
System.out.println("Outer: "+blah[1].getCustID());
InnerCustOrdObject[] whee = blah[1].getInnerCustOrdObj();
System.out.println("Inner: "+whee[1].getItemNumber());
objIn.close();
System.out.println("Read Worky!");
return temporaryObj;
}catch(Exception e){
e.printStackTrace();
System.out.println("Read No Worky!");
return null;
public void writeRecordNumber(int MaxRecord){
try{
objOut = new ObjectOutputStream(new FileOutputStream(OrdRecordNumStore));
objOut.writeObject(MaxRecord);
System.out.println("WORKING!");
objOut.flush();
objOut.close();
}catch(Exception e){e.printStackTrace();}
public int readRecordNumber() {
try {
objIn = new ObjectInputStream(new FileInputStream(OrdRecordNumStore));
int temporaryObj = Integer.parseInt(objIn.readObject().toString());
objIn.close();
System.out.println("Read Number Worky!");
return temporaryObj;
} catch (Exception e) {
e.printStackTrace();
System.out.println("Read Number No Worky!");
return -1;
}Message was edited by:
Kilik07
Message was edited by:
Kilik07ok i got reading to work to a certain extent... but the prob is i cnt seem to save my innerCustOrdObj proprly...when ever i look for a record using the gotorecordbtn, the outerobject, which is the orderDetails, seems to change but the innerCustOrdObj remains the same... heres the new code..
public class CustomerOrderDetails extends CommonFeatures{
//TODO
private static int MAX_ORDERS = 200;
private static int MAX_ORDERITEMS = 100;
private static int MaxRecord;
private static int CurrentRecord = 1;
private static int currentItem;
private static int MaxItems = 1;
private static boolean FileExists, recFileExists;
private static boolean RecordExists;
private static CustOrdObject[] orderDetails = new CustOrdObject[MAX_ORDERS];
private static InnerCustOrdObject[] innerCustOrdObj = new InnerCustOrdObject[MAX_ORDERITEMS];
private static File OrderDetailsFile = new File("CustOrdDetails.ser");
private static File OrdRecordNumStore = new File("OrdRecordNumStore.txt");
private static PrintWriter writeFile;
private static BufferedReader readFile;
private static ObjectOutputStream objOut;
private static ObjectInputStream objIn;
//Set format for date
SimpleDateFormat simpleDF = new SimpleDateFormat("dd MM yyyy");
//--<BEGINNING>--Declaring Interface Variables------------------------------------------//
private JPanel innertoppanel, innercenterpanel, innerbottompanel, innerrightpanel, innerleftpanel;
private JLabel CustIDLbl, CustOrderIDLbl, OrderedDateLbl, GrandTotLbl, ItemNumberLbl,UnitPriceLbl, QuantityReqLbl, TotPriceLbl;
private JTextField CustIDTxt, CustOrderIDTxt, OrderedDateTxt, GrandTotTxt, ItemNumberTxt, UnitPriceTxt, QuantityReqTxt, TotPriceTxt;
private JButton addrecordbtn, savebtn, externalprevbtn, externalnextbtn, internalprevbtn, internalnextbtn, gotorecordbtn, additemreqbtn;
//--<END>--Declaring Interface Variables------------------------------------------------//
public static void main(String[] args) {
final CustomerOrderDetails COD = new CustomerOrderDetails();
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
COD.createCustOrdDetailsScreen();
} catch (Exception eb) {
eb.printStackTrace();
//--<BEGINNING>--Creating CustomerOrderDetails Screen---------------------------------------//
public JFrame createCustOrdDetailsScreen() {
createDefaultFrame();
mainframe.setSize(800,500);
createContainerPanel();
containerpanel.add(createCustOrdDetailsTitle(), BorderLayout.NORTH);
containerpanel.add(createCustOrdDetailsMainPanel(), BorderLayout.CENTER);
//containerpanel.add(createCustOrdDetailsLeftNavButtons(), BorderLayout.WEST);
//containerpanel.add(createCustOrdDetailsRightNavButtons(), BorderLayout.EAST);
containerpanel.add(createCustOrdDetailsButtons(), BorderLayout.SOUTH);
mainframe.setContentPane(containerpanel);
mainframe.setLocationRelativeTo(null);
mainframe.setVisible(true);
//--<BEGINNING>--Checks to see whether CRecordNumberStore file exists-------------------------------//
if (OrdRecordNumStore.exists() == true) {
recFileExists = true;
}else {
recFileExists = false;
if (recFileExists == true) {
MaxRecord = readRecordNumber();
CurrentRecord = MaxRecord;
//readOrder();
//readInnerOrderRecord(CurrentRecord);
System.out.println("Current Record " +CurrentRecord);
System.out.println("Max Record " +MaxRecord);
}else{
MaxRecord = 1;
writeRecordNumber(MaxRecord);
CustOrderIDTxt.setText(""+MaxRecord);
System.out.println("Current Record " +CurrentRecord);
System.out.println("Max Record " +MaxRecord);
//--<END>--Checks to see whether CRecordNumberStore file exists--------------------------------------//
if(readOrder() != null){
orderDetails = (CustOrdObject[]) readOrder();
//CurrentRecord--;
//System.out.println("Current Rec Here"+CurrentRecord);
if(orderDetails[CurrentRecord] == null){
System.err.println("CustomerOrderObj 1 is null !!");
}else{
System.err.println("CustomerOrderObj 1 is not null !!");
if(orderDetails[CurrentRecord].getInnerCustOrdObj() == null){
System.err.println("InnerCustomerOrderObj is null !!");
}else{
System.err.println("InnerCustomerOrderObj is not null !!");
innerCustOrdObj = orderDetails[CurrentRecord].getInnerCustOrdObj();
MaxItems = orderDetails[CurrentRecord].getMaxItems();
if(CurrentRecord > 1 && CurrentRecord < MaxRecord){
externalnextbtn.setEnabled(true);
externalprevbtn.setEnabled(true);
if(CurrentRecord >= MaxRecord){
externalnextbtn.setEnabled(false);
getFieldText(CurrentRecord);
getInnerFieldText(MaxItems);
}else{
orderDetails[CurrentRecord] = new CustOrdObject();
currentItem = 1;
return mainframe;
//--<END>--Creating CustomerOrderDetails Screen---------------------------------------------//
public JPanel createCustOrdDetailsTitle(){
createTitlePanel();
titlepanel.setBackground(TxtfontColor);
label.setText("- Customer Order Details -");
labelpanel.setBackground(TxtfontColor);
label.setForeground(Color.white);
createbuttonpanel();
buttonpanel.setBackground(TxtfontColor) ;
buttonpanel.add(createReturnToMainMenuButton());
titlepanel.add(labelpanel, BorderLayout.WEST);
titlepanel.add(buttonpanel, BorderLayout.EAST);
return titlepanel;
public JPanel createCustOrdDetailsMainPanel(){
createmainpanel();
mainpanel.setBackground(TxtfontColor);
mainpanel.setLayout(new BorderLayout());
mainpanel.setBorder(BorderFactory.createTitledBorder(""));
mainpanel.add(createInnerTopPanel(), BorderLayout.NORTH);
mainpanel.add(createInnerCenterPanel(), BorderLayout.CENTER);
mainpanel.add(createInnerBottomPanel(), BorderLayout.SOUTH);
mainpanel.add(createInnerRightPanel(), BorderLayout.EAST);
mainpanel.add(createInnerLeftPanel(), BorderLayout.WEST);
return mainpanel;
public JPanel createInnerTopPanel(){
innertoppanel = new JPanel(new GridBagLayout());
innertoppanel.setBackground(TxtfontColor);
GridBagConstraints GBC = new GridBagConstraints();
GBC.fill = GridBagConstraints.HORIZONTAL;
//Setting Font Type and Size
Font font = new Font("Arial", Font.BOLD, 11);
CustIDLbl = new JLabel("Customer ID");
CustIDLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
CustIDLbl.setFont(font);
CustIDLbl.setForeground(LblfontColor);
GBC.gridx = 1;
GBC.gridy = 1;
innertoppanel.add(CustIDLbl, GBC);
CustIDTxt = new JTextField(20);
CustIDTxt.setEditable(true);
GBC.gridx = 2;
GBC.gridy = 1;
innertoppanel.add(CustIDTxt, GBC);
GBC.gridx = 3;
GBC.gridy = 1;
innertoppanel.add(Box.createHorizontalStrut(220), GBC);
OrderedDateLbl = new JLabel("Order Date");
OrderedDateLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
OrderedDateLbl.setFont(font);
OrderedDateLbl.setForeground(LblfontColor);
GBC.gridx = 4;
GBC.gridy = 1;
innertoppanel.add(OrderedDateLbl, GBC);
//Get today's date
Date todaydate = new Date();
OrderedDateTxt = new JTextField(simpleDF.format(todaydate), 20);
OrderedDateTxt.setHorizontalAlignment(JTextField.CENTER);
OrderedDateTxt.setEditable(false);
GBC.gridx = 5;
GBC.gridy = 1;
innertoppanel.add(OrderedDateTxt, GBC);
CustOrderIDLbl = new JLabel("Customer Order ID");
CustOrderIDLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
CustOrderIDLbl.setFont(font);
CustOrderIDLbl.setForeground(LblfontColor);
GBC.gridx = 1;
GBC.gridy = 2;
innertoppanel.add(CustOrderIDLbl, GBC);
CustOrderIDTxt = new JTextField(20);
//CustOrderIDTxt.setEditable(false);
GBC.gridx = 2;
GBC.gridy = 2;
innertoppanel.add(CustOrderIDTxt, GBC);
return innertoppanel;
public JPanel createInnerCenterPanel(){
innercenterpanel = new JPanel(new GridBagLayout());
innercenterpanel.setBackground(TxtfontColor);
innercenterpanel.setBorder(BorderFactory.createLoweredBevelBorder());
GridBagConstraints GBC = new GridBagConstraints();
GBC.fill = GridBagConstraints.HORIZONTAL;
//Setting Font Type and Size
Font font = new Font("Arial", Font.BOLD, 11);
ItemNumberLbl = new JLabel("Item Number");
ItemNumberLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
ItemNumberLbl.setFont(font);
ItemNumberLbl.setForeground(LblfontColor);
GBC.gridx = 1;
GBC.gridy = 1;
innercenterpanel.add(ItemNumberLbl, GBC);
ItemNumberTxt = new JTextField(20);
GBC.gridx = 2;
GBC.gridy = 1;
innercenterpanel.add(ItemNumberTxt, GBC);
UnitPriceLbl = new JLabel("Unit Price");
UnitPriceLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
UnitPriceLbl.setFont(font);
UnitPriceLbl.setForeground(LblfontColor);
GBC.gridx = 1;
GBC.gridy = 2;
innercenterpanel.add(UnitPriceLbl, GBC);
UnitPriceTxt = new JTextField(20);
//UnitPriceTxt.setEditable(false);
GBC.gridx = 2;
GBC.gridy = 2;
innercenterpanel.add(UnitPriceTxt, GBC);
QuantityReqLbl = new JLabel("Quantity Required");
QuantityReqLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
QuantityReqLbl.setFont(font);
QuantityReqLbl.setForeground(LblfontColor);
GBC.gridx = 1;
GBC.gridy = 3;
innercenterpanel.add(QuantityReqLbl, GBC);
QuantityReqTxt = new JTextField(20);
//QuantityReqTxt.setEditable(false);
GBC.gridx = 2;
GBC.gridy = 3;
innercenterpanel.add(QuantityReqTxt, GBC);
TotPriceLbl = new JLabel("Total Price");
TotPriceLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
TotPriceLbl.setFont(font);
TotPriceLbl.setForeground(LblfontColor);
GBC.gridx = 1;
GBC.gridy = 4;
innercenterpanel.add(TotPriceLbl, GBC);
TotPriceTxt = new JTextField(20);
TotPriceTxt.setEditable(false);
TotPriceTxt.addFocusListener(new FocusAdapter(){
public void focusGained(FocusEvent evt){
TotPriceTxt.setText(""+Integer.parseInt(UnitPriceTxt.getText())*Integer.parseInt(QuantityReqTxt.getText()));
GBC.gridx = 2;
GBC.gridy = 4;
innercenterpanel.add(TotPriceTxt, GBC);
return innercenterpanel;
public JPanel createInnerBottomPanel(){
innerbottompanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
innerbottompanel.setBackground(TxtfontColor);
//Setting Font Type and Size
Font font = new Font("Arial", Font.BOLD, 11);
GrandTotLbl = new JLabel("Grand Total");
GrandTotLbl.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
GrandTotLbl.setFont(font);
GrandTotLbl.setForeground(LblfontColor);
innerbottompanel.add(GrandTotLbl);
innerbottompanel.add(Box.createHorizontalStrut(30));
GrandTotTxt = new JTextField(20);
innerbottompanel.add(GrandTotTxt);
return innerbottompanel;
public JPanel createInnerRightPanel(){
innerrightpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
innerrightpanel.setBackground(TxtfontColor);
innerrightpanel.setLayout(new BoxLayout(navrightpanel, BoxLayout.Y_AXIS));
innerrightpanel.setBorder(BorderFactory.createLoweredBevelBorder());
innerrightpanel.setLayout(new GridBagLayout());
GridBagConstraints GBC = new GridBagConstraints();
GBC.fill = GridBagConstraints.HORIZONTAL;
internalnextbtn = new JButton(createNextButtonIcon());
GBC.gridx = 1;
GBC.gridy = 1;
internalnextbtn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
getInnerFieldText(currentItem);
internalprevbtn.setEnabled(true);
if(currentItem < MaxItems){
++currentItem;
orderDetails[CurrentRecord].getInnerCustOrdObj();
setInnerFieldText(currentItem);
System.out.println("Current Item" + currentItem);
if(currentItem == MaxItems){
internalnextbtn.setEnabled(false);
innerrightpanel.add(internalnextbtn, GBC);
return innerrightpanel;
public JPanel createInnerLeftPanel(){
innerleftpanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
innerleftpanel.setBackground(TxtfontColor);
innerleftpanel.setBorder(BorderFactory.createLoweredBevelBorder());
innerleftpanel.setForeground(Color.BLACK);
innerleftpanel.setLayout(new GridBagLayout());
GridBagConstraints GBC = new GridBagConstraints();
GBC.fill = GridBagConstraints.HORIZONTAL;
internalprevbtn = new JButton(createPreviousButtonIcon());
GBC.gridx = 1;
GBC.gridy = 1;
internalprevbtn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
getInnerFieldText(currentItem);
internalnextbtn.setEnabled(true);
if(currentItem == 1){
internalprevbtn.setEnabled(false);
if(currentItem > 0){
--currentItem;
orderDetails[CurrentRecord].getInnerCustOrdObj();
setInnerFieldText(currentItem);
System.out.println("Current Item" + currentItem);
innerleftpanel.add(internalprevbtn, GBC);
return innerleftpanel;
public JPanel createCustOrdDetailsButtons(){
createbuttonpanel();
buttonpanel.setBackground(TxtfontColor);
externalprevbtn = new JButton(createPreviousButtonIcon());
externalprevbtn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
getFieldText(CurrentRecord);
externalnextbtn.setEnabled(true);
if(CurrentRecord == 1){
externalprevbtn.setEnabled(false);
if(CurrentRecord > 0){
--CurrentRecord;
setFieldText(CurrentRecord);
System.out.println("Current Record " + CurrentRecord);//Checking RECORD_NUM
buttonpanel.add(externalprevbtn);
addrecordbtn = new JButton("Add Record", createAddButtonIcon());
addrecordbtn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
try{
MaxRecord = readRecordNumber();
MaxRecord++;
CurrentRecord = MaxRecord;
orderDetails[CurrentRecord] = new CustOrdObject();
writeRecordNumber(MaxRecord);
MaxItems = 1;
innerCustOrdObj[MaxItems] = new InnerCustOrdObject();
//--<BEGINNING>--Clear Fields-------------------------------------------------------//
CustIDTxt.setText("");
CustOrderIDTxt.setText(""+MaxRecord);
//Get today's date
Date todaydate = new Date();
OrderedDateTxt.setText(""+simpleDF.format(todaydate));
ItemNumberTxt.setText("");
UnitPriceTxt.setText("");
QuantityReqTxt.setText("");
TotPriceTxt.setText("");
GrandTotTxt.setText("");
//--<END>--Clear Fields-------------------------------------------------------------//
externalnextbtn.setEnabled(false);
externalprevbtn.setEnabled(true);
System.out.println(MaxRecord);
} catch(Exception ec){ec.printStackTrace();}
buttonpanel.add(addrecordbtn);
savebtn = new JButton("Save Data", createSaveButtonIcon());
savebtn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
setFieldText(CurrentRecord);
setInnerFieldText(MaxItems);
writeOrder();
writeRecordNumber(MaxRecord);
System.out.println(CurrentRecord);
System.out.println(MaxRecord);
buttonpanel.add(savebtn);
java.net.URL imageURL_AddRowIcon = CommonFeatures.class.getResource("Icons/edit_add.png");
ImageIcon AddRowIcon = new ImageIcon(imageURL_AddRowIcon);
additemreqbtn = new JButton("Add Item", AddRowIcon);
additemreqbtn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
try{
//--<BEGINNING>--Clear Fields-------------------------------------------------------//
ItemNumberTxt.setText("");
UnitPriceTxt.setText("");
QuantityReqTxt.setText("");
TotPriceTxt.setText("");
//--<END>--Clear Fields-------------------------------------------------------------//
//CurrentRecord = MaxRecord;
MaxItems++;
innerCustOrdObj[MaxItems] = new InnerCustOrdObject();
System.out.println("Max Items "+MaxItems);
currentItem = MaxItems;
orderDetails[CurrentRecord].setMaxItems(MaxItems);
///setInnerFieldText(currentItem);
internalnextbtn.setEnabled(false);
internalprevbtn.setEnabled(true);
} catch(Exception ec){ec.printStackTrace();}
buttonpanel.add(additemreqbtn);
externalnextbtn = new JButton(createNextButtonIcon());
externalnextbtn.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
getFieldText(CurrentRecord);
externalprevbtn.setEnabled(true);
if(CurrentRecord < MaxRecord){
++CurrentRecord;
setFieldText(CurrentRecord);
System.out.println(CurrentRecord);//Checking RECORD_NUM
if(CurrentRecord == MaxRecord){
externalnextbtn.setEnabled(false);
buttonpanel.add(externalnextbtn);
gotorecordbtn = new JButton("Go To Record", createGotoButtonIcon());
gotorecordbtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt){
* The text from the GotorecordTxt textfield will be taken and assigned
* to a temporary integer variable called Find.
int Find = Integer.parseInt(CustOrderIDTxt.getText());
for(int j=1; j <= MaxRecord; j++){
* Using a for loop, each record can be read using the readCustRecord
* method.
getFieldText(j);
* An if condition is utilized to check whether the temporary stored variable, Find,
* matches a field in a record. If this record is found, then using the RecordExists
* which was declared at the top, either a true or false statement can be assigned
* If the record exists, then a true statement will be assigned, if not a false
* statement will be assigned.
if(orderDetails[j].getCustOrderID() == Find){
RecordExists = true;
break;
}else{
RecordExists = false;
if(RecordExists == false){
* If the RecordExists is assigned a false statement, then a message will be
* displayed to show that the record does not exist.
JOptionPane.showMessageDialog(null, "Record Does Not Exist!", "Error Message", JOptionPane.ERROR_MESSAGE, createErrorIcon());
}else{
getFieldText(Find);
buttonpanel.add(gotorecordbtn);
return buttonpanel;
//TODO
public void setFieldText(int orderID){//TODO
orderDetails[orderID].setCustID(Integer.parseInt(CustIDTxt.getText()));
orderDetails[orderID].setCustOrderID(Integer.parseInt(CustOrderIDTxt.getText()));
orderDetails[orderID].setOrderDate(OrderedDateTxt.getText());
orderDetails[orderID].setInnerCustOrdObj(innerCustOrdObj);
orderDetails[orderID].setMaxItems(MaxItems);
setInnerFieldText(currentItem);
orderDetails[orderID].setGrandTotal(Float.parseFloat(GrandTotTxt.getText()));
public void setInnerFieldText(int currentItem){//TODO
innerCustOrdObj[currentItem] = new InnerCustOrdObject();
innerCustOrdObj[currentItem].setMaxItems(MaxItems);
innerCustOrdObj[currentItem].setItemNumber(Integer.parseInt(ItemNumberTxt.getText()));
innerCustOrdObj[currentItem].setUnitPrice(Float.parseFloat(UnitPriceTxt.getText()));
innerCustOrdObj[currentItem].setQuantityRequired(Integer.parseInt(QuantityReqTxt.getText()));
innerCustOrdObj[currentItem].setTotalPrice(Float.parseFloat(TotPriceTxt.getText()));
public void getFieldText(int orderID){
CustIDTxt.setText(Integer.toString(orderDetails[orderID].getCustID()));
CustOrderIDTxt.setText(Integer.toString(orderDetails[orderID].getCustOrderID()));
OrderedDateTxt.setText(""+orderDetails[orderID].getOrderDate());
currentItem = orderDetails[orderID].getMaxItems();
orderDetails[orderID].getInnerCustOrdObj();
System.err.println("currentItem" + currentItem);
//getInnerFieldText(currentItem);
GrandTotTxt.setText(Float.toString(orderDetails[orderID].getGrandTotal()));
public void getInnerFieldText(int currentItem){
ItemNumberTxt.setText(Integer.toString(innerCustOrdObj[currentItem].getItemNumber()));
UnitPriceTxt.setText(Float.toString(innerCustOrdObj[currentItem].getUnitPrice()));
QuantityReqTxt.setText(Integer.toString(innerCustOrdObj[currentItem].getQuantityRequired()));
TotPriceTxt.setText(Float.toString(innerCustOrdObj[currentItem].getTotalPrice()));
public void writeOrder(){//TODO
try {
objOut = new ObjectOutputStream(new FileOutputStream(OrderDetailsFile));
objOut.writeObject(orderDetails);
System.out.println("WORKING!");
objOut.flush();
objOut.close();
} catch (IOException e) {
e.printStackTrace();
public Object readOrder(){
Object temporaryObj;
try{
objIn = new ObjectInputStream(new FileInputStream(OrderDetailsFile));
temporaryObj = objIn.readObject();
CustOrdObject[] blah = (CustOrdObject[]) temporaryObj;
/* System.out.println("Outer: "+blah[1].getCustID());
InnerCustOrdObject[] whee = blah[1].getInnerCustOrdObj();
System.out.println("Inner: "+whee[1].getItemNumber());*/
objIn.close();
System.out.println("Read Worky!");
return temporaryObj;
}catch(Exception e){
e.printStackTrace();
System.out.println("Read No Worky!");
return null;
public void writeRecordNumber(int MaxRecord){
try{
objOut = new ObjectOutputStream(new FileOutputStream(OrdRecordNumStore));
objOut.writeObject(MaxRecord);
System.out.println("WORKING!");
objOut.flush();
objOut.close();
}catch(Exception e){e.printStackTrace();}
public int readRecordNumber() {
try {
objIn = new ObjectInputStream(new FileInputStream(OrdRecordNumStore));
int temporaryObj = Integer.parseInt(objIn.readObject().toString());
objIn.close();
System.out.println("Read Number Worky!");
return temporaryObj;
} catch (Exception e) {
e.printStackTrace();
System.out.println("Read Number No Worky!");
return -1;
}Message was edited by:
Kilik07 -
Trying to serialize C# object and store as XML Datatype in Sql Server 2005
using
if (Obj != null)
MemoryStream stream = new MemoryStream();
StreamWriter writer = new StreamWriter(stream);
XmlSerializer x = new XmlSerializer(Obj.GetType());
x.Serialize(writer, Obj);
writer.Close();
byte[] arr = stream.GetBuffer();
return Encoding.UTF8.GetString(arr).Trim();
The object looks like
public class CorporateBondSec : BaseSecurity
public double coupon; // CPN
public string couponType; // CPN_TYPE
public int couponFreq; // CPN_FREQ
public string floater; // FLOATER
public int resetFreq; //REFIX_FREQ
public DateTime resetDate; //NXT_REFIX_DT
public DateTime firstCpnDate; //FIRST_CPN_DT
XML looks like
'<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<CorporateBondSec xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n <coupon>8</coupon>\r\n <couponType>FIXED</couponType>\r\n <couponFreq>2</couponFreq>\r\n <floater>N</floater>\r\n <resetFreq>0</resetFreq>\r\n <resetDate>0001-01-01T00:00:00</resetDate>\r\n <firstCpnDate>0001-01-01T00:00:00</firstCpnDate>\r\n</CorporateBondSec>'
Error from SQL
Msg 9413, Level 16, State 1, Procedure procSecuritiesInsert, Line 0
XML parsing: line 1, character 15, A string literal was expected
I have also tried
XmlSerializer x = new XmlSerializer(Obj.GetType());
System.Text.StringBuilder builder = new System.Text.StringBuilder();
x.Serialize(XmlWriter.Create(builder), Obj);
return builder.ToString();
That gives me an XML
'<?xml version=\"1.0\" encoding=\"utf-16\"?>
<CorporateBondSec xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">
<coupon>8</coupon>
<couponType>FIXED</couponType>
<couponFreq>2</couponFreq>
<floater>N</floater>
<resetFreq>0</resetFreq>
<resetDate>0001-01-01T00:00:00</resetDate>
<firstCpnDate>0001-01-01T00:00:00</firstCpnDate>
</CorporateBondSec>'
Error
Msg 9413, Level 16, State 1, Procedure procSecuritiesInsert, Line 0
XML parsing: line 1, character 15, A string literal was expectedTony,
this is how your XML should look like.
Code Snippet
'<?xml version="1.0" encoding="utf-16"?>
<CorporateBondSec xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<coupon>8</coupon>
<couponType>FIXED</couponType>
<couponFreq>2</couponFreq>
<floater>N</floater>
<resetFreq>0</resetFreq>
<resetDate>0001-01-01T00:00:00</resetDate>
<firstCpnDate>0001-01-01T00:00:00</firstCpnDate>
</CorporateBondSec>'
I see you have a few extra '\' characters before double quotes. you need to remove them. -
Web Service From Java class, serialization problem
Hi,
I want to create Web Service from Java class, I made java project, generated web service from it, create web service archive project and deployed it to WAS 6.40.
My class have 2 methods,
public int add(int a, int b);
public MyResponse doSomthing(MyRequest req);
I can succesfully call add method from Web Service Navigator, it works fine but when I call doSomthing methods I get the following error:
<b>
Deserializing fails. Nested message: XML Deserialization Error. Result class [com.mycomp.sap_tech.ws.MyRequest] does not have property [Amount] of type [java.lang.String]. It is required to load XML..
</b>
Any ideas how to resolve it?
P.S. MyRequest class is exposed throw VI, has default constractor and public getters and setters for all properties. It implements Serializable as well. Any guesses?
Thanks in advance,
Victor.Hi Bhavik, thanks for response.
as I already mentioned it implements Serializable, so it is not the problem.
Thanks Avi but it didn't helps iether
Victor -
Hi to all.
I have two classes.
The first is:
public class FatherBean implements Serializable {
public String name;
public int id;
/** Creates a new instance of ChildBean */
public FatherBean() {
this.name= null;
this.id = 0;
public String getName() {
return name;
public void setName(String name) {
this.name = name;
public int getId() {
return id;
public void setId(int id) {
this.id = id;
The second is :
public class ChildBean extends FatherBean implements Serializable {
public double number;
/** Creates a new instance of ChildBean */
public ChildBean() {
super();
this.number = 0.0;
public double getNumber() {
return number;
public void setNumber(double number) {
this.number = number;
A test client class implements the following method that is exposed as web service:
public java.util.Collection getBeans() {
java.util.Collection beans = new ArrayList();
ChildBean childBean1 = new ChildBean();
ChildBean childBean2 = new ChildBean();
childBean1.setId(100);
childBean1.setName("pippo");
childBean1.setNumber(3.9);
childBean2.setId(100000);
childBean2.setName("pluto");
childBean2.setNumber(4.7);
beans.add(childBean1);
beans.add(childBean2);
return beans;
When I invoke the web service to url:
http://localhost:8080/Prova
and invoke the correspondent method on jsp client, throws exception:
java.rmi.ServerException: Internal Server Error (serialization error: no serializer is registered for (class test.ChildBean, null))
at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:357)
at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
at ws.ProvaClientGenClient.ProvaRPC_Stub.getBeans(ProvaRPC_Stub.java:59)
at ws.ProvaClientGenClient.getBeans_handler.doAfterBody(getBeans_handler.java:64)
at jasper.getBeans_TAGLIB_jsp._jspService(_getBeans_TAGLIB_jsp.java:121)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:552)
at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:368)
at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:287)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
Where is the problem? Will be ChildBean that extends FatherBean? Wich settings on Sun Java Studio Enterprise 6 2004Q1?
Thank you.Hi,
This forum is for Sun Java Studio Creator related questions. Could you pls post your message in the appropriate forum.
Thank you
Cheers :-) -
Problem with serial.serialize(doc) ;statement
hi this is my code but iam having problem in the aboe statement iam using net beans and it says cannot find symbol serialize while it is still in the package import {com.sun.org.apache.xml.internal.serialize.XMLSerializer;}
package newPack;
import org.jdom.Document;
import org.jdom.JDOMFactory;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
//import org.w3c.dom.Document;
import java.sql.DriverManager;
import javax.xml.parsers.ParserConfigurationException;
import java.sql.ResultSet;
import java.sql.SQLException;
//import org.w3c.dom.Element;
import java.sql.ResultSetMetaData;
import com.sun.org.apache.xml.internal.serialize.OutputFormat;
import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
import java.io.StringWriter;
import java.io.IOException;
import org.jdom.Element;
import org.jdom.Document;
public class Conversion {
// public DocumentBuilderFactory dbf;
// public DocumentBuilder dob;
// public Document doc;
/** Creates a new instance of Conversion */
public static Document convert(ResultSet rs) throws ParserConfigurationException,SQLException
// DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
//DocumentBuilder builder=dbf.newDocumentBuilder();
// Document doc=builder.newDocument();
Element root=new Element("Artist");
//doc.appendChild(root);
ResultSetMetaData rsmd = rs.getMetaData();
int colCount = rsmd.getColumnCount();
while (rs.next())
Element songo= new Element("song1");
root.addContent(songo);
//root.appendChild(songo);
for (int i = 1; i <= colCount; i++)
String columnName = rsmd.getColumnName(i);
Object value = rs.getObject(i);
Element node = new Element(columnName);
node.setText(value.toString());
songo.addContent(node);
Document doc=new Document(root);
return doc;
public static String serialized(Document doc) throws IOException
StringWriter writer = new StringWriter();
OutputFormat format = new OutputFormat();
format.setIndenting(true);
XMLSerializer serial = new XMLSerializer(writer,format);
serial.serialize(doc);
return writer.getBuffer().toString();
}VISA is the generic communication interface.
Hyperterminal has serial comm drivers as well. It just so happens that Hyperterminal is using the serial comm drivers that are built into Windows. That's why you don't notice them.
If you installed LabVIEW, then you should have installed the drivers that come with it. It is on a separate DVD. Obviously you haven't.
Maybe you are looking for
-
New itunes wont recognize my ipod
i few days ago my ipod ran out of battery so i plugged it into the wall charger. the apple logo came up for a long time and when it went away all my songs were gone! so i plugged it into my labtop and itunes told me to update so i installed the new i
-
Inserting Flash in DW 8.0.2
I am trying to insert a flash file into my webpage using the update in DW8 that is supposed to automatically convert the tags to work in IE so the user doesn't have to activate the Flash content first. When I go to insert the flash onto my html page
-
Reloading JSP for a specific role's users
Hi all, We have a web application using JSPs. Our application has users and roles. A user is associated to a role. These are defined in 2 tables: create table role ( id int not null primary key, name varchar(50) not null ) create table user ( user_
-
Not able to change item category of a sales order in VA02
Hi, When I am going to transaction VA02 for changing an sales order it is not allowing me to change z item category of the line item. Can someone tell me if it is a configuration or some User exit/BADI might be there behind this behavior. Note: Recen
-
X blacks out... ATI HD3450 with FOSS driver
Hi everyone! I'm a formal Ubuntu user (was LOTS better that M$ **), I've installed Arch linux now. I'm booting fine (through ubuntu grub2, I'll 'fix' that later on), I love it. It's a clean OS, I'm planning LXDE. I've two users: myself and root. Inst