jump to navigation

JBoss references March 29, 2008

Posted by lemonpress in dev environment installation.
add a comment

MySQL settings March 15, 2008

Posted by lemonpress in dev environment installation.
add a comment

mysql -u root -p

admin

Port: 3306

Data: C:\Data

Useful reference blog on how to make JSF, Tomcat and Eclipse work together March 3, 2008

Posted by lemonpress in 1, dev environment installation.
add a comment

Tomcat6 installation March 2, 2008

Posted by lemonpress in dev environment installation.
add a comment

Prerequisits

  1. Make sure you uninstall Tomcat if you have one installed already, otherwise Tomcat’s Windows Service Installer will fail with bizarre message about permissions
  2. Make sure you have JRE 5 and Java EnvVars all set in System>Advalced>Environment Variables (JAVA-HOME, Path in System EnvVars, optionally Path in User’s Vars and CLASSPATH)
  3. Just in case set a new EnvVar CATALINA-HOME=c:Tomcat6. This is my home dir for Tomcat, although WSI claims it will register CATALINA-HOME env-var automatically, last time it didn’t.
  4. you can optionally read Setup notes herehttp://tomcat.apache.org/tomcat-6.0-doc/, although the install with WSI should be trivial, if nothing goes wrong.
  5. You may want to restart PC, although it may be an overkill these days.
  6. Choosing Port for Tomcat is a bit of a guesswork: you can start all web services before doing Tomcat installation and run SysInternalsSuit tool tcpview.exe. On my PC I mistakenly uninstalled .NET framework and never got around to installing it back. So tcpview gives me frighteningly sounding windows error message, but never mind, it still runs and scans the ports. Make a list of all taken TCP ports. Optionally you can check which processes are running on these ports using procexp.exe from the same SysInternalsSuit. Make a list of ports and process IDs of interest in tcpview then go to procexp and check the names and descriptions against process numbers. Finally you can figure out which ports you can take, obviously the port num should be > 1024. Anything in 80XX range will be fine. Often servers require additional ports, some of which may be temporary and some grab free ports and make them permanent. To be dead sure that your chosen port and any additional ports the Tomcat may decide to grab will be available, start all your servers, i.e. JBoss, MySQL and so on. And then do the installation of Tomcat. If there is a conflict it will be discovered immediatelly, and it will also avoid potential future conflicts of ports.

Installation

  1. Download Windows Service Installer for Tomcat6 from here: http://tomcat.apache.org/download-60.cgi and save in C:Downloads
  2. you can also download zip‘ed Tomcat, but only for reference. Do not try to run bin/startup.bat or bin/tomcat6.exe in it. Firstly, because it is restricted to port 8080, and in my case, port 8080 is already taken by JBoss.
  3. Turn off Firewall – it is not essential, but it prevents Windows complaining about security when WSI tries to grab the port.
  4. Run WSI and choose your config settings. Mine are
    Home Dir: C:Tomcat6
    Port: 8086
    Check box: Run as Windows Service
    ( I will change it to manual startup later, but for now this setting will give you an immediate feedback if installation succeeded)
    login: admin admin

    Test it

    Start Browser and type: http://localhost:8086

    If you have any .war files try to deploy and access them.

    Finish Off

    Go to firewall settings and add port 8086 to exceptions, select scope: local network

    Turn on Firewall

    Go to Control Panel > Administrative Tools > Services and change Apache Tomcat6 service to Start “manual”.

    This is it.


Java from hell! March 2, 2008

Posted by lemonpress in dev environment installation.
add a comment

Well, the JSF deployment has corrupted Tomcat5.5.

So, I decided to to upgrade Tomcat to v6, rather then fixing v5.5, which would require a complete re-installation anyway.

Installing Tomcat5.5 with Wndows Installer was a piece of cake last time. I wanted to keep 5.5 and fix it later and install 6.0 on a different port. The excercise which was expected to be trivial, turned into a 2 hour going around in circles, untill I discovered the solution here:

http://www.mail-archive.com/dev@tomcat.apache.org/msg15640.html

%JBOSS_HOME%binrun -c default March 2, 2008

Posted by lemonpress in dev environment installation.
add a comment

will start JBoss from command line

To stop press CTRL+C and watch cmd for 5 minutes!

odd dependencies between tag handlers and POJOs February 29, 2008

Posted by lemonpress in 1 cat, java web dev.
add a comment

There are odd dependencies between tag handlers and POJOs (or Java Beans) that are used by tag handlers:

if the POJO/JavaBean already exists as a compiles .class file and we created a new tag handler that uses it

The tag handler won’t compile!

Solution:

  • delete dependent .class files in the file browser
  • deselect “build a”
  • recompile the project (in Eclipse choose Project -> Build Project)

And in the future make sure that
you turned off “Build Automatically”

Reference to command line java utilities February 29, 2008

Posted by lemonpress in 1 cat, dev environment installation.
add a comment

see http://neptune.netcomp.monash.edu.au/JavaHelp/howto/jar.htm

create compressed library archive (JAR)

jar   cf   archive_name.jar   list-of-files

jar   cf   example.jar   One.java   Two.java   Three.java

jar   cf   example.jar   *.java

jar   cf   example.jar    *

create java executable

javac  * java     compile all Java source files in the current dir

javac   One.java  Two.java  Three.java

create an executable JAR

  • create a text file that lists the “main” class e.g. mainClass.txt Main-Class: Three
  • jar  cmf   mainClass.txt   example.jar   *.class

c -    with modifications to the manifest file
m-   name jar after main class as specified within mainClass.txt
f -    including everything that matches the pattern *class

run executable JAR from command line

java   -jar   example.jar

Options

(more…)

using libraries in your project February 29, 2008

Posted by lemonpress in 1 cat, java web dev.
add a comment

xxx.jar – a library of useful classes packaged in a single archive file.

using libraries in your project is dead-easy.

  1. create classes, e.g. a collection of custom tag handlers
  2. zip them up using jar cf mytags.jar *
    or jar cf mytags.jar list-of-files.class
  3. copy mytags.jar into lib/ dir of another project (see More)
  4. use them

(more…)

Tomcat Manager February 18, 2008

Posted by lemonpress in dev environment installation.
1 comment so far

BTW: my credentials for Tomcat Manager are – admin admin