Problem with Berkeley DB JE using JCA

Hello, dear developers of JE
I have implemented Lucene Indexing on Berkeley DB JE. And I'm using the JBoss as application server. Accessing the Breekely DB using JCA.
The problem arises when i'm calling the Environment.close(). It's displaying following error message.
12:01:39,712 WARN [JBossManagedConnectionPool] Exception destroying ManagedConnection org.jboss.resource.connectionmanager.TxCo
javax.resource.ResourceException: com.sleepycat.je.DatabaseException: Attempt to use non-open Environment object().
at com.sleepycat.je.jca.ra.JEManagedConnection.destroy(JEManagedConnection.java:190)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.doDestroy(InternalManagedConnectionPool.java:550)
at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:1
at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.jav
at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:410)
at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:342)
at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:462)
at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionM
at com.sleepycat.je.jca.ra.JEConnectionFactoryImpl.getConnection(JEConnectionFactoryImpl.java:56)
at com.sleepycat.je.jca.ra.JEConnectionFactoryImpl.getConnection(JEConnectionFactoryImpl.java:43)
IT WOULD BE HIGHLY APPRECIATED IF EXPLANIN ME THE REASON
Thanks,
Katta

Hi Charles ,
I have implemented Transaction.setLockTimeout() and increased the lock timeout value to 500000.
But getting the same exception.
19:06:05,846 INFO [STDOUT] com.sleepycat.je.DatabaseException: Lock expired. Locker 14_http-0.0.0.0-8080-2_Txn: waited for lock on database=__index__ node=434 type=READ grant=WAIT_NEW timeoutMillis=50 startTime=1156167365784 endTime=1156167365846
Owners: [<LockInfo locker="13_RMI TCP Connection(2)-192.168.10.60_Txn" type="WRITE"/>].
Waiters: []
The lucene index update process may take approximately 40 to 50 minutes.
Please go through the following code what i written.
public class BerkelyDBConfig
private static Logger logger = Logger.getLogger(BerkelyDBConfig.class);
private static final String JE_ENV_HOME = "D://berkeley//index";
protected static JEConnection jeConnection = null;
protected static Environment env = null;
protected static Transaction txn=null;
* @param dbEnvHome
* @return directory [Directory]
* @throws DatabaseException
* @throws JEException
public static Directory getDirectory() throws DatabaseException, JEException
Directory directory = null;
Database index, blocks;
try
jeConnection = getConnection();
env = jeConnection.getEnvironment();
DatabaseConfig dbConfig = new DatabaseConfig();
dbConfig.setAllowCreate(true);
dbConfig.setTransactional(true);
* Use JEConnection.openDatabase() to obtain a cached Database
* handle. Do not call close() on Database handles obtained
* using this method.
index = jeConnection.openDatabase("__index__", dbConfig);
blocks = jeConnection.openDatabase("__blocks__", dbConfig);
txn = env.getThreadTransaction();
txn.setLockTimeout(50000);
directory = new JEDirectory(txn, index, blocks);
} catch (NamingException e)
logger.error("Caught NamingException and message is::"+ e.getMessage());
throw new DatabaseException(e);
} catch (ResourceException e)
logger.error("Caught ResourceException and message is::"+ e.getMessage());
throw new DatabaseException(e);
} finally
env.cleanLog(); // Clean the log before closing
if (jeConnection != null)
jeConnection.close();
return directory;
* @return dc [JEConnection]
* @throws NamingException
* @throws JEException
public static JEConnection getConnection()
throws NamingException, JEException
EnvironmentConfig envConfig = new EnvironmentConfig();
envConfig.setAllowCreate(true);
envConfig.setTransactional(true);
//envConfig.setLockTimeout(50000000);
envConfig.setConfigParam("je.cleaner.expunge", "true");
InitialContext iniCtx = new InitialContext();
Context enc = (Context) iniCtx.lookup("java:comp/env");
Object ref = enc.lookup("ra/JEConnectionFactory");
JEConnectionFactory dcf = (JEConnectionFactory) ref;
JEConnection dc = dcf.getConnection(JE_ENV_HOME, envConfig);
return dc;
* @return searcher [Searcher]
* @throws DatabaseException
public static IndexSearcher getSearcher() throws DatabaseException
if (logger.isInfoEnabled())
logger.info("Entered getSearcher() of BerkelyDBUtil");
IndexSearcher searcher;
try
searcher = new IndexSearcher(getDirectory());
} catch (JEException e)
logger
.error("Caught JEException and message is::"
+ e.getMessage());
throw new DatabaseException(e.getMessage());
} catch (IOException e)
logger
.error("Caught IOException and message is::"
+ e.getMessage());
throw new DatabaseException(e.getMessage());
if (logger.isInfoEnabled())
logger.info("Leaving getSearcher() of BerkelyDBUtil");
return searcher;
Below is the Lucene update indexing program:
public class UpdateLuceneIndexCommand extends BaseCommand
* Logger object to log the details
private static Logger logger = Logger
.getLogger(UpdateLuceneIndexCommand.class);
private static Directory indexDir =null;
* (non-Javadoc)
* @see com.tka.command.BaseCommand#validateRequest(com.tka.request.Request)
protected void validateRequest(Request request)
// TODO Auto-generated method stub
* (non-Javadoc)
* @see com.tka.command.BaseCommand#executeRequest(com.tka.request.Request)
protected Response executeRequest(Request request) throws CommandException
if (logger.isInfoEnabled())
logger
.info("Entered executeRequest() method of updateSearchIndexCommand");
try
// Get the index directory obj from BerkelyDBConfig
indexDir = BerkelyDBConfig.getDirectory();
System.out.println("INDEXING INFO: Start Indexing updated content.");
// call the updateLuceneIndex method
updateLuceneIndex();
System.out.println("INDEXING INFO: Optimizing Index finished......");
} catch (Exception e)
e.printStackTrace();
logger.error("INDEXING ERROR: Unable to index new content " + e.getMessage());
throw new CommandException(e.getMessage());
if (logger.isInfoEnabled())
logger
.info("Leaving executeRequest() method of updateSearchIndexCommand");
return buildIndexResponse;
* @param indexWriter
* @throws IOException
private void updateLuceneIndex() throws IOException
if (logger.isInfoEnabled())
logger
.info("Entered updateLuceneIndex() method of updateSearchIndexCommand");
IndexWriter indexWriter = new IndexWriter(indexDir,new StandardAnalyzer(), false);
indexWriter.setUseCompoundFile(false);
// here is the code to update index
indexWriter.optimize();
indexWriter.close();
if (logger.isInfoEnabled())
logger
.info("Leaving updateLuceneIndex() method of updateSearchIndexCommand");
Thanks,
Katta.
Message was edited by:
user524075

