StackOverflowError with XMLEncoder on my objects.
Works fine when I run the example:
XMLEncoder e = new XMLEncoder(
new BufferedOutputStream(
new FileOutputStream("Test.xml")));
e.writeObject(new JButton("Hello, world"));
e.close()
but when i run my little class I get java.lang.StackOverflowError below.
Could anyone help? (I'm new to XMLEncoder and relatively new to JavaBeans).
Thanks in advance.
Morten
java.lang.StackOverflowError
at java.lang.Class.getMethod0(Class.java:1756)
at java.lang.Class.getMethod(Class.java:963)
at java.beans.Statement.findPublicMethod(Statement.java:230)
at java.beans.Statement.findMethod(Statement.java:270)
at java.beans.Statement.getMethod(Statement.java:366)
at java.beans.Statement.invoke(Statement.java:439)
at java.beans.Expression.getValue(Expression.java:101)
at java.beans.Encoder.getValue(Encoder.java:84)
at java.beans.Encoder.get(Encoder.java:186)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:97)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
at java.beans.Encoder.writeObject(Encoder.java:55)
at java.beans.XMLEncoder.writeObject(XMLEncoder.java:250)
at java.beans.Encoder.writeExpression(Encoder.java:260)
at java.beans.XMLEncoder.writeExpression(XMLEncoder.java:363)
at java.beans.PersistenceDelegate.writeObject(PersistenceDelegate.java:100)
...
I think the problem here may be that the BeanBox does not
remove itself as a listener from its components before it
tries to serialise them. The XMLEncoder works out that the
JellyBean and co have listeners (because they are derivatives
of Component - which has a getListeners() method) and will attempt
to serialise those listeners. I suspect that one of these is
the BeanBox itself - or a component inside it. If that component
also knows about the beans it contains there is a possibility
the archiving process will loop - though somthing odd is happening
as the XMLEncoder should detect identical instances in the object
graph and mark them with an "idref" attribute - rather than looping.
It may be that the BeanBox clones part of itself when certain
getters are called. (I don't have your code so this is all a
bit of a guess.)
Anyway, if you want to look at this sort of thing a better
place to start is the BeanBuilder which is availible on the
SwingConnection website. The BeanBox predates all of the
archiving work - whereas the BeanBuilder was purpose built to
demonstrate it and the other new features in SDK 1.4.
Hope that helps.
Philip
Similar Messages
-
Problem with XMLEncoder for complex java object i
Hi All.
My problem with XMLEncoder is it doesnt transfrom java objects without default no arguement constructor. I was able to resolve this in my main java object class, by setting a new persistence delegate, but for other classes that are contained in the main class, they are not being encoded.
Thanks in advance for your answersBetter to put this in java forum :-)
Just check, if this helps.
http://forum.java.sun.com/thread.jspa?threadID=379614&messageID=1623434 -
How to fix the .pdf file with error "invalid annotation object"
how to fix the .pdf file with error "invalid annotation object"
As long as the PDF opens, then just try saving it to a new file name. There may be a preflight script that would help troubleshoot the issue.
-
Synchronize with Database on Entity Object re-creates Association
hi
Please consider this example application created using JDeveloper 11.1.1.4.0
at http://www.consideringred.com/files/oracle/2011/MovedAssociationApp-v0.01.zip
It has an EmpManagerFkAssoc Association which has been moved from the "movedassociationapp.model.entities" package to the "movedassociationapp.model.assoc" package (using the "Refactor - Move..." context-menu option).
When selecting "Synchronize with Database..." in the context-menu of the Employees Entity Object, and clicking the "Synchronize All" button, this results in JDeveloper re-creating the EmpManagerFkAssoc Association,
as shown in the screencast at http://screencast.com/t/l7jaoU2C
- (q1) Is this Association re-creation intended behaviour (if so, please explain, if not, which bug number)?
many thanks
Jan VerveckenFerez,
have you seen this thread in the ADF forum, Cannot 'Synchronize with database' my entity objects ?
It mentions the existence of a bug that may cause this (though no reference number), and one user posted a workaround they were using. -
Entity object attribute with a list of objects
Does anyone know how one sets up an entity object that has an attribute with a list of objects as the type? (assuming that's supported)
as in:
CREATE TYPE phones AS VARRAY(10) OF varchar2(10);
Create table suppliers (supcode number(5),
Company varchar2(20),
ph phones);
The SOA Suite in jDeveloper (new Entity Object/attributes etc) has an ARRAY that can point to REF or OBJECT. Neither work. When I try to Create DB Object later from the Entity Object I've created I get an invalid type.What you suggested about "validation codes on the VO" is not written on the ADF Documentation.
I try to blindly/strictly follow best practices (particularly on Validations, using Declartive and/or built in validators) on most ADF documentation and blogs but there are many scenarios on coding some large ADF projects that I think must veer away from the best practices stated on the documentation or maybe add new rules on the documentation depending on how complex an ADF project would be.
I religiously followed best practices stated on the documentation to use Entity and Attribute Validators when performing validations. What I did was i had created lots of Custom Validators (by implementing JboVAlidatorInterface interface) for each of the attributes on an Entity Object that need validated. So those validator is valid only for one attribute, its not reusable. And those validation codes either have reference to a ViewObject or call some PL/SQL procedure. So at some point are codes became messy.
Ultimately the whole project became harder to manage when the codes became large. Now I am trying to refactor the whole application by separating it into project/package and I am hoping to do it with little Re-coding as possible.
Hope to get your opinion on this one.
regards,
Anton -
Import-CMDriver fails with "Import-CMDriver : Invalid object path "
I am attempting to use Import-CMDriver but it fails with:
"Import-CMDriver : Invalid object path "
I can see that it is adding the driver to the catalog, but it is failing to add it to the package and I can't figure out why. I have tried with different inf files and deleted and created different packages. It just doesn't work. Here is
the command that I am running. I don't see any reason why it wouldn't work.
Set-Location abc:
foreach($iniFile in $infFilesToDeploy){
$cmDrivePackage = Get-CMDriverPackage -Name "PackageName"
$cmDriverCat = Get-CMCategory -CategoryType "DriverCategories" -Name "PackageName"
$cmDrivePackage
$iniFile
Import-CMDriver -UncFileLocation $iniFile -ImportDuplicateDriverOption AppendCategory -AdministrativeCategory $cmDriverCat -EnableAndAllowInstall $True -DriverPackage $cmDrivePackage -UpdateDistributionPointsforDriverPackage $false
As I said, it is seeing the ini file since it it importing it into the catalog. It just won't add it to the package. It also leaves the package in a locked state if I try to modify it after I run this command.
Anyone have any ideas why this command doesn't function?
Thank you for your time.Hi,
What's the version of your SCCM? I ran this command "Import-CMDriver -UncFileLocation... " on my SCCM 2012 R2 CU1. I didn't get the error above.
I also tried the command below, it ran successful.
$d=Get-CMDriverPackage -Id "..."
Import-CMDriver -UncFileLocation "\\..." -DriverPackage $d -EnableAndAllowInstall $true
Best Regards,
Joyce
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place. -
Populate object form with already provsioned resource object's data
OIM Version:
9102 BP19
Scenario:
We have to pre-populate resource object (ModifyObject) form fields with already provisioned resource object (ProvisionedObject) form fields which can be multi-instance resource.
This provided data will be used modify the already Provisioned resource object data (same ProvisionedObject). And this needs to be handled with approval workflow.
Approach:
We will use selected ProvisionedObject’s process instance key on web page in resource object pre-populate adapters. And using that process instance key we will fetch already provisioned resource (ProvisionedObject) object’s data.
Issue:
Not sure how can we pass the process instance key from WEB_PAGE to OIM_RESOURCE_OBJECT’s pre-populate adapter.
Any pointers towards the solution will be appreciated.My suggestion is...
At the time of raising the request, use userKey and in the code use getObjects() to retrieve the provisioned resource object information. Here you can retrieve Process Instance Key of the Provisioned resource and then retrieve the process data. So at this point you will have all the required data of the provisioned resource which can be returned to the object form field.
This is one approach. Experts may throw more pointers. -
Count total number of record of table with deletion from archiving object
Does anyone know is there any SAP standard program to count the total number of record of the table with deletion from Archiving Object and display in repprt?
Not sure of the question. Are you looking to get the sql "select count(*) from table" from using the TopLink expression framework or are you getting that SQL already and want something else?
If you are looking just to get the count from a table/class, you can use a ReportQuery:
ReportQuery rquery = new ReportQuery(ClassToQueryOn.class);
rquery.addCount(); //equivalent to count(*);
session.executeQuery(rquery);
You can use a report query to return data instead of objects, and use selection criteria just like a normal read query.
Best Regards,
Chris -
Methods associated with a given business object...
How can I find different methods associated with a given business object ? Any transaction ?
Thanks.
Regards,
Tushar.Use transaction SWO1.
-
How to synchronize test schema objects with the prod schema objects.
Hi,
I have a requirement of synchronizing test schema objects with the production schema objects. Please let me know the below
1. if there is a standardized method for such activity,
2. if there are oracle utilities for this task.
3. If i had to do this job manually, can you let me know the check list if any.
Thanks
Purushotham Mhttp://www.oracle.com/technetwork/issue-archive/2012/12-sep/o52sqldev-1735911.html
You could try database diff tool in sql developer(but there are some licence restrictions).
I don't know your database version, you could try DBMS_COMPARISON package also.
Look at this link http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_comparison.htm
Other solution is to create db link between test and production database, and then you can try different types of queries like
select table_name from user_tables
minus
select table_name from user_tables@db_link_to_other_database
And you can do this for columns, indexes and so on.
But you must have proper DDL scripts for this, to generate sync script.
Also there is a question about work process, you are doing sync in reverse order(from production to test). Test db is for test, after test you go to production db with proper ddl and dml scripts, so these schemas shouldn't be different in the first place(talking about schema, not data here). -
How to call a Derived call fucntion with a base class object ?
Hi all
i am working on a JNI interface to Java, and in the process of simulating a C++ behaviour in java
so i need some help form you people, in this regard.
here is a c++ code, i need a equivalent fucntionality in java , to put it one word, the question is
how to implement the dynamic_cast functionality in java, as java also has virtual fucntions, i think
this should be possible, if it is not, what is the alternative
class Base
public:
Base()
~Base()
virtual void F1()
cout<<"The BASE::F1() is called"<<endl;
virtual void F2()
cout<<"The BASE::F2() is called"<<endl;
class Derived : public Base
public:
Derived()
~Derived()
virtual void F3()
cout<<"The Derived::F3() is called"<<endl;
virtual void F4()
cout<<"The Derived::F4() is called"<<endl;
Base * GetDerived()
return new Derived();
int _tmain(int argc, _TCHAR* argv[])
Base *ptr = NULL;
ptr = GetDerived();
Derived *dPtr = dynamic_cast<Derived *>(ptr);
dPtr->F3();
}regards
pradishJust to clarify a point that I consider important--the distinction between references and objects:
Your subject is: How to call a Derived call fucntion with a base class object ? The answer to that is: You cannot. It is completely impossible in Java. If you have a base class object, the derivced class' methods are not present. On the other hand, if you have a compile-time reference of the parent type, but at runtime it happens to point to an instance of the derived class, then, as pointed out, you can cast the reference. (Note that casting does not apply to objects.) -
Set crystal report .rtp file with SAPbobsCOM.Recordset type object
Hi Experts,
I need to pass the resultset of my SAPbobsCOM.Recordset type query to the rpt file. what report object should i use. at the moment i am using reportdocument but at the point of calling .SetDataSource(rs) it says the datasource is not valid.
Please help.
Is there any addon sample regarding setting the recordsouce of a report by setting it with SAPbobsCOM.Recordset type object is availabel.
Regards.Hi Maryam,
In my sample I'm getting the values from a DataTable. But the procedure is the same for a RecordSet.
Private Sub PrintDM(ByRef oCompany As SAPbobsCOM.Company, ByRef oApplication As SAPbouiCOM.Application, ByRef oForm As SAPbouiCOM.Form)
Dim dt_h As Data.DataTable = Nothing
Dim drh As Data.DataRow = Nothing
Dim dt_r As Data.DataTable = Nothing
Dim drr As Data.DataRow = Nothing
Dim ds As Data.DataSet = Nothing
Dim rsNotaRecepcao As SAPbobsCOM.Recordset = Nothing
Dim rsMorada As SAPbobsCOM.Recordset = Nothing
Dim rptConnectionInfo As ConnectionInfo = Nothing
Dim rptPath As String = Nothing
Dim myTables As Tables = Nothing
Dim myTableLogonInfo As TableLogOnInfo = Nothing
Dim rptDocument As ReportDocument = Nothing
Dim FileName As String = "DiarioDeMovimentos"
Try
dt_h = New Data.DataTable("HEADER")
dt_h.Columns.Add("Key")
dt_h.Columns.Add("Empresa")
dt_h.Columns.Add("DiaryCod")
dt_h.Columns.Add("DiaryNam")
dt_h.Columns.Add("FromNum")
dt_h.Columns.Add("ToNum")
dt_h.Columns.Add("FromDate")
dt_h.Columns.Add("ToDate")
dt_h.Columns.Add("G")
dt_h.Columns.Add("A")
dt_h.Columns.Add("F")
dt_r = New Data.DataTable("ROWS")
dt_r.Columns.Add("Key")
dt_r.Columns.Add("Arquivo")
dt_r.Columns.Add("DataLancamento")
dt_r.Columns.Add("TipoDocumento")
dt_r.Columns.Add("Conta")
dt_r.Columns.Add("Debito")
dt_r.Columns.Add("Credito")
dt_r.Columns.Add("NumExterno")
dt_r.Columns.Add("DataDocumento")
dt_r.Columns.Add("DataVencimento")
dt_r.Columns.Add("Detalhes")
'#### Fill HEADER fields
With oForm.DataSources.UserDataSources
drh = dt_h.NewRow()
drh("Key") = "1"
drh("Empresa") = oCompany.CompanyName
drh("DiaryCod") = .Item("DSDiaryCod").ValueEx
drh("DiaryNam") = .Item("DSDiaryNam").ValueEx
If .Item("DSFromNum").ValueEx = "" Then
drh("FromNum") = "0"
Else
drh("FromNum") = DateFromDS(oApplication, .Item("DSFromNum").ValueEx)
End If
If .Item("DSToNum").ValueEx = "" Then
drh("ToNum") = "0"
Else
drh("ToNum") = DateFromDS(oApplication, .Item("DSToNum").ValueEx)
End If
If .Item("DSFromDate").ValueEx = "" Then
drh("FromDate") = "0"
Else
drh("FromDate") = DateFromDS(oApplication, .Item("DSFromDate").ValueEx)
End If
If .Item("DSToDate").ValueEx = "" Then
drh("ToDate") = "0"
Else
drh("ToDate") = DateFromDS(oApplication, .Item("DSToDate").ValueEx)
End If
drh("G") = .Item("DSGeneral").ValueEx
drh("A") = .Item("DSAnalitic").ValueEx
drh("F") = .Item("DSCashFlow").ValueEx
End With
dt_h.Rows.Add(drh)
Dim creditString As String = ""
Dim oBP As SAPbobsCOM.BusinessPartners
oBP.CreditLimit = IIf(creditString = "", 0.0, Convert.ToDouble(creditString))
(continues)
Hope it helps,
Regards,
Vítor Vieira -
StackOverflowError with a JDOException
Hi,
I'm getting a StackOverflowError when I catch a JDOException and try and
print it. The Kodo tutorial app throwing a kodo.util.UserException, but
when I try to print the stack trace it gets into an endless loop and I get
a java.lang.StackOverflowError. This is some of the stack trace (bear in
mind it is infinite):
Exception in thread "main" java.lang.StackOverflowError
at java.lang.Exception.<init>(Exception.java:33)
at java.lang.RuntimeException.<init>(RuntimeException.java:38)
at javax.jdo.JDOException.<init>(Unknown Source)
at javax.jdo.JDOCanRetryException.<init>(Unknown Source)
at javax.jdo.JDOUserException.<init>(Unknown Source)
at kodo.util.UserException.<init>(UserException.java:50)
at kodo.util.UserException.<init>(UserException.java:31)
at kodo.runtime.JDOState.error(JDOState.java:407)
at
kodo.runtime.PDeletedState.beforeOptimisticRead(PDeletedState.java:79
at
kodo.runtime.StateManagerImpl.isLoaded(StateManagerImpl.java:980)
at tutorial.Animal.jdoGetname(Animal.java)
at tutorial.Animal.getName(Animal.java:31)
at tutorial.Dog.toString(Dog.java:20)
at tutorial.Animal.toString(Animal.java:49)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
..and so on.
The toString method of JDOException does a toString on the associated
persistent object, but in this case the persistent object has been
deleted, so the read from the database fails...
This is not good, because printing an exception should NEVER cause another
exception to be thrown. Exceptions should be caught if the associated
persistent object cannot be printed. My question is: is this a bug in
Sun's JDO code, and could Kodo be modified
[kodo.util.UserException.toString() ?] to avoid this nasty situation?
Regards,
AlexAlex,
Based on your description, it sounds like you have invoked
deletePersistent() on the object in question. So, the "Operation attempted
on a deleted instance" exception is expected when you try to access the
object.
So, it sounds like the following is happening:
- invoke deletePersistent() on an object
- attempt to print the deleted object
- access a persistent field. Because the object has been deleted,
the persistent state has been cleared, and an exception is thrown
when the field is accessed (this is the "Operation attempted on a
deleted instance" exception).
- catch the exception
- attempt to print out the exception, which evidently is invoking
toString() on the object, which is causing an exception...
Does this make sense? So, either making toString() not access persistent
fields, or printing out the object before deleting it, should fix the
problem.
-Patrick
Since calling toString() is in turn accessing a persistent field,
On Tue, 14 Oct 2003 17:09:43 +0000, Alex Robbins wrote:
Sure,
I'm not doing anything clever, just running the tutorial app, with just 1
change made to it: I moved lines 83-84 of AnimalMaintenance to after the
call to pm.deletePersistentAll(objects) (line 87) so that it only prints
out the message if it successfully deleted the objects. This seems to have
broken the app. I've put it back to how it was, and it works fine.
This is a bit concerning, as I would have expected the toString method to
be indempotent (have no side effects), but you get diff behaviour if you
call the toString method. In the Java source, toString calls
Animal.getName which just returns the name member variable. BUT the
bytecode has been "enhanced" so that it is probably doing jdo stuff like
accessing the DB when you access the field. Somehow accessing the field
puts the object into a valid state, from where it can be deleted. But if
you try to delete it without doing a read, it fails with a
kodo.util.UserException, with the message "Operation attempted on a
deleted instance". I swear I have not deleted it - it is there in the DB.
To get the stack overflow, I just put a catch block into the main method
with prints e.toString() to stderr or does a e.printStackTrace() - either
causes the overflow. e.getMessage() is okay though. Looking in Sun's JDO
src, it is clear tha JDOException's toString does a toString on the
'failed' object, i.e. my poor Dog:
public String toString() {
int len = nested==null?0:nested.length;
// calculate approximate size of the String to return
StringBuffer sb = new StringBuffer (10 + 100 * len);
sb.append (super.toString());
// include failed object information
if (failed != null) {
sb.append (MSG_FAILED_OBJECT);
String failedToString = null;
try {
failedToString = failed.toString();
} catch (Exception ex) {
failedToString = msg.msg("MSG_ExceptionGettingFailedToString",
ex.toString()); //NOI18N
sb.append (failedToString);
// include nested Throwable information
if (len > 0) {
sb.append (MSG_NESTED_THROWABLES);
Throwable exception = nested[0];
sb.append (exception==null?"null":exception.toString()); //NOI18N
for (int i=1; i<len; ++i) {
sb.append ("\n"); //NOI18N
exception = nested;
sb.append (exception==null?"null":exception.toString()); //NOI18N
return sb.toString();
.and the toString on the Dog does some DB access which fails,
recursively, leading to a stack overflow. Nasty, huh?
Alex.
Stephen Kim wrote:
Hmm, are you calling a printStackTrace ()? Can you post the code you
are using to generate and parse the exception?
Alex Robbins wrote:
Hi,
I'm getting a StackOverflowError when I catch a JDOException and try and
print it. The Kodo tutorial app throwing a kodo.util.UserException, but
when I try to print the stack trace it gets into an endless loop and I get
a java.lang.StackOverflowError. This is some of the stack trace (bear in
mind it is infinite):
Exception in thread "main" java.lang.StackOverflowError
at java.lang.Exception.<init>(Exception.java:33)
at java.lang.RuntimeException.<init>(RuntimeException.java:38)
at javax.jdo.JDOException.<init>(Unknown Source)
at javax.jdo.JDOCanRetryException.<init>(Unknown Source)
at javax.jdo.JDOUserException.<init>(Unknown Source)
at kodo.util.UserException.<init>(UserException.java:50)
at kodo.util.UserException.<init>(UserException.java:31)
at kodo.runtime.JDOState.error(JDOState.java:407)
at
kodo.runtime.PDeletedState.beforeOptimisticRead(PDeletedState.java:79
at
kodo.runtime.StateManagerImpl.isLoaded(StateManagerImpl.java:980)
at tutorial.Animal.jdoGetname(Animal.java)
at tutorial.Animal.getName(Animal.java:31)
at tutorial.Dog.toString(Dog.java:20)
at tutorial.Animal.toString(Animal.java:49)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
at javax.jdo.JDOException.toString(Unknown Source)
.and so on.
The toString method of JDOException does a toString on the associated
persistent object, but in this case the persistent object has been
deleted, so the read from the database fails...
This is not good, because printing an exception should NEVER cause another
exception to be thrown. Exceptions should be caught if the associated
persistent object cannot be printed. My question is: is this a bug in
Sun's JDO code, and could Kodo be modified
[kodo.util.UserException.toString() ?] to avoid this nasty situation?
Regards,
Alex
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com
Patrick Linskey
SolarMetric Inc. -
Please help with retrieving values from object stored in a vector
hi..
i have a class Magazine with 2 varibles name and price like this
class magazine
String name;
int price;
i have created a vector called selectedmag which stores objects of Magazine class... now each object will contain the name and price rite...
i want to print the values stored in vector ie i want to print the vector elements...like
Name: Mag1
Price: 10
which wil be present in object1...
and then
Name: Mag2
Price:15
which wil be present in object2...
and so on...
plz help...
if i give selectedmag.elementAt(position) i am not able to get the above output...plz help me.....
thanks,
Akshathahi,
Yes i have used a for loop to print the values... it goes like this
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
class Magazine
String title;
int price;
public class sessiontrack1 extends HttpServlet
public void doPost(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
res.setContentType("text/html");
PrintWriter out=res.getWriter();
HttpSession session=req.getSession(true);
// This is my vector
Vector myshoppingcart=(Vector)session.getAttribute("ShoppingCart");
if(myshoppingcart==null)
myshoppingcart=new Vector();
Magazine selectedMag=new Magazine();
selectedMag.title=req.getParameter("Title");
selectedMag.price=Integer.parseInt(req.getParameter("Price"));
//Putting Magazine object into the vector myshoppingcart
myshoppingcart.addElement(selectedMag);
session.setAttribute("ShoppingCart",myshoppingcart);
out.println("<html><body>U have selected these magazines");
out.println("<br>");
//Enumeration vEnum=myshoppincart.elements();
//here a am trying to print output the values
for(int i=0;i<myshoppingcart.size();i++)
out.println("Name:" + (Magazine)myshoppingcart.elementAt(i));
out.println("<br>");
out.println("Price:" + (Magazine)myshoppingcart.elementAt(i));
out.println("<br>");
out.println("</body></html>");
this is a servlet program.... plz suggest me how to print the values... in the following format
Name: Book1
price: Rs 10
Name:Book2
price:Rs 15
Akshatha -
Problem with static and nonstatic objects in same code?
Hi everyone, I am working on a project and I kept running into an odd problem where my code would compile but when I went to run the code I would get an exception. I finally narrowed my problem down to a small fragment. Here is an example.
class Mut{
static Mut Fido = new Mut();
Mut Sammy = new Mut();
public static void main(String args[]){
This piece of code will compile but when I run it on an WindowsXP machine the JRE tells me there is an exception at line 3. If I change the code to this:
class Mut{
static Mut Fido = new Mut();
static Mut Sammy = new Mut();
public static void main(String args[]){
The code runs fine without any problems. My question is: why can't I create a static object and a nonstatic object in the same class? Is this a certain feature of JAVA I don't understand or is this a blackbox problem with XP? Any help is appreciated. Thanks
VanceIs the exception stack trace what is displayed in the command-line window? If it is here is what is displayed(This is a lot):
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
at Mut.<init>(Mut.java:3)
C:\>
I don't know if this is everything because the winow won't let me scroll back up to where I enterd "java Mut"
Hope this helps.
Message was edited by: Vance
cell@tech
Maybe you are looking for
-
MOVED: Help: MSI P35 NEO3-F +E5200 Overclocking
This topic has been moved to Overclockers & Modding Corner. https://forum-en.msi.com/index.php?topic=126174.0
-
How to Add Input Values into a XML in Flex AIR Application
I need a help, now I am developing a flex windows AIR application, in this I am displaying data using a xml file, I have some input fields in my application,if the application user filled the input field and press submit button, the inputs Should be
-
Blue Print View in JDeveloper 10.1.3.4
Hi, whenever I open files in BPEL files in JDeveloper at the moment, I get an extra button top-left called "Blue Print View" and a blank pane below it. I don't know what it does or why it's there, and can't find any documentation on it, or settings/p
-
Error while upgrading 2010 mode site collection in 2013 to 2013 mode site collection
05/08/2013 16:32:15.99 powershell (0x20A0) 0x310C SharePoint Foundation Upgrade SPFeatureDefinition aj2bj ERROR Feature upgrade action 'CustomUpgradeAction.Activate404ErrorPage' threw an exception upgrading Feature 'Publishing' (Id: 15/'22a9ef51-737b
-
Hi all, It seems that there is a limit on the size of the query that goes into Region Source. I have a query with characters(no spaces):24,476 and Charcaters(with spaces):33,069. I get page cannot be found error. I could do whatever possible in reduc