2016年12月25日日曜日

Java : java.lang.InternalError: name is too long to represent

I faced the exception that I couldn't solve.

java.lang.InternalError: name is too long to represent

I serched this exception, but I knew that I couldn't solve it. I found a note and read it.

This is a bug in the Sun/Oracle JVM

If the size of JSP file is over 65KM, you can enclose this exception. You can't salve, but you can avoid it. This exception will ocuur, when you use debug mode. So you stop to use debug mode, you don't face this exception.

2016年12月6日火曜日

Oracle : SQL : ORA-02260

I encountered an "ORA-02260".

ORA-02260 : 
table can have only one primary key.

How can I solve this problem? I can't add the primary key.
If a table already has a primary key, you can't add primary key. So you have to remove and re-create your primary key.

First, you remove your primary key to execute the query.
ALTER TABLE [Table Name] 
  DROP CONSTRAINT [Primary Key Name]

Second, you re-create your primary key.
ALTER TABLE [Table Name] 
  ADD CONSTRAINT [Primary Key Name] 
  PRIMARY KEY [COLUMN NAMES]

If you want to use multiple columns as primary key, you should separate with comma.
ALTER TABLE [Table Name] 
  ADD CONSTRAINT [Primary Key Name] 
  PRIMARY KEY (col1, col2, col3)

2016年12月2日金曜日

Tomcat : Create self-signed SSL certificates for Tomcat

First, you generate the "keystore".

%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg

Type this command your command line and press return.
You will be questioned something. Almost all of questions, you don't have to answer. Leave empty. But you should beware this question, "What is your first and last name?". This is the domain name, not your name.

Second, you configure your Tomcat.
Activate the "HTTPS-Connector" in your "[Tomcat installation directory path]/conf/server.xml" and adjust "keystoreFile" and "keystorePass". 

<Connector port="8443" protocol="HTTP/1.1"
           maxThreads="150" SSLEnabled="true"
           scheme="https" secure="true"
           clientAuth="false"
           sslProtocol="TLS"
           keystoreFile="[keystore_dir]\.keystore"
           keystorePass="[key_password]" />


Restart Tomcat and you go to "https://localhost:8443". You can find your SSL self-certificates site.