Similar Messages

  • TS3899 With Yahoo Mail, and anotare account (Inacap Mail), I can only receive mails but I can't send emails. I don't know if this is a problem of the iPad or it is a problem with yahoo mail, because using Gmail and the email of my job I don' have this pro

    With Yahoo Mail, and anotare account (Inacap Mail), I can only receive mails but I can't send emails. I don't know if this is a problem of the iPad or it is a problem with yahoo mail, because using Gmail and the email of my job I don' have this problem.

    Google them to confirm the settings that you need for the outgoing server, then check the setting you entered on the pad.  Pay real close attention to the outgoing server name, and port.  You may need to change in on the pad. 

  • Problems with a shared calendar using Outlook 2007 and Exchange 2010

    Hello all,
    We are having a problem with sharing a calendar using Outlook 2007 and Exchange 2010.
    I will start with some background. I have just started my position with this company. I have been working with networks for awhile at the small business level. I have not had much production experience with exchange. There is only myself and my supervisor
    who has inherited a midsized network which was built by five previous techs that are no longer with the company. Of course, the previous techs did not leave much documentation, so the original hows and whys for our system setup has been lost.
    One of the managers has a calendar she shares with some of our users. I believe this calendar has been in use since sometime in 2006. A mailbox was created to hold this calendar to keep it separate from the managers calendar. I am not sure what version
    of exchange they were using at that time, but I assume there was one or two migrations of it getting to its current state on our exchange 2010 server. At some point it was observed that the other workers she was sharing with were not able to access it correctly.
    I am not fully sure what the original problem was (possibly some people not being able to see or connect to the calendar), but it was decided to give everyone who needed access to this calendar full access permissions through exchange. Correct me if I
    am wrong, but I believe that gave everyone connected the ability to do anything with the calendar. Of course the manager was not happy about that. This is where I started working on the problem.
    I removed everyone, except the manager who wants to control the calendar, from having "Full Access Permissions". This did have the effect of making some people just able to see the calendar and not make changes. Though there were others that were
    able to connect to the calendar who I thought would not be able to. The manager that originally created the calendar did try to manage access to it through the Outlook interface, though it currently does not seem to be fully in effect.
    So, to get to the point of what we are trying to do, is there a way to get the original manager back into control of the calendar though Outlook? It would be preferred to be able to keep the history of what they tracked of this calendar, so starting a new
    one would be something we would rather avoid. After that, getting all of the users that need to connect to the calendar reconnected with the correct access permissions and making sure they are all synchronized.
    I realize this is a big mess, and your help would be greatly appreciated.

    Hi Nigel,
    How is the impact, just one user or all users, Outlook or OWA?
    If just one user, it seems like an issue on the Outlook Client side.
    Please trying to re-create new profile to fresh the caches.
    Please runing Outlook under safe mode to avoid some AVs, add-ins and firewall.
    Found a similar thread for your reference:
    Calendar Sharing not available error message
    http://social.technet.microsoft.com/Forums/exchange/en-US/d9b33281-d7bb-4608-8025-16fb26643d0d/calendar-sharing-not-available-error-message?forum=exchangesvrclientslegacy
    Hope it is helpful
    Thanks
    Mavis
    Mavis Huang
    TechNet Community Support

  • Both xp and windows 7 have video problems with my VGA connection using TV

    both xp and windows 7 have video problems with my VGA connection using TV as my monitor when it gets to starting up windows no matter what version it will not I have let my mac on all night and still says starting windows or the windows 7 logo and nothing else will happen also when I use a 3rd patty software like peraills or other it works like a charm how to fix it?

    To map the drive on your computer click on Start - RUN - type "\\192.168.1.1" and click ok... When prompted for Username and Password type "admin" and click ok... Now you will be able to see the folder which you have shared on  your router, right click on it and select "Map network drive" and click on finish.
    Now it will map the drive on your computer and you should be able to transfer the file from your computer to the USB drive.

  • Problems with a VBA Userform using Multipage (2) and DTPicker.

     
    Hi
    Problems with a VBA Userform using Multipage (2) and DTPicker (4)
    On Page1 I've got 2 DTPicker, one for the date and the second for the time.
    Same thing on Page 2.
    Problem:
    Only one set will work, if I close the Userform with" MultiPage"on page2, only that set will work.
    Same thing if I close on Page 1 then just the set on Page 1 will work.
    As anyone seen this problem and any work around you may think would help.
    I'm using Windows 7 , Ms Office Pro. 2003
    same problem on Windows Vista , XL2003
    Cimjet

    There are a number of issues relating to the way that date pickers are handled, but the most important is that their output is text. In order to get the values into Excel, you need to format the Excel columns as Date and Custom (time format) and convert
    the output to the worksheet from text to date values.
    Date pickers also display a few anomalies on multi-page forms, so you need a belt and braces approach. Personally I would put the code to call the form and enter the values in a standard module (as now in the example) and use a belt and braces approach to
    maintaining the format.
    I think you will find the example now works.
    Revised Example
    Graham Mayor - Word MVP
    www.gmayor.com

  • Problem with Progress DB while using to connect using JDBC Adapter

    Hi,
      I am facing Problem with Progress DB while using to connect using JDBC Adapter. I am getting the following error in auditlog file like,
    Error during database connection to the database URL  jdbc:JdbcProgress:T:156.5.31.65:2545:/mfgprodev/devbadb 
    /devsche/i_apoext.db using the  JDBC driver "com.progress.sql.jdbc.JdbcProgressDriver" : com.sap.aii.adapter.jdbc.sql.DriverManagerException: Unable to locate a suitable JDBC driver to establish a connection to URL " jdbc:JdbcProgress:T:156.5.31.65:2545:/mfgprodev/devbadb 
    /devsche/i_apoext.db "
    I tried using the following all URLs,
    1. jdbc:JdbcProgress:T:156.5.31.65:2545:i_apoext.       
    2. jdbc:JdbcProgress:T:156.5.31.65:2545:i_apoext.db     
    3.                                                      
    jdbc:JdbcProgress:T:156.5.31.65:2545:/mfgprodev/devbadb 
    /devsche/i_apoext.                                      
    4.                                                      
    jdbc:JdbcProgress:T:156.5.31.65:2545:/mfgprodev/devbadb 
    /devsche/i_apoext.db.                                  
    Can anyone please help me out in solving this issue.
    May be the cause for this is :
    1) The Wrong URL  format
    2) CLASSPATH is not setted properly..
    Can you look more into this stuff.
    Thanks,
    Soorya.

    Hi,
    To access any database fromm XI, using the JDBC adapter, the corresponding drivers have to be installed on the XI server.
    Just check this note 831162.
    Also, check this PDF to install Drivers in XI,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3867a582-0401-0010-6cbf-9644e49f1a10

  • Problem with Pole zero analysis using multisim

    Problem with Pole zero analysis using multisim
    When I tried to find input impedance function's pole zero of a parallel LC network using Multisim
    pole zero analysis, I get following message
    | | doAnalyses: matrix is singular
    | |
    | |
    | | pz simulation(s) aborted "
    The circuit as well as log file attached.
    How to correctly perform pole zero analysis?
    Solved!
    Go to Solution.
    Attachments:
    Parallel LC.JPG ‏8 KB
    parallel LC.txt ‏7 KB

    dear sir,
    thanks for your earlier reply to my question on pole zero analysis
    one more problem on pole zero analysis ;
    i tried to do pole zero analysis for circuit(shown in attached file where C1=1/6F(167mF) C2=5/18F(278mF) for which
    z(s)= (s^2+9)(s^2+1)
               s(s^2+4)
    for which zeros are at  +/-3j ,+/-1j
                  poles at       0 ,+/-2j          as per theory:
    But multisim gives different values (shown in attached file)
    what is the problem?
    please clarify.
    thanks & regards
    sagar vanarase
    Attachments:
    1portLC.JPG ‏219 KB

  • Problem with two monitors while using Photoshop, windows move from 2nd screen to 1st screen.

    Problem with two monitors while using Photoshop, windows move from 2nd screen to 1st screen.
    I saved a new workspace and it did not help.
    No problem before I went to Maverick.

    I found the fix, go to System Preferences and open Mission Control and uncheck the box to keep monitors as they were (When switching to an application...........)

  • Is anyone using iPhoto having a problem with the slide show using shatter where it does not let you put a title over photo?

    Is anyone using iPhoto having a problem with the slide show using shatter where it does not let you put a title over photo? It use to work but it no longer lets you place a title over the opening photo.

    Is your signature still current?(iPhoto '08, OS X Mountain Lion (10.8.4))    I can confirm this for iPhoto '11; Shatter will only show the text slide title between the slides. Ken Burns and Classic theme can still be set to overlay the caption and title directly over the slides.

  • I had a problem with slowness so I used "reset". The popup ran forever so I stopped it. Now I can't remove or add the program.

    I had a problem with slowness so I used "reset". The popup ran forever so I stopped it. Now I can't use, remove, or add the program. How do I proceed?
    TIA,
    BWSwede

    You can paste that path in the command line in the Windows Explorer file manager.

  • Configuring kodo-jdo-2.5.3 with weblogic 8.1 using JCA

    Hi there.
    I am trying to configure kodo-jdo-2.5.3 in WebLogic 8.1 using JCA method.
    The issue I got was that I got DB authentication failed. I have tested my
    JDBC connect -- working fine, I have turned on JDBC log in WL, it looks
    fine.
    It looks like that KODO was still trying to create its own JDBC connection
    even I have specified
    <config-property>
    <description>The JNDI name of the connection factory to use for
    obtaining connections.</description>
    <config-property-name>ConnectionFactoryName</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>datasource.oracle9</config-property-value>
    </config-property>
    "datasource.oracle9" is the JNDI name of my data source.
    The error message is the following. I will really appreciate your help.
    Melvin
    Oct 19, 2003 4:20:53 AM com.solarmetric.kodo.impl.jdbc.RegisterListener
    registerClass
    SEVERE: com.solarmetric.kodo.runtime.FatalDataStoreException:
    java.sql.SQLException: User: melvin, f
    ailed to be authenticated. [code=0;state=null]
    NestedThrowables:
    java.sql.SQLException: User: melvin, failed to be authenticated.
    com.solarmetric.kodo.runtime.FatalDataStoreException:
    java.sql.SQLException: User: melvin, failed to
    be authenticated. [code=0;state=null]
    NestedThrowables:
    java.sql.SQLException: User: melvin, failed to be authenticated.
    at
    com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwFatal(SQLExceptions.java:58)
    at
    com.solarmetric.kodo.impl.jdbc.schema.DBDictionaryFactory.getDictionary(DBDictionaryFacto
    ry.java:212)
    at
    com.solarmetric.kodo.impl.jdbc.JDBCSimpleConfiguration.getDictionary(JDBCSimpleConfigurat
    ion.java:370)
    at
    com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory.registerClassInternal(JDBCPe
    rsistenceManagerFactory.java:455)
    at
    com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory.registerClass(JDBCPersistenc
    eManagerFactory.java:338)
    at
    com.solarmetric.kodo.impl.jdbc.RegisterListener.registerClass(RegisterListener.java:53)
    at
    javax.jdo.spi.JDOImplHelper.registerClass(JDOImplHelper.java:269)
    at samples.j2ee.Car.<clinit>(Car.java)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:140)
    at samples.j2ee.ejb.CarBean.class$(CarBean.java:11)
    at samples.j2ee.ejb.CarBean.list(CarBean.java:136)
    at
    samples.j2ee.ejb.CarEJB_pgfrtx_EOImpl.list(CarEJB_pgfrtx_EOImpl.java:201)
    at jsp_servlet.__index._jspService(__index.java:170)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.jav
    a:1053)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:431)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletC
    ontext.java:6310)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:36
    22)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    NestedThrowablesStackTrace:
    java.sql.SQLException: User: melvin, failed to be authenticated.
    at
    weblogic.jdbc.common.internal.RmiDataSource.getSubject(RmiDataSource.java:257)
    at
    weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:188)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.DataSourceConnector.getConnection(DataSourceConnec
    tor.java:63)
    at
    com.solarmetric.kodo.impl.jdbc.schema.DBDictionaryFactory.getDictionary(DBDictionaryFacto
    ry.java:179)
    at
    com.solarmetric.kodo.impl.jdbc.JDBCSimpleConfiguration.getDictionary(JDBCSimpleConfigurat
    ion.java:370)
    at
    com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory.registerClassInternal(JDBCPe
    rsistenceManagerFactory.java:455)
    at
    com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory.registerClass(JDBCPersistenc
    eManagerFactory.java:338)
    at
    com.solarmetric.kodo.impl.jdbc.RegisterListener.registerClass(RegisterListener.java:53)
    at
    javax.jdo.spi.JDOImplHelper.registerClass(JDOImplHelper.java:269)
    at samples.j2ee.Car.<clinit>(Car.java)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:140)
    at samples.j2ee.ejb.CarBean.class$(CarBean.java:11)
    at samples.j2ee.ejb.CarBean.list(CarBean.java:136)
    at
    samples.j2ee.ejb.CarEJB_pgfrtx_EOImpl.list(CarEJB_pgfrtx_EOImpl.java:201)
    at jsp_servlet.__index._jspService(__index.java:170)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.jav
    a:1053)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:431)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletC
    ontext.java:6310)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:36
    22)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    <Oct 19, 2003 4:20:53 AM CDT> <Info> <EJB> <BEA-010051> <EJB Exception
    occurred during invocation fr
    om home: samples.j2ee.ejb.CarEJB_pgfrtx_HomeImpl@1c059f6 threw exception:
    com.solarmetric.kodo.runti
    me.FatalDataStoreException: java.sql.SQLException: User: melvin, failed to
    be authenticated. [code=0
    ;state=null]
    NestedThrowables:
    java.sql.SQLException: User: melvin, failed to be authenticated.
    com.solarmetric.kodo.runtime.FatalDataStoreException:
    java.sql.SQLException: User: melvin, failed to
    be authenticated. [code=0;state=null]
    NestedThrowables:
    java.sql.SQLException: User: melvin, failed to be authenticated.
    at
    com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwFatal(SQLExceptions.java:58)
    at
    com.solarmetric.kodo.impl.jdbc.schema.DBDictionaryFactory.getDictionary(DBDictionaryFacto
    ry.java:212)
    at
    com.solarmetric.kodo.impl.jdbc.JDBCSimpleConfiguration.getDictionary(JDBCSimpleConfigurat
    ion.java:370)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.getDictionary(JDBCStoreManager.ja
    va:753)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.getClassMapping(JDBCStoreManager.
    java:1023)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.getClassMapping(JDBCStoreManager.
    java:1037)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCExtent.getResultList(JDBCExtent.java:71)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCExtent.getIterator(JDBCExtent.java:47)
    at
    com.solarmetric.kodo.runtime.ExtentImpl$MultipleSubclassIterator.newIterator(ExtentImpl.j
    ava:344)
    at serp.util.MultiIterator.setIterator(MultiIterator.java:74)
    at serp.util.MultiIterator.hasNext(MultiIterator.java:29)
    at serp.util.LookaheadIterator.setNext(LookaheadIterator.java:133)
    at
    serp.util.LookaheadIterator.initialize(LookaheadIterator.java:118)
    at serp.util.LookaheadIterator.hasNext(LookaheadIterator.java:48)
    at serp.util.MultiIterator.setIterator(MultiIterator.java:73)
    at serp.util.MultiIterator.hasNext(MultiIterator.java:29)
    at
    com.solarmetric.kodo.runtime.ExtentImpl$TransactionAwareIterator.hasNext(ExtentImpl.java:
    403)
    at samples.j2ee.ejb.CarBean.list(CarBean.java:138)
    at
    samples.j2ee.ejb.CarEJB_pgfrtx_EOImpl.list(CarEJB_pgfrtx_EOImpl.java:201)
    at jsp_servlet.__index._jspService(__index.java:170)
    at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
    at
    weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.jav
    a:1053)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:431)
    at
    weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
    at
    weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletC
    ontext.java:6310)
    at
    weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
    at
    weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
    at
    weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:36
    22)
    at
    weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    NestedThrowablesStackTrace:
    java.sql.SQLException: User: melvin, failed to be authenticated.
    at
    weblogic.jdbc.common.internal.RmiDataSource.getSubject(RmiDataSource.java:257)
    at
    weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:188)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.DataSourceConnector.getConnection(DataSourceConnec
    tor.java:63)
    at
    com.solarmetric.kodo.impl.jdbc.schema.DBDictionaryFactory.getDictionary(DBDictionaryFacto
    ry.java:179)
    at
    com.solarmetric.kodo.impl.jdbc.JDBCSimpleConfiguration.getDictionary(JDBCSimpleConfigurat
    ion.java:370)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.getDictionary(JDBCStoreManager.ja
    va:753)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.getClassMapping(JDBCStoreManager.
    java:1023)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.getClassMapping(JDBCStoreManager.
    java:1037)

    Alex Robbins wrote:
    Try removing <authentication-mechanism> from the ra.xml file of the Kodo
    JCA connector. Then it won't try to authenticate against the WL security
    realm. (If you want connector-level authentication as well as DB-conn
    authentication i think you'll have to configure WL security. I don't know
    how). This worked for me.
    Alex.Hi, The following is the ra.xml, please see any problem.
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE connector PUBLIC '-//Sun Microsystems, Inc.//DTD Connector
    1.0//EN' 'http://java.sun.com/dtd/connector_1_0.dtd'>
    <connector>
    <display-name>KodoJDO</display-name>
    <description>Resource Adapter for integration of the Kodo Java Data
    Objects (JDO) implementation with J2EE 1.3 compliant managed
    environments</description>
    <icon>
    <small-icon>kodo16.gif</small-icon>
    <large-icon>kodo32.gif</large-icon>
    </icon>
    <vendor-name>Solarmetric, Inc.</vendor-name>
    <spec-version>1.0</spec-version>
    <eis-type>jdo</eis-type>
    <version>1.0</version>
    <license>
    <description>See http://www.solarmetric.com for terms and license
    conditions.</description>
    <license-required>true</license-required>
    </license>
    <resourceadapter>
    <managedconnectionfactory-class>com.solarmetric.kodo.impl.jdbc.ee.ManagedConnectionFactoryImpl</managedconnectionfactory-class>
    <connectionfactory-interface>javax.resource.cci.ConnectionFactory</connectionfactory-interface>
    <connectionfactory-impl-class>com.solarmetric.kodo.impl.jdbc.ee.JDOConnectionFactory</connectionfactory-impl-class>
    <connection-interface>javax.resource.cci.Connection</connection-interface>
    <connection-impl-class>com.solarmetric.kodo.ee.EEPersistenceManager</connection-impl-class>
    <transaction-support>XATransaction</transaction-support>
    <config-property>
    <description>The number of hard references to cached objects that the
    PersistenceManager's cache will retain (in addition to the soft reference
    cache that it maintains). Setting this to a higher value will result in
    more objects being retained in the cache, at the cost of utilizing more
    memory resources. Setting it to -1 will cause the PersistenceManager to
    maintain hard references only. This will result in better performance, but
    can have adverse effects on memory usage.</description>
    <config-property-name>CacheReferenceSize</config-property-name>
    <config-property-type>java.lang.Integer</config-property-type>
    <config-property-value>1000</config-property-value>
    </config-property>
    <config-property>
    <description>The class name of ether the JDBC java.sql.Driver, or an
    instance of a javax.sql.DataSource to use to connect to the data
    source.</description>
    <config-property-name>ConnectionDriverName</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>The JNDI name of the connection factory to use for
    finding non-transactional connections. If specified, this is the
    connection that will be used for access for obtaining sequence
    numbers.</description>
    <config-property-name>ConnectionFactory2Name</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>jdbc/petshop</config-property-value>
    </config-property>
    <config-property>
    <description>A space-separated list of properties to be passed to
    the JDBC Driver when obtaining a Connection for the ConnectionFactory2
    (which will be used to obtain sequence numbers). Properties are of the
    form "key=value". If a javax.sql.DataSource class is defined in the
    javax.jdo.option.ConnectionDriverName property, then this property will be
    used to set bean-like properties in the DataSource instance upon creation.
    These properties vary depending on the DataSource in use: see the
    documentation for your DataSource for details on the properties to
    use.</description>
    <config-property-name>ConnectionFactory2Properties</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>The JNDI name of the connection factory to use for
    obtaining connections.</description>
    <config-property-name>ConnectionFactoryName</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>PetShopXADataSource</config-property-value>
    </config-property>
    <config-property>
    <description>The password for the user specified in
    ConnectionUserName</description>
    <config-property-name>ConnectionPassword</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>A space-separated list of properties to be passed to
    the JDBC Driver when obtaining a Connection. Properties are of the form
    "key=value". If a javax.sql.DataSource class is defined in the
    javax.jdo.option.ConnectionDriverName property, then this property will be
    used to set bean-like properties in the DataSource instance upon creation.
    These properties vary depending on the DataSource in use: see the
    documentation for your DataSource for details on the properties to
    use.</description>
    <config-property-name>ConnectionProperties</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>The connection retain mode. Possible options are
    "persistence-manager", "transaction", and "on-demand". Default value is
    "on-demand".</description>
    <config-property-name>ConnectionRetainMode</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>on-demand</config-property-value>
    </config-property>
    <config-property>
    <description>The number of seconds to wait between testing
    connections retrieved from the connection pool. Only valid when using the
    built-in Kodo connection pooling.</description>
    <config-property-name>ConnectionTestTimeout</config-property-name>
    <config-property-type>java.lang.Integer</config-property-type>
    <config-property-value>10</config-property-value>
    </config-property>
    <config-property>
    <description>The URL for the data source.</description>
    <config-property-name>ConnectionURL</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>The username for the connection listed in
    ConnectionURL.</description>
    <config-property-name>ConnectionUserName</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>The name of the class to use for caching of data loaded
    from the data store. Must implement
    com.solarmetric.kodo.runtime.datacache.DataCache.</description>
    <config-property-name>DataCacheClass</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>A space-separated list of properties to pass to the
    class defined in com.solarmetric.kodo.DataCacheClass upon
    initialization.</description>
    <config-property-name>DataCacheProperties</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>The name of the default class to use for mapping
    persistent classes to the database. Must extend
    com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.</description>
    <config-property-name>DefaultClassMappingClass</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping</config-property-value>
    </config-property>
    <config-property>
    <description>The number of seconds that data in the data cache is
    valid for. A value of 0 or less means that by default, cached data does
    not time out.</description>
    <config-property-name>DefaultDataCacheTimeout</config-property-name>
    <config-property-type>java.lang.Double</config-property-type>
    <config-property-value>0.0</config-property-value>
    </config-property>
    <config-property>
    <description>The number of rows that will be pre-fetched when an
    element in a Query result is accessed.</description>
    <config-property-name>DefaultFetchBatchSize</config-property-name>
    <config-property-type>java.lang.Integer</config-property-type>
    <config-property-value>10</config-property-value>
    </config-property>
    <config-property>
    <description>The threshold below which result lists will be
    completely instantiated upon their creation. A value of -1 will always
    force all results to be completely instantiated, thus disabling lazy
    result loading.</description>
    <config-property-name>DefaultFetchThreshold</config-property-name>
    <config-property-type>java.lang.Integer</config-property-type>
    <config-property-value>30</config-property-value>
    </config-property>
    <config-property>
    <description>The name of the default class to use for managing
    subclass indicator columns. Must implement the
    com.solarmetric.kodo.impl.jdbc.ormapping.SubclassProvider interface. See
    custom class indicator documentation for more information about subclass
    providers.</description>
    <config-property-name>DefaultSubclassProviderClass</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>com.solarmetric.kodo.impl.jdbc.ormapping.SubclassProviderImpl</config-property-value>
    </config-property>
    <config-property>
    <description>A space-separated list of properties to pass to the
    class defined in
    com.solarmetric.kodo.impl.jdbc.DefaultSubclassProviderClass upon
    initialization.</description>
    <config-property-name>DefaultSubclassProviderProperties</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>The DBDictionary to use for this configuration. This is
    auto-detected based on the setting of javax.jdo.option.ConnectionURL, so
    you need only set this to override the default with your own custom
    DBDictionary or if you are using an unrecognized driver.</description>
    <config-property-name>DictionaryClass</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>A space-separated list of name-value properties
    settings to pass to the dictionary defined by
    com.solarmetric.kodo.impl.jdbc.DictionaryClass. Many of the DBDictionary
    options are automatically configured by concrete subclasses of
    GenericDictionary. The defaults can, however, be overridden by using this
    property.</description>
    <config-property-name>DictionaryProperties</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>If true, then Kodo JDO will allow the use of query
    filter extensions. See the query extensions documentation for more
    information.</description>
    <config-property-name>EnableQueryExtensions</config-property-name>
    <config-property-type>java.lang.Boolean</config-property-type>
    <config-property-value>false</config-property-value>
    </config-property>
    <config-property>
    <description>A comma-separated list of fetch group names that
    PersistenceManagers will load by default when loading data from the
    database.</description>
    <config-property-name>FetchGroups</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>If true, then all fields of all classes in a given
    inheritance hierarchy will by default map into the least-derived type's
    default primary table. If false then a new default primary table will be
    created for each class in the inheritance hierarchy, and each type's
    declared fields will map to that table by default.</description>
    <config-property-name>FlatInheritanceMapping</config-property-name>
    <config-property-type>java.lang.Boolean</config-property-type>
    <config-property-value>true</config-property-value>
    </config-property>
    <config-property>
    <description>A String value indicating whether or not Kodo should
    automatically flush modifications to the data store before executing
    queries.</description>
    <config-property-name>FlushBeforeQueries</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>with-connection</config-property-value>
    </config-property>
    <config-property>
    <description>If false, then the JDO implementation must consider
    modifications, deletions, and additions in the PersistenceManager
    transaction cache when executing a query inside a transaction. Else, the
    implementation is free to ignore the cache and execute the query directly
    against the data store.</description>
    <config-property-name>IgnoreCache</config-property-name>
    <config-property-type>java.lang.Boolean</config-property-type>
    <config-property-value>false</config-property-value>
    </config-property>
    <config-property>
    <description>The license key provided to you by SolarMetric. Keys
    are available at www.solarmetric.com</description>
    <config-property-name>LicenseKey</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>xxxx</config-property-value>
    </config-property>
    <config-property>
    <description>The name of the class to use for obtaining a reference
    to the transaction manager in an enterprise environment. Must implement
    the com.solarmetric.kodo.ee.ManagedRuntime interface.</description>
    <config-property-name>ManagedRuntimeClass</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>com.solarmetric.kodo.ee.AutomaticManagedRuntime</config-property-value>
    </config-property>
    <config-property>
    <description>A space-separated list of properties to pass to the
    class defined in com.solarmetric.kodo.ManagedRuntimeClass upon
    initialization.</description>
    <config-property-name>ManagedRuntimeProperties</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>The maximum number of connections to pool. If all of
    these are in use, then PersistenceManager instances must wait for a
    connection to become available. This option has been removed from the
    specification, but we still use the javax.jdo.option for backwards
    compatibility.</description>
    <config-property-name>MaxPool</config-property-name>
    <config-property-type>java.lang.Integer</config-property-type>
    <config-property-value>200</config-property-value>
    </config-property>
    <config-property>
    <description>The minimum number of connections to keep in the pool.
    This option has been removed from the specification, but we still use the
    javax.jdo.option for backwards compatibility.</description>
    <config-property-name>MinPool</config-property-name>
    <config-property-type>java.lang.Integer</config-property-type>
    <config-property-value>2</config-property-value>
    </config-property>
    <config-property>
    <description>The number of milliseconds to wait for a pooled
    connection before throwing an exception if the pool is empty. This option
    has been removed from the specification, but we still use the
    javax.jdo.option for backwards compatibility.</description>
    <config-property-name>MsWait</config-property-name>
    <config-property-type>java.lang.Integer</config-property-type>
    <config-property-value>30000</config-property-value>
    </config-property>
    <config-property>
    <description>If true, then the application plans to have multiple
    threads simultaneously accessing a single PersistenceManager, so measures
    must be taken to ensure that the implementation is thread-safe. Otherwise,
    the implementation need not address thread safety.</description>
    <config-property-name>Multithreaded</config-property-name>
    <config-property-type>java.lang.Boolean</config-property-type>
    <config-property-value>false</config-property-value>
    </config-property>
    <config-property>
    <description>If true, then it is possible to read persistent data
    outside the context of a transaction. Otherwise, a transaction must be in
    progress in order read data.</description>
    <config-property-name>NontransactionalRead</config-property-name>
    <config-property-type>java.lang.Boolean</config-property-type>
    <config-property-value>true</config-property-value>
    </config-property>
    <config-property>
    <description>If true, then it is possible to write to fields of a
    persistent-nontransactional object when a transaction is not in progress.
    If false, such a write will result in a JDOUserException.</description>
    <config-property-name>NontransactionalWrite</config-property-name>
    <config-property-type>java.lang.Boolean</config-property-type>
    <config-property-value>false</config-property-value>
    </config-property>
    <config-property>
    <description>Selects between optimistic and pessimistic (data store)
    transactional modes.</description>
    <config-property-name>Optimistic</config-property-name>
    <config-property-type>java.lang.Boolean</config-property-type>
    <config-property-value>false</config-property-value>
    </config-property>
    <config-property>
    <description>The name of the class that the
    PersistenceManagerFactory should create when creating a new
    PersistenceManagerImpl. Must extend
    com.solarmetric.kodo.runtime.PersistenceManagerImpl.</description>
    <config-property-name>PersistenceManagerClass</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>The name of the concrete implementation of
    javax.jdo.PersistenceManagerFactory that
    javax.jdo.JDOHelper.getPersistenceManagerFactory () should create. For
    Kodo JDO, this should be
    com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory or
    com.solarmetric.kodo.impl.jdbc.ee.EEPersistenceManagerFactory, or a custom
    extension of one of these types.</description>
    <config-property-name>PersistenceManagerFactoryClass</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory</config-property-value>
    </config-property>
    <config-property>
    <description>A space-separated list of properties to pass to the
    class defined in com.solarmetric.kodo.PersistenceManagerClass upon
    initialization.</description>
    <config-property-name>PersistenceManagerProperties</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>A comma-separated list of classes that will be
    initialized whenever a new PersistenceManager is instantiated. This can be
    used to get around issues with application identity classes not being
    associated with their respective persistent classes.</description>
    <config-property-name>PersistentTypes</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>The name of the class to use to proxy second class
    objects in managed instances. Must implement
    com.solarmetric.kodo.util.ProxyManager.</description>
    <config-property-name>ProxyManagerClass</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>com.solarmetric.kodo.util.SimpleProxyManager</config-property-value>
    </config-property>
    <config-property>
    <description>A space-separated list of properties to pass to the
    class defined in com.solarmetric.kodo.ProxyManagerClass upon
    initialization.</description>
    <config-property-name>ProxyManagerProperties</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>The name of the class to use for caching of queries
    loaded from the data store. Must implement
    com.solarmetric.kodo.runtime.datacache.QueryCache.</description>
    <config-property-name>QueryCacheClass</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>com.solarmetric.kodo.runtime.datacache.query.QueryCacheImpl</config-property-value>
    </config-property>
    <config-property>
    <description>A space-separated list of properties to pass to the
    class defined in com.solarmetric.kodo.QueryCacheClass upon
    initialization.</description>
    <config-property-name>QueryCacheProperties</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>A list of query filter listeners to add to the default
    list of extensions. Ignored if com.solarmetric.kodo.EnableQueryExtensions
    is false.</description>
    <config-property-name>QueryFilterListeners</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>The name of the class to use for communicating commit
    information among JVMs. Must implement
    com.solarmetric.kodo.runtime.event.RemoteCommitProvider.</description>
    <config-property-name>RemoteCommitProviderClass</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>A space-separated list of properties to pass to the
    class defined in com.solarmetric.kodo.RemoteCommitProviderClass upon
    initialization.</description>
    <config-property-name>RemoteCommitProviderProperties</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>If true, then fields in a persistence-capable object
    that have been changed during a transaction will be rolled back to their
    original values upon a rollback. Otherwise, the values will not be changed
    upon rollback.</description>
    <config-property-name>RestoreValues</config-property-name>
    <config-property-type>java.lang.Boolean</config-property-type>
    <config-property-value>true</config-property-value>
    </config-property>
    <config-property>
    <description>The name of the class that will be used as the
    Collection implementation for returning ResultList instances. It must be
    an instance of
    com.solarmetric.kodo.runtime.objectprovider.ResultList.</description>
    <config-property-name>ResultListClass</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>The property string used to configure the instance of
    the ResultListClass.</description>
    <config-property-name>ResultListProperties</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>If true, then fields in a persistence-capable object
    that have been read during a transaction must be preserved in memory after
    the transaction commits. Otherwise, persistence-capable objects must
    transition to the hollow state upon commit, meaning that subsequent reads
    will result in a database round-trip.</description>
    <config-property-name>RetainValues</config-property-name>
    <config-property-type>java.lang.Boolean</config-property-type>
    <config-property-value>false</config-property-value>
    </config-property>
    <config-property>
    <description>The name of the class to use for generating sequence
    numbers when using data store identity. Must implement the
    com.solarmetric.kodo.impl.jdbc.SequenceFactory interface.</description>
    <config-property-name>SequenceFactoryClass</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>com.solarmetric.kodo.impl.jdbc.schema.DBSequenceFactory</config-property-value>
    </config-property>
    <config-property>
    <description>A space-separated list of properties to pass to the
    class defined in com.solarmetric.kodo.impl.jdbc.SequenceFactoryClass upon
    initialization.</description>
    <config-property-name>SequenceFactoryProperties</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>The class names of a SQLExecutionListener
    implementation to install on the SQLExecutionManager.</description>
    <config-property-name>SQLExecutionListenerClass</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value></config-property-value>
    </config-property>
    <config-property>
    <description>The name of a custom SQLExecutionManager to be used for
    all issuance of SQL to the data store. Must implement
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManager.</description>
    <config-property-name>SQLExecutionManagerClass</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl</config-property-value>
    </config-property>
    <config-property>
    <description>The size of the PreparedStatement cache that is
    maintained in the DataSource implementation.</description>
    <config-property-name>StatementCacheMaxSize</config-property-name>
    <config-property-type>java.lang.Integer</config-property-type>
    <config-property-value>70</config-property-value>
    </config-property>
    <config-property>
    <description>The time, in seconds, after which a JDBC query will be
    aborted if it has not yet returned any values. This value is simply passed
    to the JDBC driver's Statement.setTimeout method; Kodo does not perform
    any addition timeout actions. Note that many JDBC drivers either ignore
    this request, or improperly handle it, which may result in application
    deadlocks.</description>
    <config-property-name>StatementExecutionTimeout</config-property-name>
    <config-property-type>java.lang.Integer</config-property-type>
    <config-property-value>-1</config-property-value>
    </config-property>
    <config-property>
    <description>If true, the Kodo runtime will automatically attempt to
    refresh the database schema when persistent classes are referenced,
    allowing the developer to bypass the schematool step. This property is
    only intended to be used for development. As automatic schema migration
    can result in data loss, this feature should never be enabled on a
    production system. Furthermore, this feature has serious adverse affects
    on Kodo's runtime performace. Ensure that it is disabled before doing any
    performance analysis.</description>
    <config-property-name>SynchronizeSchema</config-property-name>
    <config-property-type>java.lang.Boolean</config-property-type>
    <config-property-value>false</config-property-value>
    </config-property>
    <config-property>
    <description>The name of the class to use to store
    persistence-capable objects involved in a PM's transaction cache. Must
    implement com.solarmetric.kodo.runtime.StateManagerSet.</description>
    <config-property-name>TransactionCacheClass</config-property-name>
    <config-property-type>java.lang.String</config-property-type>
    <config-property-value>com.solarmetric.kodo.runtime.FifoStateManagerSet</config-property-value>
    </config-property>
    <config-property>
    <description>A space-separated list of properties to pass to the
    class defined in com.solarmetric.kodo.TransactionCacheClass upon
    initialization.</description>
    <config-property-name>TransactionCacheProperties</config-property-name>
    <config-property-type>java.lang.String</config-property

  • Problem with JMS migration when using Ctrl+C to stop the managed server in cluster

              Hi,
              I am having a clustered weblogic application running on Weblogic 7.0 SP5. My application
              uses JMS as a asynchrous communication. We have MDB which listens to these JMS
              messages.
              If something is being processed on Managed Server 1 and while the request is in
              process, i am stopping the the MAnaged SErver 1 using Ctrl+C.
              After this, i go to admin console and migrate teh JTA and JMS. After this, i am
              expecting other running Managed Server should restart the incomplete transaction.
              But this is not happening. The Managed Serve2 doesn't process the requst.
              But when i restart teh MAnaged SErver 1 again, it takes up the same request and
              processes it.
              Is this a known problem with Weblogic that it doesn't support Ctlr+C case?
              Please note that the same thing is working fine when i stop the server using Admin
              console(Normal shutdown OR forced shutdown).
              Any comments in this regards are apprecciated.
              Thanks,
              Naresh
              

              Hi,
              I am having a clustered weblogic application running on Weblogic 7.0 SP5. My application
              uses JMS as a asynchrous communication. We have MDB which listens to these JMS
              messages.
              If something is being processed on Managed Server 1 and while the request is in
              process, i am stopping the the MAnaged SErver 1 using Ctrl+C.
              After this, i go to admin console and migrate teh JTA and JMS. After this, i am
              expecting other running Managed Server should restart the incomplete transaction.
              But this is not happening. The Managed Serve2 doesn't process the requst.
              But when i restart teh MAnaged SErver 1 again, it takes up the same request and
              processes it.
              Is this a known problem with Weblogic that it doesn't support Ctlr+C case?
              Please note that the same thing is working fine when i stop the server using Admin
              console(Normal shutdown OR forced shutdown).
              Any comments in this regards are apprecciated.
              Thanks,
              Naresh
              

  • PROBLEM WITH ALT-V WHEN USING CROATIAN KEYBOARD

    Hi,
    When Typing ALT GR+V (@ sign) in Croatian Keyboard, all the text from clipboard is copied into the text box (as it is pressed CTRL+V) plus the @sign.
    There were some bugs filed long back regarding a similar issue for the German keyboard where the customer was using the AltGr key for special characters, same as in our case.
    Below is the list of those bugs:
    (1)     Bug 757614: GERMAN USERS CANNOT USE ALT-GR KEY TO GET SPECIAL CHARACTERS
    (2)     666925
    (3)     767865
    (4)     768658
    I have gone through the descriptions and mail chains mentioned in these bugs, and it seems that the issue was fixed in OJDK.
    Please go through the above mentioned bugs once to get more details.
    It seems that this is not ORMS issue. It seems to be an Oracle Forms or OJDK issue.
    Can someone please advise on this as why is this happening. We are using Oracle Forms 10g.
    Thanks and Regards,
    Ashwini Swaroop Pradhan

    Tom Gewecke wrote:
    w/ all the keyboards and language settings.
    What do you mean by that? The problem being talked about here is an inability to make French accented characters on a German keyboard. What is your problem exactly?
    I've posted here because I guess it may be the same bug.
    After upgrading I wasn't able to do special characters, including some accented vocals, like "ì", very common in italian language.
    Then I've added an english keyboard, removed the italian one and added it again, so the problem with missing accented vocals was solved.
    I still have the same problem with special consonants, like "z" and "c": if I hold my thumb on such letters, I have no options like, say, "ż" (such characters are very important for my field (linguistics) and if Apple won't solve this problem I'll be forced to look elsewhere).

  • 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:
    Kilik07

    ok 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

  • Problem with photoshop cs 6 using tools

    When im using clone tool and press [ and ] key to zoom in and out, the zoom key suddenly stops working. What seems to be the problem?

    [ and ] changes brush size. Ctrl/Cmd + and - changes zoom.
    If you are having a problem with a tool, just reset it. Right-click on it here in the Options bar.

