Butter Dev Logo
Search:   

December 30, 2010

CompTIA Security+

I passed the CompTIA Security+ test today. I have never been big on certifications but it is a requirement to work on a client’s servers.

I studied about 15 hours and exclusively used “CompTIA Security+: Get Certified Get Ahead: SY0-201 Study Guide“. My employer already had a Security+ preparation book (I won’t name it) and after skimming the first few chapters I was not impressed. I had them order “CompTIA Security+: Get Certified Get Ahead: SY0-201 Study Guide” and I am glad I did.

Initially I read/skimmed through the book in about 7-8 hours. For a certification book it is extremely concise and is actually interesting at times! Certainly the most readable certification book I have ever seen. Next I took all of the end of chapter quizzes and sample tests and made a study sheet consisting of all of the end of chapter review information as well as notes I took from questions I missed (another 7-8 hours). My final score was an 848 out of 900 (750 is passing).

My impressions of the test were – well – it is silly. I am certain you could pass the test and not really know much. It just doesn’t make much sense to me why employers/agencies require these silly certifications. Several of the questions were worded extremely poorly, and most of the questions tested memorization – not actual knowledge. Oh well. I actually did learn a few things from the book (which of course were not tested) and I am glad it is over!

November 30, 2010

Microsoft squashes Spoon’s IE Virtualization

One of the difficulties of developing web applications is testing code in various browsers and versions of those browsers. For many browsers this is not too bad as you can have multiple versions installed on one machine. Microsoft has been the exception here as Internet Explorer is integrated into the OS – which means you can only have one version of IE running on a given machine.

For years the solution was to run VM’s for each version of IE you were required to test (yeah right Microsoft). I have also used IETester but my favorite solution has been Spoon. Until recently Spoon’s virtualization software allowed users to run most versions of IE through the web – that is until Microsoft requested that Spoon remove IE from their service a few months ago.

As if developers needed more reason to dislike Internet Explorer – Microsoft has made a move that will increase the hatred for IE dramatically. And they wonder why they are losing market share? Not only have they provided us a browser in which only one version can be tested on a given machine – they have taken away one of the only tools that has helped us test!

There appear to be some legitimate concerns that Microsoft has in allowing IE virtualization (security, etc.), but there has to be a way to work out a solution for everyone. Please Microsoft – bring back Spoon IE virtualization.

October 21, 2010

Configuration problem: Id is required for element ‘annotation-config’ when used as a top-level tag

We have been seeing this issue in DWR/Spring integrations. It looks like the Spring guys changed (changed since Spring 3.x?) their schema and now require an id attribute on top-level annotation-config elements. DWR uses a Spring class to parse the XML and it throws the following error:

“Configuration problem: Id is required for element ‘annotation-config’ when used as a top-level tag”

It appears for now adding an id attribute resolves the issue. I will continue to look into this.

DWR, Spring and Annotations

