When did Java implement --- java.util.Collection
In what year and release date did Java implement java.util.Collection ?
classes:
ArrayList (Java 2), LinkedList (Java 2), Arrays (Java 2), TreeMap (Java 2),
TreeSet (Java 2)
interfaces:
Collection (Java 2), List (Java 2), ListIterator (Java 2),
Comparator (Java 2), Set (Java 2), Map (Java 2), Iterator (Java 2)
Edited by: SadaYama on Sep 24, 2008 6:45 PM
Encephalopathic wrote:
tsith wrote:
There's a reason this didn't work out for you last time you asked this...Shame on you for mentioning a great thread without providing a link. I will make up for this egregious deficiency here and now:
[http://forums.sun.com/thread.jspa?threadID=5334215]
Most appreciated, guv - please accept my apologies for the oversight.
Similar Messages
-
Report cannot be rendered (com/sun/java/util/collections/Iterator)
Hello all
I'm new both to Weblogic Server and BI Publisher.
A few days ago I thought that I managed to install BI Publisher on top of Weblogic. It turns out to be untrue because I am not able to view any report, being it a sample or a newly created one.
Platform: Windows 2003 32-bit
Weblogic version: 10.3.3.0
BI Publisher version: 10.1.3.4.1 (doesn't work both w/ and w/o the latest patchset 9791839)
And now to the problem. Whenever I try to view a report, I get an error message stating "The report cannot be rendered because of an error, please contact the administrator". Being both the user and the administrator, I am forced to press the "Error Detail" link, upon which the only thing that pops below is "com/sun/java/util/collections/Iterator" (in red).
The same non-verbose error message appears also when running in debug mode. Weblogic logs are empty from warnings, errors, etc.
As for the Weblogic Server, it claims that the xmlpserver application has been deployed and started successfully.
It seems to me that the BI Publisher application is trying to use java class that doesn't exist (com.sun.java.util.collections.Iterator). Of course I have no clue how to prove that because I do not have the source code for this app.
Oracle support is hardly able to understand the problem, so I thought maybe one of you could give me some answer.
Any Ideas?
JonathanBy the way, I deployed the app under Oracle Report's cluster. Don't know whether it matters.
-
Jdev webservice and java.util.Collection
Hi,
i write a web service based on an stateless
session EJB i have 2 method who return double
and they work fine.
But i have added a method who return a Collection and
when i try to regenerate my web service i got
a message error because the return type does not
have an xml chema mapping and/or serializer
specified.
How can i fix this problem ?
I use jdev 9.0.5.2 and oracle 9ias 9.0.4.1.
Thank you for your help.I'm not a WS PM, but I think the problem here is that a java.util.Collection is a supported type for WS based on the 904 release. From what I remember the supported types are the Java primitives, their wrappers (ie java.lang.Long), java.lang.String, arrays of these and JavaBeans which have fields of these types.
I think if you want to use Collections then you need to use the JAX-RPC enabled Web Services which we provide in the 10.1.3 releases of JDev and OC4J.
cheers
-steve- -
Im trying to compile the WL5.1 ResourceEntityResolver.java class but it is
referencing com.sun.java.util.collection package. Where can I find this
package?This can be an issue when using Tomcat and upgrading version of Mojarra.
Tomcat will store a file with the extension of .ser in the work directory. This file contains the names of the ServletContextListener instances
that need to be invoked when the application is next started. The problem is that if they use the values in that file and the listeners don't
exist, they don't rescan the application to rebuild the .ser, they just fail.
The way to fix this is to search for .ser files in your web container's work directory and the ones for the web application in question. -
JAXB External Binding to java.util.Collection
Hi,
By default jaxb converts xsd:sequence to java.util.List. Is there any way to specify that during compilation it will use java.util.Collection instead of List?
TIA,
Herculeus
Edited by: herculeus on May 19, 2009 2:12 PMrepost
-
Class not found com/sun/java/util/collections/list
hi
i am trying to execute the following:
java weblogic.jspc -d c:\weblogic\classes -keepgenerated
printAllParameters
and get the follwoing message:
class not found com/sun/java/util/collections/list
any suggestions?
thanx
Try it like this:
java weblogic.jspc -d c:\weblogic\classes;c:\weblogic\lib\weblogicaux.jar ...
Melrose Public Library <[email protected]> wrote:
> hi
> i am trying to execute the following:
> java weblogic.jspc -d c:\weblogic\classes -keepgenerated
> printAllParameters
> and get the follwoing message:
> class not found com/sun/java/util/collections/list
> any suggestions?
> thanx
Dimitri
-
Java.util.Collections$SynchronizedSet locked???
Hi,
I met a problem which is hard to diagnose:
platform: HPUX 11i
oracle client: Oracle 9.2.0.3
weblogic: weblogic7.0 sp1
pool type: oci
after running for a while, the whole system hung, and thread dump is like the
following:
the locked thread:
"ExecuteThread: '9' for queue: 'default'" daemon prio=10 tid=0x00318858 nid=21
lwp_id=77267 waiting for monitor entry [0x45e81000..0x45e80500]
at oracle.jdbc.driver.OraclePreparedStatement.close(OraclePreparedStatement.java:394)
- waiting to lock <0x505f6fd8> (a oracle.jdbc.driver.OracleConnection)
at weblogic.jdbc.common.internal.ConnectionEnv.dropStatement(ConnectionEnv.java:836)
at weblogic.jdbc.jts.Statement.close(Statement.java:237)
at weblogic.jdbc.rmi.internal.StatementImpl.close(StatementImpl.java:112)
at weblogic.jdbc.rmi.SerialStatement.close(SerialStatement.java:127)
at weblogic.jdbc.rmi.SerialConnection.closeAndClearAllStatements(SerialConnection.java:485)
- locked <0x774f04b8> (a java.util.Collections$SynchronizedSet)
at weblogic.jdbc.rmi.SerialConnection.$BIP$close(SerialConnection.java:210)
at weblogic.jdbc.rmi.SerialConnection.close(SerialConnection.java)
at com.ebao.life.bean.pub.common.DBean.close(DBean.java:222)
please note that 0x774f04b8was locked by this thread.
other thread are all waiting for the lock:
"ExecuteThread: '10' for queue: 'default'" daemon prio=10 tid=0x00319188 nid=22
lwp_id=77268 waiting for monitor entry [0x45dc1000..0x45dc0500]
at weblogic.jdbc.rmi.SerialConnection.closeAndClearAllStatements(SerialConnection.java:480)
- waiting to lock <0x774f04b8> (a java.util.Collections$SynchronizedSet)
at weblogic.jdbc.rmi.SerialConnection.$BIP$close(SerialConnection.java:210)
at weblogic.jdbc.rmi.SerialConnection.close(SerialConnection.java)
at com.ebao.life.bean.pub.common.DBean.close(DBean.java:222)
at com.ebao.pub.util.DBean.close(DBean.java:455)
at com.ebao.general.bs.service.autounderwriting.DbFlag.closeCon(DbFlag.java:111)
What happened and what may be the cause?
Hope your answer.
Thanks&Rgds
Luminlumin wrote:
Hi,
I met a problem which is hard to diagnose:
platform: HPUX 11i
oracle client: Oracle 9.2.0.3
weblogic: weblogic7.0 sp1
pool type: oci
after running for a while, the whole system hung, and thread dump is like the
following:
the locked thread:
"ExecuteThread: '9' for queue: 'default'" daemon prio=10 tid=0x00318858 nid=21
lwp_id=77267 waiting for monitor entry [0x45e81000..0x45e80500]
at oracle.jdbc.driver.OraclePreparedStatement.close(OraclePreparedStatement.java:394)
- waiting to lock <0x505f6fd8> (a oracle.jdbc.driver.OracleConnection)
at weblogic.jdbc.common.internal.ConnectionEnv.dropStatement(ConnectionEnv.java:836)
at weblogic.jdbc.jts.Statement.close(Statement.java:237)
at weblogic.jdbc.rmi.internal.StatementImpl.close(StatementImpl.java:112)
at weblogic.jdbc.rmi.SerialStatement.close(SerialStatement.java:127)
at weblogic.jdbc.rmi.SerialConnection.closeAndClearAllStatements(SerialConnection.java:485)
- locked <0x774f04b8> (a java.util.Collections$SynchronizedSet)
at weblogic.jdbc.rmi.SerialConnection.$BIP$close(SerialConnection.java:210)
at weblogic.jdbc.rmi.SerialConnection.close(SerialConnection.java)
at com.ebao.life.bean.pub.common.DBean.close(DBean.java:222)
please note that 0x774f04b8was locked by this thread.
other thread are all waiting for the lock:
"ExecuteThread: '10' for queue: 'default'" daemon prio=10 tid=0x00319188 nid=22
lwp_id=77268 waiting for monitor entry [0x45dc1000..0x45dc0500]
at weblogic.jdbc.rmi.SerialConnection.closeAndClearAllStatements(SerialConnection.java:480)
- waiting to lock <0x774f04b8> (a java.util.Collections$SynchronizedSet)
at weblogic.jdbc.rmi.SerialConnection.$BIP$close(SerialConnection.java:210)
at weblogic.jdbc.rmi.SerialConnection.close(SerialConnection.java)
at com.ebao.life.bean.pub.common.DBean.close(DBean.java:222)
at com.ebao.pub.util.DBean.close(DBean.java:455)
at com.ebao.general.bs.service.autounderwriting.DbFlag.closeCon(DbFlag.java:111)
What happened and what may be the cause?
Hope your answer.
Thanks&Rgds
LuminHi. What is the chance you have more than one thread closing the same connection?
Joe -
Error when importing java.util.Scanner
Agh! I'm in an introduction to computer science course, and I am writing a program as an assignment that's due tomorrow.
I have imported java.util.Scanner before, but I've only run it on the Windows PCs in the lab, whereas I am currently on a Mac. I've updated to the latest version of Java (through the software update), and I'm running Tiger (also fully updated).
I'm using Dr. Java to write the programs, but I tried using the very same thing in Eclipse and it didn't work. Here's my program:
import java.util.Random;
import java.util.Scanner;
public class Password {
public static void main(String[] args) {
//create a Scanner object to read from the keyboard:
String password;
Scanner scanner = new Scanner(System.in);
Random randomizer = new Random();
System.out.println("Please enter a string containing candidate characters.");
String input = scanner.next();
int charLength = length(input);
System.out.print("Random password: ");
System.out.print(input.substring(randomizer.nextInt(charLength)));
System.out.print(input.substring(randomizer.nextInt(charLength)));
System.out.print(input.substring(randomizer.nextInt(charLength)));
System.out.println(input.substring(randomizer.nextInt(charLength)));
And, here's my errors:
4 errors found:
File: /Users/brianmoore/Desktop/Password.java [line: 11]
Error: cannot resolve symbol
symbol : class Scanner
location: package util
File: /Users/brianmoore/Desktop/Password.java [line: 18]
Error: cannot resolve symbol
symbol : class Scanner
location: class Password
File: /Users/brianmoore/Desktop/Password.java [line: 18]
Error: cannot resolve symbol
symbol : class Scanner
location: class Password
File: /Users/brianmoore/Desktop/Password.java [line: 22]
Error: cannot resolve symbol
symbol : method length (java.lang.String)
location: class Password
Any ideas?Ok. I figured it out. On the Dr. Java page, this is what helped me:
Please verify the following:
- Open "/Applications/Utilities/Java/J2SE 5.0/Java
Preferences";
make sure "J2SE 5.0" is at the top of the list under
"Java
Application Runtime"
- Open DrJava; go to Edit->Preferences; make sure
"Tools.jar
Location", "JSR-14 Location", and "JSR-14
Collections Path"
are all blank
- Open the Help->About dialog box; make sure the "DrJava
Version" listed is 20050601-0007 or later (that is, later
than
June 1, 2005)
- Go to the "System Properties" tab in the
"About" box; make
sure "java.version" is 1.4.2.
Let us know what you find out if you're still having
trouble.
Thanks for your help! -
Model generation error when using java.util.List in JavaBeans
hi there,
when I try to generate model classes from JavaBeans classes,
packed into a JAR the generation process always stops with erros when the Bean class uses a property of type
java.util.List. See my example:
class MyJavaBean{
private java.util.List someMembers;
The error is:
Inspecting relation "MyJavaBean.SomeMembers" for source class "MyJavaBean"
[Warning]:This relation cannot be added as the TargetModelClass is not specified
[Error]: There are one or more relations unresolved. Importing the model without resolvoing the relations might result in erratic output.
Must I use a workaround or does anybody know something about this problem ? Installed: NW SP12
thx,
sabineHi Bhavik,
Can you please explain the error which you are getting while importing the model.
Please have a look at this tutorial.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/tutorial on using ejbs in web dynpro - 20.html
Hope it helps.
Regards,
Naresh -
SQLJ Iterator vs java.util.Iterator
Hi -
I'm trying to start using SQLJ a bit more, and I was wondering if anybody had some code samples for implementing a java.util.Collection or java.util.Iterator interface for a SQLJ Iterator? Lots of my utility code works on the standard collection/iterator/enumeration trio. Any great ideas out there for putting a standard interface on a SQLJ iterator?
Thanks!
-best-darr-
nullSounds intriguing - other than a similarity of name, these currently do not have anything in common.
There is one approach currently available to you: you can subclass the iterator class to provide your own functionality and use that subclass. See:
http://technet.oracle.com/tech/java/sqlj_jdbc/htdocs/sqlj-primer06i.htm
Source is in the distribution in:
.../sqlj/demo/SubclassIterDemo.sqlj
Your take -if I understand correctly - on this is to have the SQLJ translator automatically create implementations of the the various collection types from an iterator when you specify:
#sql iterator Iter implements SomeCollectionType (...);
In that case I am still unsure as to what the elements of the collection are. -
Zip created through java.util.zip but problem in windows XP compress folder
Hi friends,
I am a software developer ,working on java/j2ee.currently i am working in a document management software related to logistics.Here i am facing a problem at the time of open the zip file through windows XP's in built software called "Folder compress".It's creared through java.util.zip.zipoutputstream.but at time of open through xp compress folder software ,it's showing error that "you can't open this file , this file are protected for your computer security" , but when i trying to open it through winzip or winrar, it's not giving any problem.My also specefing the code snippet below :-
ZipOutputStream zip = null;
FileOutputStream fileWriter = null;
try
fileWriter = new FileOutputStream(destZipFile);
zip = new ZipOutputStream(fileWriter);
//required for XP compress
zip.setMethod(ZipOutputStream.DEFLATED);
zip.setLevel(Deflater.DEFAULT_COMPRESSION); //use default level
}catch (Exception ex){
ex.printStackTrace();
System.exit(0);
addFolderToZip("", srcFolder, zip);
try
zip.flush();
zip.close();
zip=null;
fileWriter.close();
fileWriter = null;
}catch (Exception ex)
//ex.printStackTrace();
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in Zip folder processing");
}I desperately looking for a help regarding this issue , if any body have any solution the please send at this forum.
Thanks,
Chiranjitthis file working file for winzip or winrar there is no problem.i am also sending the whole code of that java file that can help you better.
Program Name: EdocRetrieveServiceSLBean.java
Description: EdocRetrieveService CMP Bean Class
Classes: EdocRetrieveServiceSLBean
Package: net.mlog.edoc.ejb.entity
Modification History
<CR No> <Date> <Modified By> <Comments>
Version 1.0 2005.12.01 Sutapa Ray Create
/** The sequence of methods to be called.
===============================================================================================================================
1. mlogOriginDocumentAudit(String argActionDetails,int argDocumentId,int argActionId,String argActionByUserId)
2. mlogDestinationBatchDownload(Vector TREEDATA,String SessionIDVal,String argUserId)
a) Start DIR --
private String DoFolder(String folderNname)
b) Create the folder
private String CreateFolder(String FolderName,String newFolderPath)
c) Zip the folder
private void zipFolder(String srcFolder, String destZipFile)
d) Add folders to zip file
private void addToZip(String path, String srcFile, ZipOutputStream zip)
e) Add the srcFolder to the zip stream.
private void addFolderToZip(String path, String srcFolder, ZipOutputStream zip)
f) Delete Directory from server
public boolean deleteDir(File dir) {
3. mpsDocumentView(String argUserId,Integer[] argSfxFileId)
4. mlogOriginDocumentView(int argDocumentId,String argUserId)
5. findDocTypeForDocId(Integer argDocId) throws RemoteException;
package net.mlog.edoc.ejb.session;
import javax.ejb.SessionBean;
import javax.ejb.SessionContext;
import javax.ejb.CreateException;
import javax.ejb.ObjectNotFoundException;
import javax.ejb.FinderException;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.naming.Context;
import javax.rmi.PortableRemoteObject;
import java.rmi.RemoteException;
//import lib for all entity beans
import net.mlog.edoc.ejb.entity.IDocumentCMP;
import net.mlog.edoc.ejb.entity.IDocumentCMPHome;
import net.mlog.edoc.ejb.entity.IDocumentTypeCMP;
import net.mlog.edoc.ejb.entity.IDocumentTypeCMPHome;
import net.mlog.edoc.ejb.entity.IDocumentAuditCMP;
import net.mlog.edoc.ejb.entity.IDocumentAuditCMPHome;
//import lib for reader class of properties file
import net.mlog.edoc.ejb.session.PropertiesFileReader;
//import lib for user Define File class
import net.mlog.edoc.ejb.Session.EFile;
//import lib for SFXWebClient
import net.mlog.edoc.webservice.sfxWeb.ISFXWebClientSLHome;
import net.mlog.edoc.webservice.sfxWeb.ISFXWebClientSL;
import java.sql.Date;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import java.util.zip.Deflater;
import java.util.Vector;
import java.util.Iterator;
import java.util.Collection;
import java.util.StringTokenizer;
import java.util.Enumeration;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.File;
import java.io.InputStream;
import java.io.IOException;
import java.io.FileInputStream;
import java.io.FileOutputStream;
//import lib for NGP Mail
import javax.jms.Queue;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueConnection;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.JMSException;
import weblogic.jms.extensions.WLQueueSession;
import weblogic.jms.extensions.XMLMessage;
//import javax.mail.*;
//import javax.mail.internet.*;
//import lib for USI
import com.msl.security.USIException;
import com.msl.security.USIServerAPI;
import com.msl.security.UserPolicyData;
import net.msl.util.logging.MLogger;
public class EdocRetrieveServiceSLBean implements SessionBean {
private static final boolean VERBOSE = true;
private SessionContext ctx;
public void ejbActivate() {
public void ejbRemove() {
public void ejbPassivate() {
public void setSessionContext(SessionContext ctx) {
this.ctx = ctx;
public void ejbCreate () throws CreateException {
private static final MLogger logger;
static
logger = MLogger.getLogger(net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.class.getName(), "net/mlog/edoc/ejb/session/eDocRetrieveServiceMessagesXML");
//*********************KEEPING AUDITS OF DOCUMENTS BY MLOG ORIGIN PEOPLE*******************************
* <b>
* Used for Auditing the user action.
* </b>
* This function is called from various functions of eDocController
* <p>
* @param argActionDetails Gives the details of Action in document audit.
* @param argDocumentId gives the Document Id in Document Audit.
* @param argActionId Action Id in Document Audit.
* @param argActionByUserId User Id of the Docment Audit action.
* @return Returns a boolean value. 1 for success, 0 for Failure.
public boolean mlogOriginDocumentAudit(String argActionDetails,int argDocumentId,int argActionId,String argActionByUserId) throws RemoteException
//NGP/JDK Logging
boolean flag=false;
try{
//getting context of the server
InitialContext documentAuditCMPInitialContext=getInitialContext();
Object objDocumentAuditCMPRef=null;
try{
objDocumentAuditCMPRef=documentAuditCMPInitialContext.lookup("DocumentAuditCMPBeanJNDI");
catch(Exception e)
//NGP/JDK Logging if JNDI Not found
//logger.log(Level.SEVERE, "{0} : JNDI not found : {1}",new Object[] {"MSG002","DocumentAuditCMPBeanJNDI"});
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.JNDINotFound","DocumentAuditCMPBeanJNDI not found");
//find the maximum audit id in the Document_Audit table
//Home interface reference of DocumentAuditCMP EJB
//IDocumentAuditCMPHome iDocumentAuditCMPHomeRef=(IDocumentAuditCMPHome)PortableRemoteObject.narrow(objDocumentAuditCMPRef,IDocumentAuditCMPHome.class);
IDocumentAuditCMPHome iDocumentAuditCMPHomeRef=(IDocumentAuditCMPHome)objDocumentAuditCMPRef;
//Remote interface reference of DocumentAuditCMP EJB
IDocumentAuditCMP iDocumentAuditCMPCreateRef=iDocumentAuditCMPHomeRef.create(new Timestamp(System.currentTimeMillis()),argActionDetails,argActionByUserId,new Integer(argActionId),new Integer(argDocumentId));
//set flag to true if Document is audited
flag=true;
}//end of try
catch(Exception expt)
//logger.finer(expt);
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.CreateException","Exception in creating Document Audit record");
return flag;
//*********************BATCH DOWNLOAD OF DOCUMENTS BY MLOG ORIGIN PEOPLE*******************************
* <b>
* Used for Validating the documents.
* </b>
* This function is called from Struts
* <p>
* @param TREEDATA Treeset obtained after search.
* @param SessionIDVal gives the Session Value Id.
* @return Returns a boolean value. 1 for success, 0 for Failure.
public byte[] mlogDestinationBatchDownload(Vector TREEDATA,String SessionIDVal,String argUserId) throws RemoteException
//NGP/JDK Logging
/*FileHandler handler = null;
Logger logger=null;
try
PropertiesFileReader propertiesFileReaderRef=new PropertiesFileReader();
String logFile=propertiesFileReaderRef.getProperties("/edoc.properties","EDOC_LOG");
handler = new FileHandler("eDoc.log",0,1, true);
logger = Logger.getLogger("ErrorMsg");
logger.addHandler(handler);
logger.setLevel(Level.ALL);
}catch(Exception excp)
NGP/JDK Logging warning
logger.log(Level.WARNING, "{0} : Unable to find Resource Bundle File : {1}",new Object[] {"MSG001","ErrorMsg"});
//Remote interface reference of SFXWebClientSL
ISFXWebClientSL iSFXWebClientSLRef=null;
//Home interface reference of SFXWebClientSL
ISFXWebClientSLHome iSFXWebClientSLHomeRef=null;
Vector filePath=new Vector();
byte[] fileContent=null;
String eDocRoot="";
String eDocPathMain="";
String eDocPath="";
File tempRootFileforDelete = null;
if (TREEDATA.capacity() != 0 )
String BLNODirPath="";
String PONODirPath="";
String SONODirPath="";
// added for doc type level--2005.11.27--samar
String docTypeDirPath="";
String filepath="";
try
PropertiesFileReader propertiesFileReaderRef=new PropertiesFileReader();
filepath=propertiesFileReaderRef.getProperties("/edoc.properties","TEMP_FILE_DIR");
logger.finer("File Path:" +filepath);
}catch(Exception excp)
excp.printStackTrace();
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.IOException","TEMP_FILE_DIR property (edoc.properties) not found");
eDocRoot=CreateFolder("eDocTemp",filepath+File.separator);
// added for top level--2005.12.02--samar
//eDocRoot=CreateFolder("eDocTemp",System.getProperty("user.home")+File.separator);
//eDocPath=CreateFolder(SessionIDVal,eDocRoot+File.separator);
Enumeration TREEDATAEn = TREEDATA.elements(); //Setting The Tree Folder
String BLNO="";
String PONO="";
String SONO="";
String DNO ="";
while(TREEDATAEn.hasMoreElements())
StringTokenizer st = new StringTokenizer((TREEDATAEn.nextElement()).toString(),"_");
while (st.hasMoreTokens()) // Extract All the Fields Of Every Vector Element
BLNO = st.nextToken(); // CSBWNO
PONO = st.nextToken(); // PONO
SONO = st.nextToken(); // SONO
DNO = st.nextToken(); // DNO
eDocPathMain=CreateFolder(SessionIDVal,eDocRoot+File.separator);
eDocPath=CreateFolder("eDoc",eDocPathMain+File.separator);
BLNODirPath = CreateFolder(BLNO,eDocPath+File.separator);
PONODirPath = CreateFolder(PONO,BLNODirPath+File.separator);
SONODirPath = CreateFolder(SONO,PONODirPath+File.separator);
// added for doc type level--2005.11.27--samar
docTypeDirPath=CreateFolder(findDocTypeForDocId(new Integer(DNO)),SONODirPath+File.separator);
File tempRootFile=new File(eDocRoot);
tempRootFile.canWrite();
filePath.add(tempRootFile.getParent());
tempRootFileforDelete = tempRootFile;
//File tempeDocPathMainFile=new File(eDocPathMain);
//filePath.add(tempeDocPathMainFile.getParent());
//2005-12-01::code change for top level directory deletion
//File tempFile=new File(eDocPath);//BLNODirPath);
//filePath.add(tempFile.getParent());
filePath.add(eDocPathMain);
filePath.add(eDocPath);
filePath.add(BLNODirPath);
filePath.add(PONODirPath);
filePath.add(SONODirPath);
// added for doc type level--2005.11.27--samar
filePath.add(docTypeDirPath);
/* Access The Data from DataBase Temp Storage with Document Id And Store In This SO Folder */
/*Long Raw*/
try
InitialContext initialContext=new InitialContext();
int sfxid=0;
/*DriverManager.registerDriver (new oracle.jdbc.OracleDriver());
OraclePooledConnection pc = new OraclePooledConnection("jdbc:oracle:thin:hr/hr@essoraclesvr:1521:essorcl","edoc","edoc");
Connection con=new DBCon().Connect();//pc.getConnection();
PreparedStatement pstm=con.prepareStatement("select SFX_FILE_ID from DOCUMENT where DOCUMENT_ID=?");
//getting context of the server
InitialContext documentCMPInitialContext=getInitialContext();
Object objDocumentCMPRef=null;
try{
objDocumentCMPRef=documentCMPInitialContext.lookup("DocumentCMPBeanJNDI");
catch(Exception e)
//logger.log(Level.SEVERE, "{0} : JNDI not found : {1}",new Object[] {"MSG002","DocumentCMPBeanJNDI"});
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.JNDINotFound","DocumentCMPBeanJNDI not found");
//Home interface reference of DocumentCMP EJB
//IDocumentCMPHome iDocumentCMPHomeRef=(IDocumentCMPHome)PortableRemoteObject.narrow(objDocumentCMPRef,IDocumentCMPHome.class);
IDocumentCMPHome iDocumentCMPHomeRef=(IDocumentCMPHome)objDocumentCMPRef;
IDocumentCMP documentCMPRef=null;
//Remote interface reference of DocumentCMP EJB
try{
documentCMPRef=iDocumentCMPHomeRef.findByPrimaryKey(new Integer(DNO));
catch(Exception e)
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ObjectNotFound","Document Id not found");
/*pstm.setInt(1,Integer.parseInt(DNO));
ResultSet rs1=pstm.executeQuery();
if(rs1.next()){
sfxid=rs1.getInt(1);
sfxid=documentCMPRef.getSfxFileId().intValue();
logger.finer("sfxid==="+sfxid);
String strFile=documentCMPRef.getDocumentName().toString();
//SFX lookup
//InitialContext initialContext=new InitialContext();
Object sfxWebClient=null;
try{
sfxWebClient=initialContext.lookup("SFXWebClientJNDI");
catch(Exception e)
//NGP/JDK logging if JNDI not found
//logger.log(Level.SEVERE, "{0} : JNDI not found : {1}",new Object[] {"MSG002","SFXWebClientJNDI"});
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.JNDINotFound","SFXWebClientJNDI not found");
iSFXWebClientSLHomeRef=(ISFXWebClientSLHome)PortableRemoteObject.narrow(sfxWebClient,ISFXWebClientSLHome.class);
iSFXWebClientSLRef=iSFXWebClientSLHomeRef.create();//SFXWebClient reference creation
if(iSFXWebClientSLRef!=null)
//logger.finer("ffffffff---");
int arrSFXFileId[]=new int[1];
arrSFXFileId[0]=sfxid;
Object objEFile[]=iSFXWebClientSLRef.retrieveDocument(argUserId,arrSFXFileId);
if(objEFile.length>0)
byte b[]=(byte[])objEFile[1];
String f=strFile.substring(strFile.lastIndexOf(File.separator)+1,strFile.length());
// changed(instead of SONODirPath now docTypeDirPath) for doc type level--2005.11.27--samar
FileOutputStream fout=new FileOutputStream(docTypeDirPath+File.separator + f);
//logger.finer("SONODirPath+File.separator + f---"+SONODirPath+File.separator + f);
filePath.add(docTypeDirPath+File.separator + f);
int j;
for(j=0;j<b.length;j++)
fout.write(b[j]);
fout.close();
//for auditing the document
//logger.finer("Document download audited");
boolean flagAudit=mlogOriginDocumentAudit("Document has been downloaded",Integer.parseInt(DNO),5,argUserId);
//logger.finer("Audit complete"+flagAudit);
if(logger.isFinerLoggable()) {
logger.finer("Audit complete"+flagAudit);
//Delete after finish
tempRootFile.delete();
}catch(Exception e)
//e.printStackTrace();
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in Folder creation processing");
/* End Long Raw */
}// end of while hasMoreTokens
}// end of while hasMoreElements
}else{ }
/* Zip */
try
zipFolder(eDocPath+File.separator,eDocPath+".zip");
}catch(Exception excp)
////logger.finer(excp.toString());
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in Zip processing");
// send the byte array for the file
String fileName=eDocPath+".zip";
try{
File file=new File(fileName);
InputStream is = new FileInputStream(file);
// Get the size of the file
long length = file.length();
// You cannot create an array using a long type.It needs to be an int type.
// Before converting to an int type,check to ensure that file is not larger than Integer.MAX_VALUE.
//Kept for future requirement if any
if (length > Integer.MAX_VALUE) {
// File is too large
// Create the byte array to hold the data
fileContent = new byte[(int)length];
// Read in the bytes
int offset = 0;
int numRead = 0;
while (offset < fileContent.length
&& (numRead=is.read(fileContent, offset, fileContent.length-offset)) >= 0) {
offset += numRead;
// Ensure all the bytes have been read in
if (offset < fileContent.length) {
throw new IOException("Could not completely read file "+file.getName());
// Close the input stream and return bytes
is.close();
}catch(Exception e){
deleteDir(tempRootFileforDelete);
//trying for deleting folder and zip file
File file=new File(fileName);
if(file.exists())
file.delete();
//logger.finer("File Deleted successfully");
if(file.exists()){
//logger.finer("File Not Deleted ");
/* File FileToDelete = new File(eDocPath+".zip");
boolean DelStatus1 = deleteDir(FileToDelete);
//logger.finer("Deletion 1:"+DelStatus1 );
File FolderToDelete = new File(eDocPath);
boolean DelStatus2 = deleteDir(FolderToDelete);
//logger.finer("Deletion 2:"+DelStatus2);
for(int index=filePath.size()-1;index>=0;index--)
File delFile=new File(filePath.elementAt(index).toString());
//logger.finer(delFile.getAbsolutePath());
if(delFile.exists())
//logger.finer("Before delete---123");
//logger.finer("File Deleted========>"+delFile.delete());
//logger.finer("After delete---123");
//logger.finer(delFile.getAbsolutePath()+"-----------"+delFile.exists());
return fileContent;
/* ***************************Start DIR *********************/
private String DoFolder(String folderNname)
File f;
f = new File(folderNname);
f.mkdir(); // Create The Folder
//f.deleteOnExit(); //R n D to Delete The zip folders only */
return(folderNname+File.separator);
//to create the folder
private String CreateFolder(String FolderName,String newFolderPath)
String NewDir ="";
NewDir=newFolderPath + FolderName;
newFolderPath=DoFolder(NewDir);
return(NewDir);
//To zip the folder
private void zipFolder(String srcFolder, String destZipFile)
ZipOutputStream zip = null;
FileOutputStream fileWriter = null;
try
fileWriter = new FileOutputStream(destZipFile);
zip = new ZipOutputStream(fileWriter);
//required for XP compress
zip.setMethod(ZipOutputStream.DEFLATED);
zip.setLevel(Deflater.DEFAULT_COMPRESSION); //use default level
}catch (Exception ex){
ex.printStackTrace();
System.exit(0);
addFolderToZip("", srcFolder, zip);
try
zip.flush();
zip.close();
zip=null;
fileWriter.close();
fileWriter = null;
}catch (Exception ex)
//ex.printStackTrace();
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in Zip folder processing");
// File f2= new File(destZipFile);
* Write the content of srcFile in a new ZipEntry, named path+srcFile,of the zip stream
* The result is that the srcFile will be in the path folder in the generated archive.
* @param path String, the relative path with the root archive.
* @param srcFile String, the absolute path of the file to add
* @param zip ZipOutputStram, the stream to use to write the given file.
//the folders are added to zip file
private void addToZip(String path, String srcFile, ZipOutputStream zip)
File folder = new File(srcFile);
//folder.deleteOnExit();
if (folder.isDirectory()) {
addFolderToZip(path, srcFile, zip);
else {
//Transfer bytes from in to out
byte[] buf = new byte[1024];
int len;
FileInputStream in = null;
try {
in = new FileInputStream(srcFile);
// void putNextEntry(ZipEntry e) Begins writing a new ZIP file entry
// and positions the stream to the start of the entry data.
zip.putNextEntry(new ZipEntry(path +File.separator+ folder.getName()));
while ((len = in.read(buf)) > 0)
zip.write(buf, 0, len);
}catch (Exception ex){
ex.printStackTrace();
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in Adding to Zip Folder");
}finally{
try
//2005-12-01::file pointer close
in.close();
}catch(Exception e){
e.printStackTrace();
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in Adding to Zip Folder");
folder.delete(); //we addedd for DELETE
* add the srcFolder to the zip stream.
* @param path String, the relatif path with the root archive.
* @param srcFile String, the absolute path of the file to add
* @param zip ZipOutputStram, the stream to use to write the given file.
private void addFolderToZip(String path, String srcFolder, ZipOutputStream zip)
File folder = new File(srcFolder);
folder.canWrite();
//folder.deleteOnExit();
String fileListe[] = folder.list();
try
int i = 0;
while (true)
addToZip(path+File.separator+ folder.getName(), srcFolder+File.separator+fileListe, zip);
i++;
}catch (Exception ex)
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in Naming after adding to Zip Folder");
/* $$$$$$$$$$$$$$$$$ End Zipping $$$$$$$$$$$$$$$ */
/****************Start Of Deleting Directory from server***********/
public boolean deleteDir(File dir) {
// to see if this directory is actually a symbolic link to a directory,
// we want to get its canonical path
//- that is, we follow the link to the file it's actually linked to
File candir;
try {
candir = dir.getCanonicalFile();
} catch (IOException e) {
return false;
// a symbolic link has a different canonical path than its actual path,
// unless it's a link to itself
if (!candir.equals(dir.getAbsoluteFile())) {
//this file is a symbolic link, and there's no reason for us to follow it,
//because then we might be deleting something outside of the directory we were told to delete
return false;
// now we go through all of the files and subdirectories in the directory and delete them one by one
File[] files = candir.listFiles();
if (files != null) {
for (int i = 0; i < files.length; i++) {
File file = files[i];
//file read only set false
//in case this directory is actually a symbolic link, or it's empty,
//we want to try to delete the link before we try anything
boolean deleted = file.delete();
if (!deleted) {
// deleting the file failed, so maybe it's a non-empty directory
if (file.isDirectory()) deleteDir(file);
// otherwise, there's nothing else we can do
// now that we tried to clear the directory out, we can try to delete it again
return dir.delete();
/************End Of Deleting Directory *********************/
private InitialContext getInitialContext() throws NamingException {
try {
return new InitialContext();
} catch (NamingException ne) {
//logger.finer("Please make sure that the server is running.");
throw ne;
//*****************************WEB SERVICE FILE RETRIEVE IMPLEMENTATION FOR MPS PEOPLE*************************************************
* <b>
* Used for Retrieval of a document.
* </b>
* This function is called from retrieveDocument function of MPStoEdocWebServiceSLBean.
* <p>
* @param argUserId User Id of the user who wants to retrieve the document
* @param argSfxFileId[] Sfx File Id which gives the reference number of the document(s) in the SFX database.
* @return Returns a one dimentional Object array containing a series of file name and file content of the retrieved documents.
public Object[] mpsDocumentView(String argUserId,Integer[] argSfxFileId) throws RemoteException
//NGP/JDK logging
logger.finer("mpsDocumentView called--");
try{
argUserId=argUserId.toUpperCase();
catch(Exception e)
e.printStackTrace();
logger.finer("mpsDocumentView argSfxFileId[0]--"+argSfxFileId[0]);
Object[] searchResult=null;
/*FileHandler handler = null;
Logger logger=null;
int finalIndex=0;
try
//PropertiesFileReader propertiesFileReaderRef=new PropertiesFileReader();
//String logFile=propertiesFileReaderRef.getProperties("/edoc.properties","EDOC_LOG");
//handler = new FileHandler("eDoc.log",0,1, true);
//logger = Logger.getLogger("ErrorMsg");
//logger.addHandler(handler);
//logger.setLevel(Level.ALL);
}catch(Exception excp)
//NGP/JDK Logging warning
//logger.log(Level.WARNING, "{0} : Unable to find Resource Bundle File : {1}",new Object[] {"MSG001","ErrorMsg"});
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.JNDINotFound","PurchaseOrderCMPBeanJNDI not found");
Object objDocumentFile[]=null;
ISFXWebClientSLHome iSFXWebClientSLHomeRef=null;
ISFXWebClientSL iSFXWebClientSLRef=null;
try{
//Locating SFX WEB CLIENT SESSION BEAN
InitialContext initialContext=new InitialContext();
Object sfxWebClient=null;
try{
sfxWebClient=initialContext.lookup("SFXWebClientJNDI");
catch(Exception e)
//NGP/JDK Logging if JNDI not found
//logger.log(Level.SEVERE, "{0} : JNDI not found : {1}",new Object[] {"MSG002","SFXWebClientJNDI"});
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.JNDINotFound","SFXWebClientJNDI not found");
iSFXWebClientSLHomeRef=(ISFXWebClientSLHome)PortableRemoteObject.narrow(sfxWebClient,ISFXWebClientSLHome.class);
//creation of SFX we client
iSFXWebClientSLRef=iSFXWebClientSLHomeRef.create();
int arrSFXFileId[]=new int[argSfxFileId.length];
logger.finer("SFXWebClient created----");
//holds the sequence of SFX file id in the array
//EFile file=new EFile();
//getting context of the server
InitialContext documentCMPInitialContext=getInitialContext();
Object objDocumentCMPRef=null;
int docId=0;
try{
objDocumentCMPRef=documentCMPInitialContext.lookup("DocumentCMPBeanJNDI");
catch(Exception e)
//NGP/JDK Logging if JNDI not found
//logger.log(Level.SEVERE, "{0} : JNDI not found : {1}",new Object[] {"MSG002","DocumentCMPBeanJNDI"});
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.JNDINotFound","DocumentCMPBeanJNDI not found");
//Home interface reference of DocumentCMP EJB
//IDocumentCMPHome iDocumentCMPHomeRef=(IDocumentCMPHome)PortableRemoteObject.narrow(objDocumentCMPRef,IDocumentCMPHome.class);
IDocumentCMPHome iDocumentCMPHomeRef=(IDocumentCMPHome)objDocumentCMPRef;
//find the document id in the Document table from the SFx File Id
for(int index=0;index<argSfxFileId.length;index++)
arrSFXFileId[index]=argSfxFileId[index].intValue();
logger.finer("mpsDocumentView arrSFXFileId[index]--"+arrSFXFileId[index]);
logger.finer("For Document auditing----");
//Remote interface reference of DocumentCMP EJB
IDocumentCMP iDocumentCMPRef=iDocumentCMPHomeRef.findDocIdBySfxId(new Integer(arrSFXFileId[index]));
docId=iDocumentCMPRef.getDocumentId().intValue();
//for document audit
try{
boolean flagAudit=mlogOriginDocumentAudit("Document is Viewed",docId,5,argUserId);
catch(Exception e)
//logger.finer("Document cannot be audited----");
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in audit processing");
//call the retrieveDocument method for the above array of elements
//Object[] tempObjDocumentFile=iSFXWebClientSLRef.retrieveDocument(argUserId,arrSFXFileId);
//EFile file=new EFile();
//for(int index=0;index<tempObjDocumentFile.length;index++){
// file= (EFile) tempObjDocumentFile[index];
// objDocumentFile[finalIndex++]=file.getDocFileName();
// objDocumentFile[finalIndex++]=file.getDocFileContent();
objDocumentFile=iSFXWebClientSLRef.retrieveDocument(argUserId,arrSFXFileId);
//EFile[] efileArray = (EFile[]) = objDocumentFile;
searchResult = new Object[efileArray.length*2];
for (int i=0;i<efileArray.length;i=i+2)
EFile currentFile = efileArray[i];
searchResult[i] = currentFile.getDocFileName();
searchResult[i+1] = currentFile.getDocFileContent();
searchResult=iSFXWebClientSLRef.retrieveDocument(argUserId,arrSFXFileId);
}//end of try
catch(Exception expt)
//logger.finer(expt);
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in retrieve from SFX");
//if exception occurs returns null as per initilisation above
//logger.finer("mpsDocumentView size--"+objDocumentFile.length);
return searchResult;
//**************************** FILE RETRIEVE IMPLEMENTATION FOR MLOG PEOPLE*******************************
* <b>
* Used for Retrieval of a document.
* </b>
* This function is called from struts.
* <p>
* @param argDocumentId Documnet Id which gives the ID of the document in the eDoc database..
* @param argUserId User Id of the user who wants to retrieve the document
* @return Returns a one dimentional Object array containing a series of file name and file content of the retrieved documents.
public Object[] mlogOriginDocumentView(int argDocumentId,String argUserId) throws RemoteException
//NGP/JDK Logging
logger.finer("mlogOriginDocumentView called--");
try{
argUserId=argUserId.toUpperCase();
catch(Exception e)
//e.printStackTrace();
logger.log("net.mlog.edoc.ejb.session.EdocRetrieveServiceSLBean.ProcessException","Exception in uppercase");
//logger.finer("mlogOriginDocumentView-- argDocumentId---"+argDocumentId);
/*FileHandler handler = null;
Logger logger=null;
try
//PropertiesFileReader propertiesFileReaderRef=new PropertiesFileReader();
//String logFile=propertiesFileReaderRef.getProperties("/edoc.properties","EDOC_LOG");
//handler = new FileHandler("eDoc.log",0,1, tr -
Question on import java.util.ArrayList, etc.
Hi,
I was wondering what the following meant and what the differences were. When would I have to use these:
import java.util.ArrayList;
import java.util.Collections; <--I especially don't understand what this means
import java.util.Comparator; <---same for this (can I consolidate these into the bottom two?)
import java.io.*;
import java.util.*;MAresJonson wrote:
Also, what does this mean:
return foo == f.getFoo() ? true : false;
(more specifically...what does the "? true : false" mean and is there another way to code that?)It's called the ternary operator. For your specific example, you could just do:
return foo == f.getFoo();But, more generally,
return foo == f.getFoo() ? "equal" : "Not equal";means:
if (foo == f.getFoo()) {
return "equal";
else {
return "Not equal";
}As everyone else said at the same time... -
Why the Error in ArrayList Program : java.util.NoSuchElementException
import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.ListIterator;
import java.util.Collections;
import java.util.Random;
public class ArrayListDoubt {
public static void main(String[] args) {
// ArrayList Creation
List arraylistA = new ArrayList();
List arraylistB = new ArrayList();
// Adding elements to the ArrayList
for (int i = 0; i < 5; i++) {
arraylistA.add(new Integer(i));
arraylistB.add("beginner");
arraylistB.add("java");
arraylistB.add("tutorial");
arraylistB.add(".");
arraylistB.add("com");
arraylistB.add("java");
arraylistB.add("site");
// Iterating through the ArrayList to display the Contents.
Iterator i1 = arraylistA.iterator();
System.out.print("ArrayList arraylistA --> ");
while (i1.hasNext()) {
System.out.print(i1.next()+ " , ");
System.out.println();
System.out.print("ArrayList arraylistA --> ");
for (int j=0; j < arraylistA.size(); j++) {
System.out.print(arraylistA.get(j)+ " , ");
System.out.println();
Iterator i2 = arraylistB.iterator();
System.out.println("ArrayList arraylistB --> ");
while (i2.hasNext()) {
System.out.print(i2.next()+ " , ");
System.out.println();
System.out.println("Using ListIterator to retireve ArrayList Elements");
System.out.println();
ListIterator li = arraylistA.listIterator();
// next(), hasPrevious(), hasNext(), hasNext() nextIndex() can be used with a
// ListIterator interface implementation
System.out.println("ArrayList arraylistA --> ");
while (li.hasNext()) {
System.out.print(i1.next()+ " , ");
Output
ArrayList arraylistA --> 0 , 1 , 2 , 3 , 4 ,
ArrayList arraylistA --> 0 , 1 , 2 , 3 , 4 ,
ArrayList arraylistB -->
beginner , java , tutorial , . , com , java , site ,
Using ListIterator to retireve ArrayList Elements
ArrayList arraylistA -->
Exception in thread "main" java.util.NoSuchElementException
at java.util.AbstractList$Itr.next(AbstractList.java:427)
at ArrayListDoubt.main(ArrayListDoubt.java:58)System.out.println("Using ListIterator to
retireve ArrayList Elements");
System.out.println();
ListIterator li = arraylistA.listIterator();
next(), hasPrevious(), hasNext(), hasNext()
nextIndex() can be used with a
/ ListIterator interface implementation
System.out.println("ArrayList arraylistA -->
while (li.hasNext()) {
System.out.print(i1.next()+ " , ");
}I think you mean to call the next()-method of the ListIterator li, but instead call i1, which is an already used Iterator.
Where you want to iterate with ListIterator, change this line
System.out.print(i1.next()+ " , ");to this
System.out.print(li.next()+ " , ");and it works -
Java.util.Arrays; (method sort( ) )
1) How to change a direction of sorting (on increase / on decrease)?
2) Whether exists in java 2 something similar for sorting Strings ?1) How to change a direction of sorting (on increase
/ on decrease)?[url http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html#reverseOrder()]http://java.sun.com/j2se/1.5.0/docs/api/java/util/Collections.html#reverseOrder()
2) Whether exists in java 2 something similar for
sorting Strings ?Arrays.sort and Collections.sort will both sort the array or list as long as the type implements Comparable (or you supply a separate Comparator). Since String implements Comparable, those sort methods will sort the array or list of strings.
Making Java Objects Comparable
http://java.sun.com/docs/books/tutorial/collections/interfaces/order.html
http://www.javaworld.com/javaworld/jw-12-2002/jw-1227-sort.html -
Hi folks.
I am trying to reconstruct a Hashtable using my own way of serialization/deserialization via Java Reflection. It works fine with most classes, but a reconstructed hashtable is seriously screwed up. After reconstruction, it is passed as an argument to a class that uses the putAll-Method, which causes a NullpointerException.
The root in the stack trace is java.util.Hashtable.access$100 at line 90 in java.util.Hashtable. Unfortunately, if you check the source of hashtable, you will only find the class header on this line.
Is it correct, that javac creates access-methods for inner classes? What are they used for?
Any idea what could cause this?The exception happens whenever I try methods like toString, putAll or hashCode on the hashtable. The code of the deserialization is just a bit to complex to post here.
I have been able to track the problem down to the internal creation of creation of an iterator by the hashtable.
Here is the stack trace:
Exception in thread "main" java.lang.NullPointerException
at java.util.Hashtable.access$100(Hashtable.java:90)
at java.util.Hashtable$EntrySet.iterator(Hashtable.java:592)
at java.util.Collections$SynchronizedCollection.iterator(Collections.java:1096)
at java.util.Hashtable.hashCode(Hashtable.java:728)
at java.util.Hashtable.get(Hashtable.java:315)
at mypackage.serializer.XMLSerializer.buildXML(XMLSerializer.java:205)
at mypackage.serializer.XMLSerializer.buildXML(XMLSerializer.java:178)
at mypackage.serializer.XMLSerializer.main(XMLSerializer.java:66)
Maybe you are looking for
-
Why does my calendar app show me Adelaide time?
When you look at an appointment you have entered on you Calendar, whether on desktop or iPad,there are 3 views: 1) what you see when you open the app which might just be one word 2) a slightly more extended view when you touch or mouse click on it o
-
Ask the Expert:Cisco Web Security
With Ryan Wager Welcome to the Cisco Support Community Ask the Expert conversation. This is an opportunity to learn about design, configuration and troubleshooting of the Cisco Web Security Solutions including Cisco Ironport WSA and Cisco ScanSafe wi
-
Uag server windows update failes with code Code 80072EE2
I am trying to do a windows update of my uag 2010 server, but keep getting an error of Code 80072EE2. jason
-
.MTS, .m2t files and ClipWrap?
Once again I am totally confused! I thought that ClipWrap was an app to convert AVCHD video files to AIC, ProRes etc. However, I cannot get it to work. It asks for .m2t files but the AVCHD files I am experimenting with are .MTS and are completely gre
-
How do I delete a mainline clip, but keep clips above?
I have a mainline clip and have several other clips stacked above I want to get rid of the mainline clip and replace If I delete the mainline clip, then the above ones go as well I know I can replace i know I can drag another clip and then detach the