This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!

damien malone

Ranch Hand
+ Follow
since May 06, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by damien malone

Hi Henny

Yeah, we opened up an oracle TAR, they recommended checking the version of the jar file with your drivers, setting the buffer size through SQL (could only manage this in SQL developer), and a few other things I'm sorry I cant remember, in the end, none of it worked and we ended up going back to a clob. We just cast the column to xmltype whenever we want to run xpath queries on it then

i.e. select extractvalue(xmltype(clob_column_name), 'xpath_expression') from your_table_name

This meant adding a new column to the table of type clob and inserting the xmltype column values into that. This operation took a couple of hours on our live system which was a bit of a pain, and we then dropped the xmltype column.

Hope this helps, best of luck
Hi James,

I'm not sure why we are using the old drivers, I have just moved onto this project, but will get them updated.

I updated the drivers locally, and it didnt fix the issue, so I downloaded the oci dll and tried oci, still no joy. So, instead of using the view, I created a temporary table with the same SQL as the view,

CREATE table MVH_XML_DOC_temp ("MVH_DOC_ID", "MVH_XML_CONTENT", "MVH_CREATE_DATE", "MVH_CREATE_BY", "MVH_UPDATE_DATE", "MVH_UPDATE_BY") AS
select mvh_doc_id,
xml_doc.mvh_xml_content.getClobval() as mvh_xml_content,
mvh_create_date,
mvh_create_by,
mvh_update_date,
mvh_update_by
from mvh_xml_doc xml_doc;

and hey presto, it worked, so problem is on the database side, I have no problem what so ever is reading a CLOB > 32k when clob is the native type. For now, easiest solution to go change the datatype on the table.

Thanks very much for your help

Damien.
Hi James

Thanks for your reply, I've tried that but still the same error. I am currently using Oracle JDBC driver Version: 10.2.0.4.0 and eclipselink 1.2.0 (this was taken from the toplink distribution so oracle will support (also have a TAR open on this)). I have tried with the latest eclipselink version to see if the error is in there but get the same issue. I've attached the full console output. In this example, I am just using a straight JDBC connection to test and recreate as this error is happening in one of our live batch jobs.

The underlying data is stored in an XMLType row, but we are pulling it back from a view that has the clob contents


CREATE OR REPLACE FORCE VIEW "MVH_DATA"."V_MVH_XML_DOC" ("MVH_DOC_ID", "MVH_XML_CONTENT", "MVH_CREATE_DATE", "MVH_CREATE_BY", "MVH_UPDATE_DATE", "MVH_UPDATE_BY") AS
select mvh_doc_id,
xml_doc.mvh_xml_content.getClobval() as mvh_xml_content,
mvh_create_date,
mvh_create_by,
mvh_update_date,
mvh_update_by
from mvh_xml_doc xml_doc;

and the test class just loads up the instance of the class using the generic eclipselink load. I have also tried to load directly from the table with a DirectToXMLTypeMapping descriptor customiser but get the same issue.

Any help on this would be gratefully appreciated

Thanks
Damien

[Edit - our firewall wont let me upload the stack trace attachment so I have to insert it in here, sorry for this]



[EL Finest]: 2011-05-03 12:11:11.328--UnitOfWork(33114655)--Thread(Thread[main,5,main])--Execute query ReadObjectQuery(name="readObject" referenceClass=XmlDoc sql="SELECT MVH_DOC_ID, MVH_CREATE_BY, MVH_CREATE_DATE, MVH_UPDATE_BY, MVH_UPDATE_DATE, MVH_XML_CONTENT FROM V_MVH_XML_DOC WHERE (MVH_DOC_ID = ?)")
[EL Finest]: 2011-05-03 12:11:11.328--ServerSession(28497887)--Connection(5024475)--Thread(Thread[main,5,main])--Connection acquired from connection pool [default].
[EL Finest]: 2011-05-03 12:11:11.328--ClientSession(3870732)--Thread(Thread[main,5,main])--reconnecting to external connection pool
[EL Fine]: 2011-05-03 12:11:11.328--ClientSession(3870732)--Connection(23406754)--Thread(Thread[main,5,main])--SELECT MVH_DOC_ID, MVH_CREATE_BY, MVH_CREATE_DATE, MVH_UPDATE_BY, MVH_UPDATE_DATE, MVH_XML_CONTENT FROM V_MVH_XML_DOC WHERE (MVH_DOC_ID = ?)
bind => [214815]
[EL Warning]: 2011-05-03 12:11:13.032--UnitOfWork(33114655)--Thread(Thread[main,5,main])--Local Exception Stack:
Exception [EclipseLink-3001] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.ConversionException
Exception Description: The object [oracle.sql.CLOB@1510d96], of class [class oracle.sql.CLOB], could not be converted to [class java.lang.String].
Internal Exception: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-00600: internal error code, arguments: [kpolcbLobRead1: invalid len & bufp], [], [], [], [], [], [], [], [], [], [], []

