Problem using jdk 1.5.0
Hello all,
I have an application which is working on Java 1.4.0 and now i want to move it on Java 1.5. The version of Java 1.5 which i am using is jdk 1.5.0.16 on windows.
But when i try to compile my application on 1.5, it is giving me errors as
javax.management.InstanceNotFoundException: JMImplementation:service=LoaderRepository,name=Default
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1010)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:804)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:784)
at org.jboss.mx.loading.UnifiedClassLoader.<init>(UnifiedClassLoader.java:162)
at org.jboss.mx.loading.UnifiedClassLoader.<init>(UnifiedClassLoader.java:145)
at org.jboss.system.server.ServerImpl.initBootLibraries(ServerImpl.java:408)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:256)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:216)
at org.jboss.Main.boot(Main.java:142)
at org.jboss.Main$1.run(Main.java:375)
at java.lang.Thread.run(Thread.java:595)
I am not able to understand what all is this happening.
Please help
Thanks in advance
Monadear
As [Eamonn McManus|http://weblogs.java.net/blog/emcmanus/] answered in the [JMX Forum|http://forums.sun.com/thread.jspa?threadID=5316667&tstart=0], this is a conflict that results from using the JBoss-provided [JMX implementation|http://docs.jboss.org/jbossas/jboss4guide/r2/html/ch2.chapter.html] in [J2SE 5|http://java.sun.com/j2se/1.5.0/] with the provided platform JMX implementation. [JDK 1.4|http://java.sun.com/j2se/1.4.2/] did not provide an out-of-the-box JMX implementation, so there was no conflict.
Similar Messages
-
Problems using jdk 1.4.0-beta 2 with JDeveloper 3.2.3
I've problems using the jdk 1.4.0-beta 2 with JDeveloper 3.2.3.
Used jdk 1.3.1 before, evertything worked correctly, accept a smal prob with the minimize- and maximize-icons of JInternalframe.
Got mail that this would be solved with new jdk.
But when i define new JDK in JDeveloper and try to compile i get the following message:
Error: (0) initialization error: class Error const *: class file has wrong version 48.0, should be 45.3 or 46.0.
If i compile the code from the commandline with javac myself it compiles correctly and the program runs fine.
can anyone help??The problem you are having is that jdev doesn't support the new beta..I have the same problem and I am currently compiling and executing from the command line
I heard there is a workaround but I have never found it
sorry -
Problem using jdk included with JDEV9i
I am trying to use jdk supplied with jdev9i release candidate 2 on my system
(win 98).I have included c:\jde9i\jdk\bin in my system's path and c:\jdev9i\jdk\lib
in my class path.
But when I invoke compiler using javac it prints a long error message ,
some of them are given below(I can't see the main exception because it scrolls up).
Sun.misc.Resource Sun.misc.URLClassPath.getReasource(java.lang.String.boolean)
java.lang.Object java.net.URLClassLoader$1.run()
java.lang.Object java.security.AccessController.dePriviledged(java.security.
PriviledgedExceptionAction,java.security.AccessControlContext)
So how can I use this jdk to compile and run my other applications.Hi,
My document looks as follows:
<pre:inventory xmlns:pre="http://www.example.com/books">
<pre:book year="2000">
<pre:title>Snow Crash</pre:title>
<pre:author>Neal Stephenson</pre:author>
<pre:publisher>Spectra</pre:publisher>
<pre:isbn>0553380958</pre:isbn>
<pre:price>14.95</pre:price>
</pre:book>
<!-- more books... -->
</pre:inventory>
And I tried the following:
//pre:book
/pre:inventory and
/pre:inventory/pre:book
I have the necessaty code in my namespaceresolver as follows:
public String getNamespaceURI(String prefix) {
if (prefix == null)
throw new NullPointerException("Null prefix");
else if ("pre".equals(prefix))
return "http://www.example.com/books";
else if ("xml".equals(prefix))
return XMLConstants.XML_NS_URI;
return XMLConstants.NULL_NS_URI;
cheers,
ovisvana -
Debug problem using JDK 1.2.2
Hello,
I set up remote debugging in J-Dev 3.1.1.2 and was using it successfully for several days.
I then did some local debugging on a servlet that was compiled using 1.1.8 JDK. Now none of my servlets that are compiled under 1.2.2 can be debugged either locally or remotely. I get a message telling me that the class cannot be debugged.
Can anyone offer suggestions on what could be wrong?
ThanksI had this problem earlier today. I deleted the old workspace, created a new one, added my projects in again, recompiled and things were fine. Every now and then my workspaces seem to corrupt and I have to do this, although I don't always get the "can't debug class message"
<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Bill:
Hello,
I set up remote debugging in J-Dev 3.1.1.2 and was using it successfully for several days.
I then did some local debugging on a servlet that was compiled using 1.1.8 JDK. Now none of my servlets that are compiled under 1.2.2 can be debugged either locally or remotely. I get a message telling me that the class cannot be debugged.
Can anyone offer suggestions on what could be wrong?
Thanks <HR></BLOCKQUOTE>
null -
Very Urgent Unable to Launch Application using Web Start using JDK 1.4.2
Hi all
I am very serious issue i have ejb client swing application that uses
RMI to contact a session bean deployed in JBoss now i want the client app to be installed in the client machine using web start . Also i understand i require security permission to access network resources. so i have signed all the JAR files with same certificate created using self certificate avialiable in JDK by default also in the JNLP file in have included the following tag
<security>
<all-permissions/>
</security>
Now when I launch my application using Web start it gives an error that " Unsigned application is trying to access local resources"
I unable to understand what could be the problem . Please help me with the steps to be followed where in client should be able to RMI call to the server
Thanks in Advance
NaveenYou may have tried this already, but you might have to sign the jars via command line, outside any export process from your IDE.
$ jarsigner {filename}.jar {key from keystore}
I also had problems using webstart and RMI through an RCP
Ben -
Performance problems with jdk 1.5 on Linux plattform
Performance problems with jdk 1.5 on Linux plattform
(not tested on Windows, might be the same)
After refactoring using the new features from java 1.5 I lost
performance significantly:
public Vector<unit> units;
The new code:
for (unit u: units) u.accumulate();
runs more than 30% slower than the old code:
for (int i = 0; i < units.size(); i++) units.elementAt(i).accumulate();
I expected the opposite.
Is there any information available that helps?Here's the complete benchmark code I used:package test;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Vector;
public class IterationPerformanceTest {
private int m_size;
public IterationPerformanceTest(int size) {
m_size = size;
public long getArrayForLoopDuration() {
Integer[] testArray = new Integer[m_size];
for (int item = 0; item < m_size; item++) {
testArray[item] = new Integer(item);
StringBuilder builder = new StringBuilder();
long start = System.nanoTime();
for (int index = 0; index < m_size; index++) {
builder.append(testArray[index]);
long end = System.nanoTime();
System.out.println(builder.length());
return end - start;
public long getArrayForEachDuration() {
Integer[] testArray = new Integer[m_size];
for (int item = 0; item < m_size; item++) {
testArray[item] = new Integer(item);
StringBuilder builder = new StringBuilder();
long start = System.nanoTime();
for (Integer item : testArray) {
builder.append(item);
long end = System.nanoTime();
System.out.println(builder.length());
return end - start;
public long getArrayListForLoopDuration() {
ArrayList<Integer> testList = new ArrayList<Integer>();
for (int item = 0; item < m_size; item++) {
testList.add(item);
StringBuilder builder = new StringBuilder();
long start = System.nanoTime();
for (int index = 0; index < m_size; index++) {
builder.append(testList.get(index));
long end = System.nanoTime();
System.out.println(builder.length());
return end - start;
public long getArrayListForEachDuration() {
ArrayList<Integer> testList = new ArrayList<Integer>();
for (int item = 0; item < m_size; item++) {
testList.add(item);
StringBuilder builder = new StringBuilder();
long start = System.nanoTime();
for (Integer item : testList) {
builder.append(item);
long end = System.nanoTime();
System.out.println(builder.length());
return end - start;
public long getArrayListIteratorDuration() {
ArrayList<Integer> testList = new ArrayList<Integer>();
for (int item = 0; item < m_size; item++) {
testList.add(item);
StringBuilder builder = new StringBuilder();
long start = System.nanoTime();
Iterator<Integer> iterator = testList.iterator();
while(iterator.hasNext()) {
builder.append(iterator.next());
long end = System.nanoTime();
System.out.println(builder.length());
return end - start;
public long getLinkedListForLoopDuration() {
LinkedList<Integer> testList = new LinkedList<Integer>();
for (int item = 0; item < m_size; item++) {
testList.add(item);
StringBuilder builder = new StringBuilder();
long start = System.nanoTime();
for (int index = 0; index < m_size; index++) {
builder.append(testList.get(index));
long end = System.nanoTime();
System.out.println(builder.length());
return end - start;
public long getLinkedListForEachDuration() {
LinkedList<Integer> testList = new LinkedList<Integer>();
for (int item = 0; item < m_size; item++) {
testList.add(item);
StringBuilder builder = new StringBuilder();
long start = System.nanoTime();
for (Integer item : testList) {
builder.append(item);
long end = System.nanoTime();
System.out.println(builder.length());
return end - start;
public long getLinkedListIteratorDuration() {
LinkedList<Integer> testList = new LinkedList<Integer>();
for (int item = 0; item < m_size; item++) {
testList.add(item);
StringBuilder builder = new StringBuilder();
long start = System.nanoTime();
Iterator<Integer> iterator = testList.iterator();
while(iterator.hasNext()) {
builder.append(iterator.next());
long end = System.nanoTime();
System.out.println(builder.length());
return end - start;
public long getVectorForLoopDuration() {
Vector<Integer> testVector = new Vector<Integer>();
for (int item = 0; item < m_size; item++) {
testVector.add(item);
StringBuilder builder = new StringBuilder();
long start = System.nanoTime();
for (int index = 0; index < m_size; index++) {
builder.append(testVector.get(index));
long end = System.nanoTime();
System.out.println(builder.length());
return end - start;
public long getVectorForEachDuration() {
Vector<Integer> testVector = new Vector<Integer>();
for (int item = 0; item < m_size; item++) {
testVector.add(item);
StringBuilder builder = new StringBuilder();
long start = System.nanoTime();
for (Integer item : testVector) {
builder.append(item);
long end = System.nanoTime();
System.out.println(builder.length());
return end - start;
public long getVectorIteratorDuration() {
Vector<Integer> testVector = new Vector<Integer>();
for (int item = 0; item < m_size; item++) {
testVector.add(item);
StringBuilder builder = new StringBuilder();
long start = System.nanoTime();
Iterator<Integer> iterator = testVector.iterator();
while(iterator.hasNext()) {
builder.append(iterator.next());
long end = System.nanoTime();
System.out.println(builder.length());
return end - start;
* @param args
public static void main(String[] args) {
IterationPerformanceTest test = new IterationPerformanceTest(1000000);
System.out.println("\n\nRESULTS:");
long arrayForLoop = test.getArrayForLoopDuration();
long arrayForEach = test.getArrayForEachDuration();
long arrayListForLoop = test.getArrayListForLoopDuration();
long arrayListForEach = test.getArrayListForEachDuration();
long arrayListIterator = test.getArrayListIteratorDuration();
// long linkedListForLoop = test.getLinkedListForLoopDuration();
long linkedListForEach = test.getLinkedListForEachDuration();
long linkedListIterator = test.getLinkedListIteratorDuration();
long vectorForLoop = test.getVectorForLoopDuration();
long vectorForEach = test.getVectorForEachDuration();
long vectorIterator = test.getVectorIteratorDuration();
System.out.println("Array for-loop: " + getPercentage(arrayForLoop, arrayForLoop) + "% ("+getDuration(arrayForLoop)+" sec)");
System.out.println("Array for-each: " + getPercentage(arrayForLoop, arrayForEach) + "% ("+getDuration(arrayForEach)+" sec)");
System.out.println("ArrayList for-loop: " + getPercentage(arrayForLoop, arrayListForLoop) + "% ("+getDuration(arrayListForLoop)+" sec)");
System.out.println("ArrayList for-each: " + getPercentage(arrayForLoop, arrayListForEach) + "% ("+getDuration(arrayListForEach)+" sec)");
System.out.println("ArrayList iterator: " + getPercentage(arrayForLoop, arrayListIterator) + "% ("+getDuration(arrayListIterator)+" sec)");
// System.out.println("LinkedList for-loop: " + getPercentage(arrayForLoop, linkedListForLoop) + "% ("+getDuration(linkedListForLoop)+" sec)");
System.out.println("LinkedList for-each: " + getPercentage(arrayForLoop, linkedListForEach) + "% ("+getDuration(linkedListForEach)+" sec)");
System.out.println("LinkedList iterator: " + getPercentage(arrayForLoop, linkedListIterator) + "% ("+getDuration(linkedListIterator)+" sec)");
System.out.println("Vector for-loop: " + getPercentage(arrayForLoop, vectorForLoop) + "% ("+getDuration(vectorForLoop)+" sec)");
System.out.println("Vector for-each: " + getPercentage(arrayForLoop, vectorForEach) + "% ("+getDuration(vectorForEach)+" sec)");
System.out.println("Vector iterator: " + getPercentage(arrayForLoop, vectorIterator) + "% ("+getDuration(vectorIterator)+" sec)");
private static NumberFormat percentageFormat = NumberFormat.getInstance();
static {
percentageFormat.setMinimumIntegerDigits(3);
percentageFormat.setMaximumIntegerDigits(3);
percentageFormat.setMinimumFractionDigits(2);
percentageFormat.setMaximumFractionDigits(2);
private static String getPercentage(long base, long value) {
double result = (double) value / (double) base;
return percentageFormat.format(result * 100.0);
private static NumberFormat durationFormat = NumberFormat.getInstance();
static {
durationFormat.setMinimumIntegerDigits(1);
durationFormat.setMaximumIntegerDigits(1);
durationFormat.setMinimumFractionDigits(4);
durationFormat.setMaximumFractionDigits(4);
private static String getDuration(long nanos) {
double result = (double)nanos / (double)1000000000;
return durationFormat.format(result);
} -
Using JDK 1.5 in frame font is appearing different as it is coming in 1.4
When I am going to compile my application using jdk 1.4 and 1.5 both,in 1.5 fonts in my application component like frame,dialog fonts are appearing in different manner means in 1.5 it is appearing in bolder manner.
We are developing framework application and we have to give release for jdk 1.5 version but it is giving font difference.
Please resolve this issue because it is very urgent and critical.
this is not our framework problem i have developed one below simple application and compiled it in jdk 1.4 and 1.5 it is showing font difference.
Fonts like times new roman and arial etc are coming in bolder manner means more width but height and style is same.
i have snapshot also but i am not able to paste becasue editor is not accepting images.
I am giving you small program that will reproduce defect apart from my application.
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FontMetrics;
import java.awt.Frame;
import java.awt.Graphics;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.SwingConstants;
public class WizardDemo14
public static void main(String[] args)
JFrame dlg = new JFrame("COMPILED IN 1.5");
JLabel jLabel1 = new JLabel();
jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 50));
jLabel1.setForeground(Color.blue);
jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
jLabel1.setHorizontalTextPosition(SwingConstants.CENTER);
jLabel1.setText("Finish...");
dlg.getContentPane().setLayout(new BorderLayout());
dlg.getContentPane().add(jLabel1);
dlg.setSize(400 ,400);
dlg.setVisible(true);
dlg.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Please help me
Edited by: umesh3077 on Apr 2, 2008 6:44 AMBelow taken directly from the v1.6x API java.awt.Font class doco:he Java Platform distinguishes between two kinds of fonts: physical fonts and
logical fonts.
Physical fonts are the actual font libraries containing glyph data and tables to
map from character sequences to glyph sequences, using a font technology
such as TrueType or PostScript Type 1. All implementations of the Java
Platform must support TrueType fonts; support for other font technologies is
implementation dependent. Physical fonts may use names such as Helvetica,
Palatino, HonMincho, or any number of other font names. Typically, each
physical font supports only a limited set of writing systems, for example, only
Latin characters or only Japanese and Basic Latin. The set of available
physical fonts varies between configurations. Applications that require specific
fonts can bundle them and instantiate them using the createFont method.
Logical fonts are the five font families defined by the Java platform which must
be supported by any Java runtime environment: Serif, SansSerif, Monospaced,
Dialog, and DialogInput. These logical fonts are not actual font libraries.
Instead, the logical font names are mapped to physical fonts by the Java
runtime environment. The mapping is implementation and usually locale
dependent, so the look and the metrics provided by them vary. Typically, each
logical font name maps to several physical fonts in order to cover a large range
of characters.
Peered AWT components, such as Label and TextField, can only use logical
fonts.
For a discussion of the relative advantages and disadvantages of using
physical or logical fonts, see the Internationalization FAQ document. -
Problem including jdk.dio into Hello World Example
Hi
I followed the Hello World Example and this worked on my raspberry pi. Then I tried to use jdk.dio to access some hardware via GPIO unfortunately then the build of the Deployment Package fails with :
# 2/7/15 4:35:16 PM CET
# Eclipse Compiler for Java(TM) v20140902-0626, 3.10.0, Copyright IBM Corp 2000, 2013. All rights reserved.
1. ERROR in .../HelloOsgi.java (at line 9)
import jdk.dio.ClosedDeviceException;
^^^^^^^
The import jdk.dio cannot be resolved
2. ERROR in .../HelloOsgi.java (at line 10)
import jdk.dio.Device;
^^^^^^^
The import jdk.dio cannot be resolved
It builds without an error inside of eclipse. I added the dependencies to the manifest
Manifest-Version: 1.0
Import-Package: jdk.dio;version="1.0.0",
jdk.dio.gpio;version="1.0.0",
jdk.dio.spibus;version="1.0.0",
org.osgi.service.component;version="1.2.0",
org.slf4j;version="1.6.4"
Service-Component: OSGI-INF/component.xml
and to the build.properties
output.. = bin/
bin.includes = META-INF/,\
OSGI-INF/
source.. = src/
additional.bundles = org.eclipse.osgi.services,\
slf4j.api,\
org.eclipse.kura.api,\
jdk.dio
What did I miss to do, so that the 'jdk.dio' can be resolved when building Deployment Package?
Thanks and Regards
- Franz
(*)eclipse.github.io/kura/doc/hello-example.htmlI downloaded the "Developer's Workspace (with Web UI) " (user_workspace_archive_1.1.0.zip) from Kura 1.1.1 Extended Downloads (eclipse.org/kura/downloads.php) and imported this into my Eclipse workspace on my development machine. I checked the ZIP file it contains the jdk.dio_1.0.0.jar as stated in my Manifest and not 1.0.1 as you mentioned.
I also checked on the target (raspberry pi) where I installed the "Raspbian (No, Net, with Web UI) - Stable" from Kura 1.1.1 Extended Downloads. Also here it is jdk.dio_1.0.0.jar under /opt/eclipse/kura/plugins.
I don't think its a Version problem since Eclipse can build the code and finds all the dependencies. It is just when I try to export a 'Deployable plug-ins and fragments' or try to create the Deployment Package that the build fails.
I found a workaround for the 'Deployable plug-ins and fragments' there I have to check the option 'Use class files compiled in the workspace' and the I can export it since the export does not need to build it just uses the already built classes from eclipse. I did not find such an option for the creation of the Deployment Package.
Anyway I would like to be able to build without an IDE.
What is the suggested approach to build a Deployment Package for Kura without the IDE so it could be integrated in some kind of a CI process?
Is maven/tycho the way to go?
Any help or hint is appreciated.
Thanks Regards
- Franz -
Problem using jsp:include from inside a custom tag
Hi, All !
I have a problem using <jsp:include> from inside a custom tag. Exception is:
"java.lang.ClassCastException: weblogic.servlet.jsp.BodyContentImpl"
Apparently, weblogic tries to cast BodyContentImpl to JspWriterImpl and
could not do this. Is it a bug, since in the 1.1 spec is said: "The
BodyContent is a subclass of JspWriter that can be used to process body
evaluations so they can retrieved later on."
My code is:
<wfmklist:items>
<jsp:include page="item.jsp" flush="true"/>
</wfmklist:items>
This is an area of contention with WL. It is not so tolerant with regards to
the spec. I spent several days recently trying to convince it to accept the
specification in regards to bodies and includes and it appears to have
successfully rebuffed my efforts.
Frankly, this is very disappointing. It appears that some shortcuts were
taken on the way to JSP 1.1 support, and the result is a very hard-coded,
inflexible implementation. As I have not seen the implementation myself, I
hate to assume this, however one could posit that the term "interface" was a
foreign concept during the implementation, other than as some annoying
intermediary reference requiring an immediate cast to a specific Weblogic
class, which in turn is apparently required to be final or have many final
methods, as if being optimized for a JDK 1.02 JIT.
I am sorry that I don't have any positive suggestions other than to use a
URL object to come back in an execute the necessary "include" directly. You
lose all context (other than session) and that can cause its own problems.
However, you can generally get the URL approach to work, and you will
hopefully avoid further frustration.
Peace,
Cameron Purdy
Tangosol, Inc.
http://www.tangosol.com
Tangosol: How Weblogic applications are customized
"Denis" <[email protected]> wrote in message
news:[email protected]...
> Hi, All !
> I have a problem using <jsp:include> from inside a custom tag. Exception
is:
> "java.lang.ClassCastException: weblogic.servlet.jsp.BodyContentImpl"
>
> Apparently, weblogic tries to cast BodyContentImpl to JspWriterImpl and
> could not do this. Is it a bug, since in the 1.1 spec is said: "The
> BodyContent is a subclass of JspWriter that can be used to process body
> evaluations so they can retrieved later on."
>
> My code is:
> ...
> <wfmklist:items>
> <jsp:include page="item.jsp" flush="true"/>
> </wfmklist:items>
> ...
-
Problem using CLOB in JDBC (NewLOBAPISample)
I've just tried to run the JDBC NewLOBAPISample, and everything works fine until I try to insert or update on the CLOB column using any characters other than base ASCII. For example, if I attempt to insert the String "$100", it works just fine, but "£100" results in:
java.sql.SQLException: No more data to read from socket
I've experimented with this issue with a much smaller test case of my own, and I've been able to narrow down the problem, as I've outlined below. In all cases, PreparedStatement is used for executing.
Let's say we have a table named "Test" with one CLOB column named "text".
The original "official" API for inserting a CLOB using the latest 1.4 JDBC Oracle thin driver is:
// first insert an "empty CLOB"
PreparedStatement ps;
ps = con.prepareStatement("INSERT INTO Test (text) VALUES (empty_clob())");
ps.executeUpdate();
// then select the empty CLOB
con.setAutoCommit(false);
ps = con.prepareStatement("SELECT text FROM Test FOR UPDATE");
ResultSet rs = ps.executeQuery();
rs.next();
CLOB clob = ((OracleResultSet)rs).getCLOB(1);
// now write to the CLOB
Writer out = clob.getCharacterOutputStream();
out.write(myLongText);
out.close();
// we're done
connection.commit();
The method that is advertised in NewLOBAPISample, and which I've also seen on the Java Developer Forum, is outlined here:
// first, create statement to insert
PreparedStatement ps;
ps = con.prepareStatement("INSERT INTO Test (text) VALUES (?)");
// create a temporary CLOB and write to it
CLOB clob = CLOB.createTemporary(con, true, CLOB.DURATION_SESSION);
Writer out = clob.getCharacterOutputStream();
out.write(myLongText);
// set the CLOB on the PreparedStatement and execute
ps.setClob(1, clob);
ps.executeUpdate();
Now, in the above two cases, if "myLongText" has any characters in it besides standard alpha-numerics, the latter approach will fail, although the former (original) approach will still work. In my case, I need to save Danish characters in the CLOB data. (I can't type these characters in this message, as for some reason they are being converted to "æ å ø" during posting, instead of the letters I've typed on my keyboard.)
Here is a stack trace when I try the createTemporary approach with a short String that contains one or more non-standard characters:
java.io.IOException: No more data to read from socket
at oracle.jdbc.dbaccess.DBError.SQLToIOException(DBError.java:716)
at oracle.jdbc.driver.OracleClobWriter.flushBuffer(OracleClobWriter.java:270)
at oracle.jdbc.driver.OracleClobWriter.close(OracleClobWriter.java:232)
Here's the strack trace when the insert String contains only ONE character that is non-standard:
java.sql.SQLException: No more data to read from socket
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1160)
at oracle.jdbc.ttc7.MAREngine.unmarshalUB1(MAREngine.java:963)
at oracle.jdbc.ttc7.MAREngine.unmarshalSB1(MAREngine.java:893)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:369)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:589)
Any help with this would be MUCH appreciated.
Thanks,
David Karltonhi David,
i tried inserting non-alphanumeric chars but still it goes thru fine.
here is what i did,
create table testlob ( id number(5),lobcol clob);
LobInJava.java
import java.sql.*;
import oracle.jdbc.*;
import oracle.sql.*;
class LobInJava
public static void main(String args[]) throws Exception
DriverManager.registerDriver(new
oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@host:1522:ora9idb", "scott", "tiger");
StringBuffer myLongText = new StringBuffer("nm{H$ñVmZ".length() * 10 );
for(int i=0 ;i < 1000 ;i++ )
myLongText.append("nm{H$ñVmZ");
System.out.println( myLongText.length());
PreparedStatement ps;
ps = conn.prepareStatement("INSERT INTO Testlob (id,lobcol) VALUES (2,empty_clob())");
ps.executeUpdate();
// then select the empty CLOB
conn.setAutoCommit(false);
ps = conn.prepareStatement("SELECT lobcol FROM Testlob where id=2 FOR UPDATE");
ResultSet rs = ps.executeQuery();
rs.next();
CLOB clob = ((OracleResultSet)rs).getCLOB(1);
// now write to the CLOB
java.io.Writer out = clob.getCharacterOutputStream();
out.write(myLongText.toString());
out.close();
// we're done
conn.commit();
ps.close();
// first, create statement to insert
PreparedStatement ps;
ps = conn.prepareStatement("INSERT INTO Testlob (id,lobcol) VALUES (1,?)");
// create a temporary CLOB and write to it
CLOB clob = CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION);
java.io.Writer out = clob.getCharacterOutputStream();
out.write(myLongText.toString());
out.close();
// set the CLOB on the PreparedStatement and execute
ps.setClob(1, clob);
ps.executeUpdate();
ps.close();
conn.close();
i am using jdk 1.3 and Oracle9i v9.0.1
Regards
Elango. -
I'm new to Oracle. I have installed Oracle SQL Developer 3.0.04 and Java 1.7. When I run Oracle SQL Developer, I will get the window Running this product is supported with minimum Java version of 1.6.0_04 and a maximum version less than 1.7. This product will not be supported....
Is there any known problem using Oracle SQL Developer 3.0.04 with Java 1.7?
I have already downloaded Java 1.6 but don't know whether I need to uninstall Java 1.7 first. If don't need to uninstall Java 1.7, how can I set Oracle SQL Developer to run with Java 1.6?
Thanks for any help.
Edited by: 881656 on Aug 25, 2011 11:22 AMHi,
One prior post discussing the use of Java 7 is:
SQL Developer 3.0 and Java SE 7?
There is no need to uninstall any Java version (except if you have disk space constraints) and no problem switching between Java versions. This may be controlled in the sqldeveloper.conf file in your ...\sqldeveloper\sqldeveloper\bin directory via the SetJavaHome line. For example:
#SetJavaHome ../../jdk
SetJavaHome C:/Program Files/Java/jdk1.6.0_26
#SetJavaHome C:/Program Files/Java/jdk1.7.0Regards,
Gary Graham
SQL Developer Team -
Problems with JDK and NetBeans
Hi, I've just started to learn java and I'm having some problems to compile projects. I installed JDK 1.5.0 (with NetBeans 4.0 beta 2), but when I try to compile any program (including the sample ones) I get the following error message:
C:\Documents and Settings\F�bio\JavaApplication2\nbproject\build-impl.xml:34: java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
Anyone knows what might be happening?
By the way, I've already tried to reinstall the whole package (removing everything first), but it didn't help. Also, before installing this version I was using JDK 1.4.2 just fine, but now none will work .
Thanks in advanceI'll try that!
By the way, I tried commenting out that line in the xml file and it worked! Still I have to do this to every new project I create, but it's a work-around =D
Thanks for your help -
Hi everyone, I'm developing an application that needs to calculate the angle between two vectors. While this is fairly simple, you just need to use the Math.atan2() function, i am having a few problems.
Here's a code snippet:
alpha = (Math.atan2((tx*ry)-(rx*ty), (tx*rx)+(ty*ry)) % (2*Math.PI)) ;Strangely enough, this gives me the following error: "The method atan2(double, double) is undefined for type Math"
This should only occur if the method atan2 weren't implemented in the Math library.. but from the javadoc and the GIS it definitively is!
I'm confused and stuck, any ideas? (i'm using jdk 1.6.0_07)This is a GWT application and therefore the rest of the code doesn't matters. I'll post it anyway, but if i take that simple line using the atan2, i can run the gwt application without problems nor errors. If i use the atan2 it doesn't presents any error in the IDE, but when i try to run the GWT application, it gives me exactly the error described previously:
" The method atan2(double, double) is undefined for the type Math"
Here's the code:
/* the mouse vector 1 */
tx = x - aux_obj.getCenterX();
ty = y - aux_obj.getCenterY();
/* the rotation vector. i.e. the fixed vector that will be used as origin composed by the subtraction of the object center with the rotation point */
rx = lastPosition[0] - aux_obj.getCenterX();
ry = lastPosition[1] - aux_obj.getCenterY();
lenght = Math.sqrt((tx*tx) + (ty*ty));
tx = tx / lenght;
ty = ty / lenght;
lenght = Math.sqrt((rx*rx) + (ry*ry));
rx = rx / lenght;
ry = ry / lenght;
alpha = (java.lang.Math.atan2((tx*ry)-(rx*ty), (tx*rx)+(ty*ry)) % (2*Math.PI)) ;
Window.alert("alpha:"+alpha);I think there's no big reason why this shouldn't work.. maybe it's the gwt library that doesn't finds the math class when it's trying to compile the java code.. -
URGENT!! ERROR WITH EXPIRED CERTIFICATE USING JDK 1.4.2.05
Hi,
I have created a client/server application with SSL and have found the following problem.
I have made these two tests:
1) jdk 1.4.2.03 --> the certificate is expired, I obtain this exception "No trusted certificate found". it's ok
2) jdk 1.4.2.06 --> the certificate is expired, no error occurs. WHY?????
Someone can help me?
GiannaThe problem is not the expired certificate! I know that it is expired, but I don't understand why using jdk 1.4.2.05 this certificate is not recognize invalid.
With this jdk the channel is created. Using jdk 1.4.2.03 instead the certificate was recognized expired and the channel is not created between client and server.
For me the correct behavior has with the old version of the JDK and not the new.
WHY????? -
Problems using Oracle Directory
Hi all
I have the following problem using 9i: I would like to use oracle internet directory to register my db's. I am currently reading the online handbooks and found a section that says to start the directory by using the 'oidmon' and 'oidctl' commands. The problem is that I cannot find these tools anywhere on the server, altough i am pretty sure i intalled anything important. is this a separate product? I thought it was included in 9i 9.2?
Anyone?
Cheers,
MichaelHi.
Hmm, your shared lib path appears to be ok. What version of Solaris are you running? Also what JDK version are you using (I'll assume you are using the one that installed with WLS)?
You might also try posting this to the weblogic.developer.interest.jdbc newsgroup.
Thanks,
Michael
Alex wrote:
Hi,
Please help. While trying to do a dbping, I get the following error:
[root@hkodsdb01 SMEloan]# java -Djava.library.path=/export/home/greenwood/bea/wlserver6.0/lib/solaris:/export/home/greenwood/bea/wlserver6.0/lib/solaris/oci817_8:/u01/oracle/product/817/lib utils.dbping ORACLE oracle smeloan 192.168.1.252
Starting Loading jDriver/Oracle .....
Error encountered:
java.sql.SQLException: System.loadLibrary threw java.lang.UnsatisfiedLinkError with the message '/export/home/greenwood/bea/wlserver6.0/lib/solaris/oci817_8/libweblogicoci37.so: ld.so.1: /greenwood/bea/jdk131/jre/bin/../bin/sparc/native_threads/java: fatal: libclntsh.so.8.0: open failed: No such file or directory'.
at weblogic.jdbcbase.oci.Driver.loadLibraryIfNeeded(Driver.java:202)
at weblogic.jdbcbase.oci.Driver.connect(Driver.java:57)
at java.sql.DriverManager.getConnection(DriverManager.java:517)
at java.sql.DriverManager.getConnection(DriverManager.java:146)
at utils.dbping.main(dbping.java:167)
The required file is under the Oracle directory specified. Also, I am having some problems with using the LD_LIBRARY_PATH for my shared library files. The command won't work with LD_LIBRARY_PATH and I must use the -Djava.library.path parameter. Any thoughts and suggestions?
Thanks so much for your help in advance.
Alex--
Michael Young
Developer Relations Engineer
BEA Support
Maybe you are looking for
-
MacBook Pro early2011, running slow and safari crashing
Hi - I am a newer MAC user, and not a technical pro, but have tried several things from the community suggestions to correct a problem with system slowness and safari crashing when trying to open. I am out of options that I comfortable with, and so
-
My Windows 2012 ISCSI Target service needs to be restarted every time the server starts.
Every time I restart my Windows 2012 server, the ISCSI Target Service is unavailable to the clients even though it appears to be running. I have to restart the service, then the clients can connect to it. I tried to change the startup Type to Delaye
-
Installed my HP LaserJet M127FW this past weekend. It won't print from my laptop. I tried with it both connected by USB and wireless. I can print from my iPhone (although slow). I can copy and fax. I can scan a document to my laptop. But I can'
-
Returned Defected iPhone but Verizon cannot locate it in the factory?
On January 14th 2013, my iPhone 5 top button stopped functioning. Received replacement two days later. I then packaged and returned old iPhone with the return label provided by Verizon on January 19th 2013. Tracking number states factory received the
-
The Adobe Flash Plugin keeps crashing in Firefox and I have the most up to date version. I have tried the dom.ipc.plugins.timeoutSecs to -1 but it still keeps crashing. == This happened == Every time Firefox opened == Since the plugin was installed