SCJP Book


Kathy Sierra is a real super author. The SCJP 5 book, is a very interesting book for people who want to know about everything (almost) about the java language, every little detail is mentioned here. I think it's a must read book for java programmers.

The book is also a very good preparation for the SCJP exam. Here's a link for the book in goodreads :
SCJP Sun Certified Programmer for Java 5 Study Guide (Exam 310-055) (Certification Press Study Guides)

Also, for people who wants to read it on computer, here's a link and don't forget to follow the blog :)

Oracle 10g + JBoss AS 4.2 = A fight for the 8080 http port!


If you are running your JEE application on these servers, you surely will face this problem; either the oracle 10g server or the JBoss 4.2 won't work because they both are using the same port (8080).


Solution is evident : change the http port of one of them, so here I'll explain both methodes, so you can chose what's more appropriate. I chosed to change the Oracle one because am running JBoss on eclipse and I don't want to mess up the IDE config.

Oracle 10g XE
This should be done using sql plus commands, I have no idea how to call the sqlplus command line on Linux distributions (although I should do), but I think it's as simple as in Windows environment :
0 - Make sure your Oracle 10g server is running (OracleServiceXE and OracleXETNSListener are at least running, and you can ensure it by taking a look at Services in Control Panel)
1 - Start
2 - Run
3 - type : sqlplus /nolog
3' - you should receive : 


SQL*Plus: Release 10.2.0.1.0 - Production on Tue Aug 26 10:40:44 2008
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

on your console window.

4 - type : connect
4' - you'll get : Enter user-name: 

5- type : system
6 - you'll be asked for the password, type it, it won't be visible so pay attention while typing.
6' - if your server is not running you'll get a Protocol error, if you have typed a bad password, it will show you a convenient error message, otherwise, you'll get a "Connected." message.

7 - Once connected, you can throw it the change port command. Assuming the port number is PORT_NUMBER, this is what you should enter : 
Exec DBMS_XDB.SETHTTPPORT( PORT_NUMBER );
7' - you'll get : PL/SQL procedure successfully completed.

8 - Enter "quit" and go smell your java application.


JBoss 4.2 AS


This one is easier to change, just go to your JBoss directory, and find this file :
<JBoss_directory>\server\default\deploy\jboss-web.deployer\server.xml

Open it, your eyes will just focus on this part of code automatically : 

<Connector port="8080" address="${jboss.bind.address}"  

         maxThreads="250" maxHttpHeaderSize="8192"
         emptySessionPath="true" protocol="HTTP/1.1"
         enableLookups="false" redirectPort="8443" acceptCount="100"
         connectionTimeout="2000" disableUploadTimeout="true" />
You know what should be done then. Just don't forget to restart your server.
If you are still facing an error like this one : 
ERROR [Naming] Could not start on port 1099 java.net.BindException: Address already in use: JVM_Bind
then you should also change the port used for JNDI, (It seems that Oracle use the same port too). The configuration file is this one : 


<JBoss_directory>\server\default\conf\JBoss-Service.xml


just change the value here : 



<!-- The listening port for the bootstrap JNP service. Set this to -1
         to run the NamingService without the JNP invoker listening port. -->
<attribute name="Port">1099</attribute>
and that's it.




Eclipse
Last episode is here, in eclipse JBoss server pluggin. For mysterious reasons, your server still doesn't want to work, (even it's doing quiet well outside eclipse). So maybe you should check the xml configuration files through the plugin (I think it's all about cache). I have nothing to comment, just look at the pic and you'll get all what you have to do.


Change JNDI port value from Eclipse JBoss Fast View

Now, I think game is over!