Error Code: 600
at org.eclipse.persistence.exceptions.ConversionException.couldNotBeConverted(ConversionException.java:79)
at org.eclipse.persistence.internal.helper.ConversionManager.convertObject(ConversionManager.java:146)
at org.eclipse.persistence.internal.databaseaccess.DatasourcePlatform.convertObject(DatasourcePlatform.java:157)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.getObject(DatabaseAccessor.java:1146)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.fetchRow(DatabaseAccessor.java:927)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:625)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:526)
at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1729)
at org.eclipse.persistence.sessions.server.ClientSession.executeCall(ClientSession.java:234)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:207)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectOneRow(DatasourceCallQueryMechanism.java:667)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectOneRowFromTable(ExpressionQueryMechanism.java:2603)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectOneRow(ExpressionQueryMechanism.java:2574)
at org.eclipse.persistence.queries.ReadObjectQuery.executeObjectLevelReadQuery(ReadObjectQuery.java:444)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1080)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:808)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1040)
at org.eclipse.persistence.queries.ReadObjectQuery.execute(ReadObjectQuery.java:412)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1126)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2842)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1521)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1503)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1463)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.executeQuery(EntityManagerImpl.java:781)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.findInternal(EntityManagerImpl.java:725)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.find(EntityManagerImpl.java:619)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.find(EntityManagerImpl.java:498)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:365)
at $Proxy20.find(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:240)
at $Proxy20.find(Unknown Source)
at ie.vhi.mvh.dao.jpa.GenericDaoImpl.load(GenericDaoImpl.java:30)
at ie.vhi.mvh.test.testXMLDoc.testDao(testXMLDoc.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:82)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:240)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:180)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: ORA-00600: internal error code, arguments: [kpolcbLobRead1: invalid len & bufp], [], [], [], [], [], [], [], [], [], [], []

Error Code: 600
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:309)
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:305)
at org.eclipse.persistence.internal.helper.ConversionManager.convertObjectToString(ConversionManager.java:677)
at org.eclipse.persistence.internal.helper.ConversionManager.convertObject(ConversionManager.java:99)
... 71 more
Caused by: java.sql.SQLException: ORA-00600: internal error code, arguments: [kpolcbLobRead1: invalid len & bufp], [], [], [], [], [], [], [], [], [], [], []

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:283)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:278)
at oracle.jdbc.driver.T4C8TTILob.receiveReply(T4C8TTILob.java:930)
at oracle.jdbc.driver.T4C8TTIClob.read(T4C8TTIClob.java:223)
at oracle.jdbc.driver.T4CConnection.getChars(T4CConnection.java:2625)
at oracle.sql.CLOB.getChars(CLOB.java:354)
at oracle.sql.CLOB.getSubString(CLOB.java:247)
at org.eclipse.persistence.internal.helper.ConversionManager.convertObjectToString(ConversionManager.java:675)
... 72 more

[EL Finer]: 2011-05-03 12:11:13.079--UnitOfWork(33114655)--Thread(Thread[main,5,main])--release unit of work
[EL Finest]: 2011-05-03 12:11:13.079--ServerSession(28497887)--Connection(23406754)--Thread(Thread[main,5,main])--Connection released to connection pool [default].

Hi,

Using eclipselink to access oracle 11g database. Have a clob in one table, and it all works fine where the contents of the clob is less than 32676 characters long, but, when its longer, I get the following error