Maybe you are looking for

  • After AFAB, I've changed depreciation key for an asset from 20% to 0%

    Hi All, I've posted depreciation (AFAB) for periods from 01 to 04 (Depreciation Area 20). Later I've changed the depreciation key for an asset from 20% to 0%. In my test SAP allows me to update depreciation data only in the period 05 (for previous da

  • Maximum volume size?

    SunFriends, How can I discover (or calculate, whatever) the maximum voume size for a volume created under Solaris 9 9/02? Tx all for any help, Nick

  • Iexplorer setting that would cause export of xls error "Could not open ..."

    We have a situation where the same user, on two different machines, gets two different results. The user is attempting to export to xls. We are using Discoverer 10g viewer. On machine one, the error (Could not open https://server.co.net/discoverer/ex

  • Problem with PIN alerts in holster

    After upgrading to OS 5.0 on US Cellular (same as Sprint OS 5.0), my profiles seemed to be "Fixed" from OS 4.7 problems.  However I have come to realize I don't get alerts in holster for PIN messages now.  Every other alert works great.  Vibrate or s

  • GATP (APO) Check results in ERP Sales order.

    Hi Gurus, We have a requirement to get GATP results (Product Substitution) into ERP Sales order. Please note this is not CRM Sales Order we are dealing with. We are not able to populate product substitution into schedule line. According to SAP, GATP/