Jiri Nejedly

Ranch Hand
+ Follow
since Oct 22, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Jiri Nejedly

Thanks for the sources tip, now I have a better debug means.
Reagarding

setting , I tried it , but it seemed to me, that it had no effect on error '20', so I omitted it in my code, to have it as simple as possible.

Sadly I had a new problem, I no longer reach USERAUTH fail (20) error
Now before that I get

I seems to me, that the server setting must have been somewhat changed and communication exachange didn't end well.
I googled , tried to add various config.put("kex", ...); parametres, with no success.
Is it the key after "SHA256:", that I must put somewhere ?
BTW: My client is on Windows, if it matters.


I use Jsch ver 0.1.72 a here's a simple stack
3 weeks ago
Hi. I am trying to connect to SFTP server via this simple code, using  Jsch library (tried both 0.1.55 and 0.1.72 versions )


I tried to manipulate config with some key exchange algorithm settings, but I am pretty sure, that both client and server agreed on agorithm (I left the config in in the code);
Whatever I do,  I'll end up with USERAUTH fail (20) error on session.connect();  line. Google didn't found anything about this mystery  ''20" error.
The WinSCP connection with the same credentials work ok.
Please help, Thanks.
3 weeks ago
Fimally found a solution - we googled that it is Oracle database bug. Patch 27002286 must be applied.
3 months ago
Cannot read Clob as Blob
causes "Ivalid column type: getBLOB not implemented for class oracle.jdbc.driver.T4CClobAccessor"
3 months ago
This is another development of this case:

- We discovered a new customer with this problem, now we have 2
- We tried two versions of SQL Developer, found out, that it is distributed as a directory containing
JDBC drivers add complete java JRE & JDK

& newest

Both versions have the same behaviour (not correct)
PS.: with my java experiments, I used Java 8 and ojdbc8.jar, no change

I tried to extract clob as binary:

Result is this


Correct results obtained from non-problematic databases should be

, but non utf-8 reading is not correct too - see the 0D char at the beginning and at the end

I think that all this narrowed down the problem to database only. We intend to make Technical Service Request at Oracle's support.

We are also thinking of some workaround like dbms_lob package.

Ragards, Jiri



3 months ago
It is not the font, I'm sure. See proof below. Here in Czech rep. we always install windows with Czech language support which is cp1250. Therefore we install database to our customers as EE8MSWIN1250. Our appliacation doesn't need any foreign non-czech characters, so there's no need for utf8. I know, that Java use UTF8 internally, but it doesn't matter what DB encoding is, JDBC should extract the data regardlees of DB encoding. It is time to show how I read the Clob in java:


And this is the proof, that font is ok. I added a varchar2 column to test table and put in it the same string with diacritics, it is read ok, wereas clob not. I repeat - SQL Developer is Oracle's product and connects to DB via JDBC