Caused by: java.sql.SQLException: ORA-00600: internal error code, arguments: [kpolcbLobRead1: invalid len & bufp], [], [], [], [], [], [], [], [], [], [], []

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:283)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:278)
at oracle.jdbc.driver.T4C8TTILob.receiveReply(T4C8TTILob.java:930)
at oracle.jdbc.driver.T4C8TTIClob.read(T4C8TTIClob.java:223)
at oracle.jdbc.driver.T4CConnection.getChars(T4CConnection.java:2625)
at oracle.sql.CLOB.getChars(CLOB.java:354)
at oracle.sql.CLOB.getSubString(CLOB.java:247)
at org.eclipse.persistence.internal.helper.ConversionManager.convertObjectToString(ConversionManager.java:675)

My attribute is defined as follows

@Lob
@Column(name="MVH_XML_CONTENT")
private String mvhXmlContent;

Any ideas would be great.

Thanks
Damien
when doing comparisons, its always nicer to put the constant first(i.e. "abc") as this will prevent null pointer errors
11 years ago
As pointed out in this earlier, use SSL, if you use client side encrytpion/hashing and send it in cleartext(http) you are achieving nothing, as the hashed/encrypted password is now the system password!!! Once someone intercepts the request, they can resend the hashed password to gain acess to the system at any time, making your efforts invane, SSl is the only way for this one!!
11 years ago
JSP
As pointed out above, use HTTPS to transmit password securely, but rather than looking at encrypting it, you should be hashing it. That way there is no way of retrieving the users password and makes non-repudiation easier, however all this comes at a cost, If you ever want to migrate users to a new system with its own password management (i.e. move to LDAP) you will have a harder time migrating the users accounts.
11 years ago
JSP
Have a quick read here

http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html

read section 8.2

The members of a class type are all of the following:

Members inherited from its direct superclass (�8.1.3), except in class Object, which has no direct superclass
Members inherited from any direct superinterfaces (�8.1.4)
Members declared in the body of the class (�8.1.5)
Members of a class that are declared private are not inherited by subclasses of that class. Only members of a class that are declared protected or public are inherited by subclasses declared in a package other than the one in which the class is declared.
Constructors, static initializers, and instance initializers are not members and therefore are not inherited.
11 years ago
we have similar issue, I think the only solution is to take the installServices.bat from 8.1 and tweak it a little so it has the 92 settings.
11 years ago
this is because both applications are using the same variable name to keep the jsessionid. If you look at your cookies while switching you will see the value in the jsessionid cookie on your client machine will change, meaning the when you return to your first app there is no way of finding the session. Two options, use url encoding (not nice) or change the jsessionid variable name in your second app(nice).
11 years ago
because they are running in sperate JVM's static variables wont work. Also updating environment variables wont work as they are local to each server.

Because both servers are on the one machine you could think about a quick and dirty solution of using a .lok file

i.e. on startup look for a file called something like createthread.lok

if file exists do nothing, if doesnt exist create empty file called that, run your code and delete the file at the end of the process.
11 years ago
Trying to access it as a file will never work from a jar, only the getResourceAsStream will work.

Its got to do with the class loader that is used. The File must be on the path of the classloader, so it should work anywhere from the root up along your com package structure.
11 years ago
turns out the PVCS server had a weird date format, by changing the indateformat to the same format all worked fine
12 years ago
chances are that ant isnt finding the class you are running,

try this in the target

<junit printsummary="yes" fork="yes" haltonfailure="yes" showoutput="yes">
<classpath refid="compile.classpath"/>
<formatter type="xml"/>
<test name="name of your class" todir="junitreports"/>
</junit>

Create the folder junitreports just off of where you run your tests

this will send the ant output to a file with a bit more detail, I would expect you will see a class not found exception or something similar in there
12 years ago
Hi

I am running Cruise control and PVCS. Cruise control is currently not picking up on modifications in the repository. Currently to work around this I have set the project to build even if no modifactions were found. The ant task is bringing down the latest code no problem.

Here is a snippet of my config.xml
<modificationset quietperiod="10" requiremodification="false">
<pvcs pvcsproject="t:\Self_Service" pvcssubproject="/Java" pvcsbin="C:\devel\opt\pvcs\vm\win32\bin"/>
</modificationset>


I've tried adding indateformat="MM/dd/yyyy HH:mm:ss" but this didnt seem to make any change.

The ant task that works fine to get the code is

<target name="getlatest">
<pvcs repository="t:\self_service" pvcsproject="/Java" workspace="/@/Public/cruisecontrol" updateonly="true"/>
</target>

Any help would be appreciated.

Thanks
Damien
12 years ago