This post applies to DWR 3.x and Spring 3.x. Configuring DWR to work with annotations and Spring isn’t difficult, but there are a lot of moving parts and many users struggle with it. There are a few elements that DWR has available and understanding them is key (these elements can be viewed in the DWR Spring schema – http://directwebremoting.org/schema/spring-dwr-3.0.xsd):

annotation-scan – This element enables DWR to scan the classpath, detect beans annotated with @RemoteProxy, @RemoteMethod, @DataTransferObject and register the beans (@DataTransferObject) and Creator proxies (@RemoteProxy & @RemoteMethod) for them.

annotation-config – This element enables DWR to scan the Spring context, detect beans annotated with @RemoteProxy and @RemoteMethod and registers Creator proxies for them. Note this element will only search the Spring context and will only create the Creator proxies. You will need to manually register converters for the types the proxy methods will return or accepts as parameters.

For now I have completed two sample applications that you can use to get started. I don’t have time to discuss the code right now but it is pretty straightforward.

July 31, 2010

Rose Hosting Sucks? I don’t think so.

I have been using Rose Hosting for a bit over two years now. I have a VPS plan which I use to host several websites, email for all of those sites, and playing around space (I have Jetty installed and occasionally push Java web-apps out).  As of recently my server had been up for over 400 days in a row and has performed up to my expectations.

I tend to look around yearly to see if I am still getting the best deal.  This year my research led me to the following blog post.  I understand how frustrating the author must have been but these articles prompted me to write this post in defense of Rose Hosting for two reasons:

  1. The comments are closed on the post which seems a bit unfair to me. People who are actually satisfied with Rose Hosting have no opportunity to voice their opinion.
  2. The posts are old.

Do I think Rose Hosting is the best host out there?  Maybe, maybe not.  But I shop around and I haven’t found anyone that compares. Check their specials  and if you find a better deal let me know – Rose Hosting specials.

If I had to think of a complaint it would be that one time it has took their tech support a few hours to respond to an issue (hours people not days!).  This is not a major deal for me as it is very rare for me to have to submit a support ticket. See my update below:

So for now I am sticking with Rose Hosting, all of my research leads me to one conclusion – they are still the best out there for the price.

UPDATE:

Rose Hosting support came through for me big time today. I made a stupid mistake and completely hosed my VPS. They had the full system restored within 30 minutes of my ticket being opened. I think that is some excellent support.

January 17, 2010

DWR 3.x and Jetty Continuations on Jetty 6.x

For Jetty 7 a lot of re-factoring has been done on the Continuations API. I recently took a look at the changes and modified DWR’s code to reflect the latest API. If you are using the latest version of DWR 3.x (currently unreleased) and you are still using a Jetty version < 7.x you will need to follow these directions to get Continuations working.

First you will need to download the Jetty continuation 7 jar and place it in WEB-INF/lib. You can read more about why this works here.

Next you will need to add the JettyContinuationFilter to your web.xml:

<filter>
    <filter-name>JettyContinuationFilter</filter-name>
    <filter-class>org.eclipse.jetty.continuation.ContinuationFilter</filter-class>
</filter>
<filter-mapping>
    <filter-name>JettyContinuationFilter</filter-name>
    <url-pattern>/dwr/*</url-pattern>
</filter-mapping>

You should now be up and running.

December 6, 2009

DWR 3.x and Spring

If you want to integrate DWR 3.x with Spring you can follow my previous posts (note – I have included a working sample application and updated source at the bottom of this page):

  1. I am using DWR 2.0.x, Spring 2.x, and Spring MVC
  2. I am using DWR 2.0.x, Spring 2.x, but I am not using Spring MVC

However, you will need to make the following changes.

Spring 2.5 or greater is Required

You must upgrade to Spring 2.5 or higher (I am using Spring 3.0.4).

Update you Spring Application Context

Update your Spring Application Context:

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-.0.xsd


http://www.springframework.org/schema/aop


http://www.springframework.org/schema/aop/spring-aop-3.0.xsd


http://www.directwebremoting.org/schema/spring-dwr

    http://www.directwebremoting.org/schema/spring-dwr-3.0.xsd">

I have added two working examples (~10 mb in size), both of these zip files contain all source as well as a working web-app that you can drop into your container:

October 1, 2009

Setup cannot continue because a more recent version of Internet Explorer …

“Setup cannot continue because a more recent version of Internet Explorer has been detected on this computer.”

Recently while performing a Windows Update my Vista box locked up.  The update ( for Internet Explorer 8 ) hadn’t quite completed and when I restarted, IE 8 was installed and running fine but my Windows Update didn’t think so.

My first thought was to remove IE 8, surely a re-install would solve the problem.  I followed the advice on Microsoft’s support site ( http://support.microsoft.com/kb/957700 ) for removing IE and neither the standard or alternative instructions worked for me.

After days without a resolution I finally figured out how to re-install IE 8 ( of course, you will only need to perform this hack if the Microsoft’s recommendations don’t work for you ).  Here is how to do it:

  1. Download IE 8.
  2. Run the installer and wait for the “Setup cannot continue because a more recent version of Internet Explorer has been detected on this computer.” prompt to appear.  DO NOT CLOSE THE PROMPT – if you close the prompt this will not work as the temporary directory mentioned in the next step will be removed.
  3. The installer is extracted to one of your drives ( in my case it was not my C drive, so make sure you look at all of your available drives ) in a directory named with a random key ( in my case the key was 5c5c0d193eca399daddb3768b3 ).  Find the directory, open it, and run ie8.msu.  This will allow the installer to run and you will be up and running.

Testing web interfaces in multiple versions of IE

Any developer that has worked on web interfaces knows the pains involved in dealing with different browsers and browser versions.  Microsoft  has notoriously made this difficult by not permitting more than one version of IE to run on a machine.  The solution – install a VM for each version of IE you want to run.  Does that sound crazy to you?  It does to me.

I recommend using one of the following tools to accomplish the same thing:

  1. http://spoon.net/browsers/ – My first recommendation.
  2. http://www.my-debugbar.com/wiki/IETester/HomePage – Seems to work pretty well.

I have to test things on different browser versions regularly due to my work on DWR and both of these tools have been a tremendous help.

December 24, 2008

DWR and Hibernate 3.x

Recently there have been some questions on DWR’s user mailing list about integration with Hibernate.  Most of the questions stem from a misunderstanding of how DWR works and I thought it would be helpful to write a post to give new users some information on what to expect from DWR.

DWR provides two main integration points with Hibernate:

  1. A converter (hibernate3) that attempts to avoid reading from un-initialized (lazy) properties.
  2. A filter (H3SessionAjaxFilter) which provides a Hibernate Session to the hibernate3 converter if un-initialized properties need to be read.

What converter should I use and how do I configure it?

You should use the hibernate3 converter if:

  1. The returned object has lazy properties which have not been excluded in your DWR configuration and you do not want DWR to attempt to serialize these properties.
    1. Add a converter to your dwr.xml:
      <allow> 
        .... 
        <convert converter="hibernate3" match="yourpackage.yourClass" />
        ....
      </allow>
      
  2. The returned object has lazy properties and you want DWR to attempt to serialize these properties. 
    1. Add a converter to your dwr.xml with the assumeSession parameter set to true.  This will tell DWR it should attempt to access the Hibernate session to read un-initialized properties:
      <allow> 
        .... 
        <convert converter="hibernate3" match="yourpackage.yourClass">
          <param name="assumeSession" value="true"/>
        </convert>
        ....
      </allow>
      
    2. Add the H3SessionAjaxFilter filter to your dwr.xml, this filter provides the Hibernate session needed by the hibernate3 converter to read the un-initialized properties.
      <allow> 
        .... 
        <filter class=" org.directwebremoting.hibernate.H3SessionAjaxFilter"/>
        ....
      </allow>
      

You should use the standard bean converter if:

  1. The returned object does not have lazy properties and you want DWR to blindly serialize all properties on the object (or properties based on the exclusions, inclusions set in your DWR configuration).

Where the confusion lies:

So what was the problem that the users on the list were having?  Both users thought it was possible for DWR to make a call to the server to retrieve a lazy property when an attempt was made to access that property in JavaScript.  Here is a code sample to illustrate this point:

  function dwrCallBack(beanFromServer) {
    alert(beanFromServer.lazyProperty);
  }

DWR does a lot of magical things but it DOES NOT access the server when reading JavaScript properties.  All serialization of the object DWR will return to the browser is performed one-time – in the converter.  The converters job is to serialize the bean into a complete JavaScript object. 

In short the conversion of Hibernate beans is an all or nothing process.  The developer needs to understand what properties he needs to display in the view and prepare his converter configuration with this in mind.  Please note that the hibernate converter is very similar to the bean converter and thus you may specify include and exclude parameters (to exclude or include properties in serialization).  For more information on the bean and hibernate converters please see the DWR docs:

  1. http://directwebremoting.org/dwr/server/hibernate
  2. http://directwebremoting.org/dwr/server/dwrxml/converters/bean

If you have any questions feel free to post them in the comments area. 

Newer Posts »
Performance Optimization WordPress Plugins by W3 EDGE