I ran in to this when installing Amazon Web Services SDK in Eclipse 3.6.

An error occurred while collecting items to be installed session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).

Unable to read repository at http://dy6h6xivkaprj.cloudfront.net/plugins/com.amazonaws.eclipse.sdk_1.1.1.v201012031352.jar.

Timeout while reading input stream. The following system properties can be used to adjust the readTimeout, retryAttempts, and closeTimeout

org.eclipse.ecf.provider.filetransfer.retrieve.readTimeout=<default:1000>

org.eclipse.ecf.provider.filetransfer.retrieve.retryAttempts=<default:30>

org.eclipse.ecf.provider.filetransfer.retrieve.closeTimeout=<default:1000>

Pretty good error message it tells you what to change 🙂

If you haven’t made changes to the eclipse system properties here’s how. Edit the Eclispe.ini and add the readTimeout and closeTimeout settings after -vmargs

-vmargs

-Dosgi.requiredJavaVersion=1.5

-Xms40m

-Xmx512m

-Dorg.eclipse.ecf.provider.filetransfer.retrieve.closeTimeout=3000

-Dorg.eclipse.ecf.provider.filetransfer.retrieve.readTimeout=3000

Restart Eclipse, attempt update. Problem solved!

If like me you’re eager to get the results of the Beta J2EE6 JSP/Servlet Developer Certified Professional Exam, the results were due end of Dec 2010,  just found out over at the JavaRanch, the results have delayed to mid/end Jan 2011.

Hope it’s worth the wait!

Update: results were announced yesterday, I passed!  I’m now a Oracle Certified Expert, Java Platform, Enterprise Edition 6 JavaServer Pages and Servlet Developer – it just rolls off the tongue. 😛

My farther in law’s laptop recently contracted the Virus Protector virus/scareware. Virus Protector is one of those fake security programs that uses scare messages to scam the unwary victims to buy their fake product. The scare messages are many, flooding the desktop every few seconds making it unusable. I used the great guide over at malwarehelp.org to remove it  -> http://www.malwarehelp.org/virus-protector-removal-2010.html

Recently had to move CVS repository to a new server, while I’m no CVS expert but in the land of the blind! Yadda, yadda, yadda… so down to me. A couple of googles later and with a sesnse of impending soom I did the following:

1. Stop the CVS service and Lock Service

2. Copy CVS Repo folder(s) to the new server

3. Install CVS on the new server – did full installation

4. Replicate the settings of the old server.

5. Add the folder as Repo location. I was able to add the repo location ok, but couldn’t connect 🙁 and when I tried adding a new folder to the repo I got the following error:

cvs init: connect to 127.0.0.1(127.0.0.1):2403 failed: No connection could be made because the target machine actively refused it. cvs [init aborted]: Couldn’t connect to lock server

So the server couldn’t connect to it’s own lockserver? Hmm… maybe the LockServer service wasn’t running or firewall interference? I checked both of these but all good. I thought let’s try stopping the lock server service, that worked! which is weird and the error seemed to say wasn’t running. Anywho I tried the telnet command again and got the CVSLock 2.0 Ready message so all seemed ok 🙂

TIP: When on the server, you can check the lock server using telnet try doing a “telnet localhost 2403” and see what you get.  It should respond with “CVSLock 2.0 Ready” if it’s working properly.

Note: I should say I was moving both new and old server were Windows 2003, the versions of CVSNT were the same and the new server had the same name as the old one.

my Hero

my Hero

Just a quickie blog post… my new HTC hero arrived today, yay!

Blown away by how within a few minutes of tapping in my google id I fully sync’d was contacts, calender, and email.

It’s my first touch screen and in portrait mode found the tapping a text message a little awkward. Landscape mode is fine.

Got it from Mobile Phones Direct – who supply the phones unlocked. They do some decent deals on 12m contract + free car kit. Plus in white which isn’t  avail on the network i’m on, Nice!

Log4j does seem to work out of the box with Websphere 6 so I cobbled together some tips and advice from the web and wrote this mini guide. It was a couple of years but hopefully be useful to someone.

WebSphere uses commons-logging and so it’s in the root classloader. In addition, WebSphere 6.0 ships a commons-logging.properties with the following properties set:

org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
Therefore by default the application will use JDK logging and not log4j. The solution is to ensure that the right classloader mode is set and the application has an appropriate commons-logging.properties and use the official released version 1.1 of commons-loggin api:

Set application classloader mode as PARENT_LAST. This can be changed in eclispes EAR file deployment descriptor menu. This tells websphere to load the parent files last giving the application files priority. (the parent being the websphere root)

Also, create a new commons-logging.properties to the application classpath with the following entries:

priority=1
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl
The priority flag was introduced in Commons Logging 1.1 to allow an ordering based on priority. To ensure that an application’s commons-logging.properties will take precedence over WebSphere’s file, a priority of greater that 0.0 must be set.  I changed mine to 5 (just to be sure 😉 ).

So basically the  commons-logging.properties overrides the one packaged in websphere and returns it to the default logging system which is log4j.

NOTE: You also have to replace the commons-logging-api.jar that comes supplied with websphere, because IBM use the API and which doesn’t contain the log4j logger implementation. 🙁

Replace

<Rational Instal DIR>\Rational\SDP\6.0\runtimes\base_v6\lib\commons-logging-api.jar
With the commons-logging-api.jar downloaded from http://jakarta.apache.org/site/downloads/downloads_commons-logging.cgi

You should also import include it in your go to project properties, java build path and import external jar. Ensure it’s imported above the websphere runtime library otherwise it’ll read the other one first. You can change the order of the imports in project prop > java build path > order and export.

LOG4J Config
To configure log4j you’ll need to create a log4j.propertuies file or a log4j.xml file. This can be located in the application classpath (same level as the ‘com’ directory). Ideally this should be located outside of the EAR/WAR file, where it can be easily editing whilst the application is running without the need to redeploy.

Note: When you build the project both log4j.properties and commons-logging.properties should be copied to the WebContent>Web-Inf>Classes

Checklist:

  • Created commons-logging.properties and log4j.properties in java classpath.
  • Change application classloader mode as PARENT_LAST
  • Import the commons-logging 1.1 jar file
  • Ensure imported jar in imported before Websphere runtime
  • Clean, Build and redeploy (also restart websphere)

More info:
http://wiki.apache.org/jakarta-commons/Logging/FrequentlyAskedQuestions
http://www.webagesolutions.com/knowledgebase/waskb/waskb004/index.html
http://www.mobilefish.com/developer/log4j/log4j_quickguide_examples.html


Book Review – Beginning Java EE 6 Platform with GlassFish 3: From Novice to Professional

Good for beginners.

This is a ideal book for someone starting Java Enterprise Edition (JEE), but also useful for those who want a brief overview of the ne features. It focuses on the changes in version 6 with examples in Glassfish. It also mentioned some of the significant changes in 5 and gives a good high level overview of the JEE platform in general. It also explains things like persistence layer, and ORM.

I’d recommend it to someone who’s new(ish) to java and whats to see what JEE/J2EE is all about. It’s not good as a reference book (but then it’s not pretending to be one.)

I’ve been a avid user of stackoverflow.com since I first heard of it a year or so ago. For the uninitialted it’s a place to ask development and programming related questions. The commuity is good and the idea of offering rep and badges to help others is great. Rep aint a new concept by any means but the way the stackoverflow team have implemented this simple idea is brill.

The new(ish) kid on the block is serverfault.com, which is aimed at sysadmins. A cool thing is you can link and import you profile from stackoverflow.

Also lats time I was on there i noticed the flair widget which allows you to embed your profile pic/rep/badge in any webpage.

hi, was playing around trying to get a rest API call to work and keep getting connection and timeout issues. Released as I am doing a HTTP request it needed to be routed via the company proxy server, here’s how I set the proxy details.

System.setProperty(“http.proxySet”, “true”);
System.setProperty(“http.proxyHost”, “130.x.x.x”);
System.setProperty(“http.proxyPort”, “80”);
System.setProperty(“http.proxyUser”, “UsernameHere”);
System.setProperty(“http.Password”, “PAsswordHere”);

Note: This was just a proof of concept to test out consuming a rest webservice, I’m not advocating this as the best way to set the proxy details.