4 months ago
Thanks, maybe I have explanation for all this. Six years ago I changed my email from @volny.cz to @seznam.cz, but probably forgot to confirm it via the link sent. Then it was possible to login by username , which I did all the time (the browser session was remembered, so I didn't need to login at all). Until recently, you changed login to only by email - and because I still had the old email, I couldn't login. My mistake, I apologize.
4 months ago
Hi. Returned here after a few months and I am utterly confused, I see Sign up and login as one operation. So be it. But I type my login email and instead of login I am allowed only to sign up anew. Surely I cannot sign up with my previous mail, so I had to use a new one. I meant  changing my first and last name too.  Confusing, cannot see my previous posts. What can be wrong? Thanks
4 months ago
I could paste there the java code with reading and writing from/to clob. But Oracle's SQL Developer has the same issue. App with ODBC connection not. Therefore I think that the read operation between database and  JDBC is the problem. I prepared a simple picture describing the problem. The table reproducing this is simple:
CREATE TABLE TESTC   (CLB CLOB);
. and every database we use has the same encoding: NLS_CHARACTERSET - EE8MSWIN1250

4 months ago
Hello,
I have this problem:

- I have oracle DB (12c, Release 12.2.0.1.0 - 64bit)
- I have table with Clob column
- There's problem reading data from this Clob column via JDBC. If the data contains characters with diacritics, the chars are read wrong (cannot get ascii code,
I see only rectangle as a char or question mark). Tried other tables, Clob  is the problem, not particular table.
- Problem is only in read operation, data is written correctly, I've proven it by reading them via ODBC - diacritics ok there.
- We encountered this problem first in Oracle's SQL Developer, which is based on jdbc too and repeated it by a small piece of code written in Java (SQL insert & select)
- The problem is Clob only (other tables' varchar2 columns with diacritics are read ok) and on that particular database only. We tried other 12c databases without problems.
- Java version is 1.8.0_271, jdbc driver is latest ojdbc8.jar

I'm stuck. It seems to me, that the DB must problem,  But I don't know where to go.  Thanks
4 months ago
Hello.
I put some html formatted text to JEditorPane. Something like this



Then I want on mouse click to modify the html formating, It means to modify the html text going to JEditorPane.
I need to get the text position the mouse is pointing to and retrive the line under that point
something like this

 

However this code retrieves only pure text without any previous html formatting.
It would be difficult to parse the text with formatting lost.
Can I somewhat get the full html content previously put to JEditorPane using the viewToModel method ?

Thanks

9 months ago
Hello. We have an J2EE application installed on Tomcat (many instances both on Linux and Windows) . On one particular Linux installation have this specific problem:
That Tomcat application writes files to some Linux storage (directory). Then exist some other Web application (written in php) which via Apache server (on the same Linux) can download those files.
But on this particulart Linux, this php app gets the message, that it has not the read privileges for those files.  As we see, those files  have R & X privileges for owner, R for group and none for others .
Strange, other apps on other Linuxes are ok. Can we somehow manage the user which runs the tomcat ? Could it be the way ? Thanks.
11 months ago
Hi,

we have a J2EE application using spring/hibernate. We also use Quartz scheduler.
We have these dependencies in pom.xml
quartz 2.3.0 and quartz-oracle 2.1.7
We have many istallations deployed on Tomcat 8 both on Windows and Linux.
Now we encountered problem on one Linux. Something with Quartz.

this i get by using StdScheduler (getJobGroupNames(), getJobKeys(...)


and this trying to write cron settings via quartz api


I think there's some communication problem between quartz library and its tables such as QRTZ_JOB_DETAILS and QRTZ_TRIGGERS. Both reading and writing.
The problem with  StdScheduler (getJobGroupNames(), getJobKeys(...)) I overcame by direct access via hibernate using plain sql.
It worked, but writng cron settings via quartz api led to above error. I am at the end, I cannot rewrite whole quartz api logic.

My environment settings
The server is Debian GNU/Linux 12 (bookworm)
Apache Tomcat/8.0.14
JDBC lib is ojdbc8.jar (in Tomcat's lib folder]
Oracle Database 12c Release 12.1.0.1.0 - 64bit Production

Any ideas what can be wrong ? Thanks.
1 year ago
Hi. We are developeing some java utility using a few  government provided web services (few simple https urls returning some json data). Everything works ok, but one customer uses proxy server. We would like to give him tested and working solution not any trials and errors.

But we don't use proxy server, so we tried to find some solution how to simulate it. We googled utility Fiddler (https://www.telerik.com/fiddler) with this recommended setting
(https://superuser.com/questions/180480/how-to-simulate-corporate-proxy-server-on-my-development-machine)
1. Download and run Fiddler proxy (it's free). It will automatically set itself as a system proxy in Windows on each run. Also click Rules -> Require Proxy Authentication in the top menu if you want to test authentication to the proxy (username and password are "1").
2. Open Windows Firewall, then Advanced settings -> Windows Firewall Properties. Block all outbound connections for all profiles you need (domain, private, public) and click OK.
3. Add new outbound firewall rule to allow all access for 8888 port (default Fiddler port) or "%LOCALAPPDATA%\Programs\Fiddler\Fiddler.exe" app.

We did everything listed, tried first chrome. It itself turned the proxy setting on, the address set to http=127.0.0.1:8888;https=127.0.0.1:8888

But connection ends with ERR_TUNNEL_CONNECTION_FAILED

We're not 100% sure how to setup the rule in point 3) Maybe is the problem here and not in Fiddler ?
We set this:

Protocol type TCP
Local port all
Remote port 8888

this gives ERR_TUNNEL_CONNECTION_FAILED

If we set only local, only remote or both 8888 , it still gives ERR_TUNNEL_CONNECTION_FAILED

I know this is not 100% java question, but we get to java right after solving this.

Maybe there's other utiliy emulating proxy.

Any suggestions? Thanks.
1 year ago