Specifying Tomcat ports in IntelliJ IDEA to use multiple tomcat servers

Source from: http://www.altuure.com/2008/11/12/tomcat-port-configuration/

Edit the server.xml:

<Server port="${tomcat.init.port}1" shutdown="SHUTDOWN">

<Service name="Catalina">
<Connector port="${tomcat.init.port}2" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="${tomcat.init.port}3"/>
<Connector port="${tomcat.init.port}3" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"/>
<Connector port="${tomcat.init.port}4" protocol="AJP/1.3" redirectPort="${tomcat.init.port}3"/>

</Service>
</Server>

Run it like this:

CATALINA_OPTS=-Dtomcat.init.port=908
 ./startup.sh

so you will have

SHUTDOWN:9081
 HTTP:9082
 HTTPS:9083
 AJP:9084
Advertisements

my dev batch file

C:\DevTools\cmd.bat

@echo off
@set CATALINA_HOME=C:\servers\apache-tomcat-5.5.27
@set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_16
@set M2_HOME=C:\DevTools\java\apache-maven-2.2.1
@set MAVEN_OPTS=-Xmx1024m -XX:MaxPermSize=512m
@set TOMCAT_HOME=%CATALINA_HOME%
@set VIM=C:\DevTools\vim
@set COMSPEC=%SystemRoot%\system32\cmd.exe
@set HOME=C:\Documents and Settings\SG0208743
@set RUBY_HOME=C:\DevTools\ruby-1.8.7

@rem =======================
@rem local path
@rem =======================
@set

PATH=C:\DevTools\gnuwin32\bin;C:\DevTools\MinGW\bin;%RUBY_HOME%\bin;%M2_HOME%\bin;%JAVA_HOME%\bin;C:\DevTools\Sysint

ernalsSuite;C:\DevTools\vim;C:\DevTools\eText\cmd;C:\DevTools\cygwin\usr\local\narwhal\bin;

@rem =======================
@rem git
@rem =======================
@set git_install_root=C:\DevTools\git-1.7.1
@set PLINK_PROTOCOL=ssh
@setlocal
@set path=%PATH%;%git_install_root%\bin;%git_install_root%\mingw\bin;%git_install_root%\cmd;
@if “%HOME%”==”” @set HOME=%USERPROFILE%
@cd %HOME%

@rem =======================
@rem global path
@rem =======================
@set PATH=%PATH%;C:\DevTools\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Program Files\CollabNet\Subversion

Client;C:\DevTools\MySQL\MySQL Server 5.0\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;

@rem =======================
@rem start command process
@rem =======================
@start C:\DevTools\cygwin\bin\mintty.exe %COMSPEC%

A hack for mintty to use as Windows command console cmd

If you’re like me, vain in changing the Windows command console (cmd.exe) and if you like the functionality and look and feel of mintty (cygwin), here’s how to change the look and feel of cmd.exe:

  1. Install Cygwin with Shells -> Mintty included.
  2. start <cygwin directory>/bin/mintty %COMSPEC%

Start is a windows command for spawning new applications.

<cygwin directory>/bin/mintty is the application you want to start.

%COMSPEC% is the parameter for mintty.  Windows will substitue this to cmd.exe.  Well you can call it directly using “start <cygwin directory>/bin/mintty cmd.exe”

Example screehshot:

Hope this helps

serialVersionUIDs for IntelliJ IDEA 9

While I was wondering why IDEA did not seem to have a generator for UIDs, I browsed the plugins and found serialver.  I find it stupid enough to use and then I research more from the Code inspections.

Steps for enabling IDEA to generate serialVersionUIDs:

  1. Click the Code Inspection icon from the lower right portion of IDEA.  The one displayed like detective.
  2. Click the Configure inspections link to see the Inspections dialog box.
  3. Find the Inspections -> Serialization issues -> Serializable class without ‘serialVersionUID’.
  4. Check it to enable it.
  5. Click OK to close the Inspections dialog box.

When editing a Serializable class without a serialVersionUID, it will display a warning and a Quickfix balloon to generate it.

Disable Windows Autoplay feature to stop viruses from spreading

Normally the autoplay feature of Windows can help spread unwanted viruses from one drive (e.g. USB) to another system.

Here’s how to disable the autoplay feature:

  1. Go to the Start –> Run
  2. Type in gpedit.msc (group policy editor for windows)
  3. Go to the Computer Configuration –> Administrative Templates –> System
  4. Find the “Turn off Autoplay”
  5. Double click it and click the “Enable”
  6. Select “All-drives” instead of “CD-ROM drives”
  7. Click okay and youre good to go.

Configure Pidgin for GoogleTalk in Proxy

Here’s how to configure GoogleTalk in Pidgin under a proxy server:

  1. Open Pidgin and go to Add / Edit Account window of Pidgin.
  2. From the drop-down box choose XMPP as the Protocol.
  3. For the Screen name enter your Google Id (Gmail Id without the @gmail.com). 
  4. For Server enter gmail.com

  • You can leave the Resource with the default “Home“.
  • In the Password field enter your Google ID password.
  • Enter Local alias as whatever you want to.
  1. In the Advanced tab, check Require SSL/TLS
  2. Force old SSL unchecked, and Allow plaintext auth unchecked
  3. Connect port: 5222
  4. File transfer proxies: proxy.jabber.org
  5. Select the desired proxy protocol. e.g. HTTP
  6. Enter the proxy domain host. e.g. proxy.accenture.com
  7. Enter the proxy port. e.g. 80 or 8080
  8. If your proxy requires an authentication, enter proxy username and password.

Troubleshooting errors reported:

  • HTTP proxy connection error 407
    • Means the proxy requires an authentication.  Just enter your proxy username and password.
  • HTTP proxy connection error 504
    • Means there’s a connection timeout.
    • Alternatively use this settings:
    • Require SSL/TLS: Unchecked
      Force old (port 5223) SSL: Checked
      Allow plaintext auth over unencrypted streams: Un-Checked
      Connect Port: 443
      Connect Server: talk.google.com
      Proxy type: Use Global Proxy Settings

Hope this helps!

Optimal IntelliJ IDEA vmoptions settings

Set the <idea installation dir>\bin\idea.exe.vmoptions to:

-Xms256m
-Xmx1024m
-XX:MaxPermSize=512m
-ea
-server

Just in case you cant get it to work because an error is displaying everytime you start IDEA.  “JVM not started…”

Use the idea.bat to start it.

edit the batch file in this line:

IF “%IDEA_JDK%” == “” SET IDEA_JDK=%JAVA_HOME%

This points to the correct JAVA_HOME installation dir.

 

If you have D: drive, edit also caching in the idea.properties

idea.system.path=D:/Temp/idea8/system

 

Hope this helps