vrijdag 21 oktober 2011

Websphere failure

We had a problem with a SOAP on WebSphere. We had the same code running on glassfish, no problems.
When we deployed on websphere (7) sending the messagerequest failed with:

javax.xml.ws.soap.SOAPFaultException: The endpoint reference (EPR) for the Operation not found is http://xxx.xxx.xxx:12116/OW-WebService/InvestmentResultPeriodService and the WSA Action =
After some poking around I found out that there was a slight difference in the format of the SOAP message being sent

This was the faulty message
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ows="http://abnamro.nl/services" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<country xmlns="http://xxx">NL</country>
</soapenv:Header>
<soapenv:Body>
<ns2:invesRequestType
xmlns:ns2="http://xxx">
<currencyCode>USD</currencyCode>
<locale>en</locale>
<forceRealtime>false</forceRealtime>
</ns2:invesRequestType>
</soapenv:Body>
</soapenv:Envelope>

And this is what it actually should look like

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ows="http://abnamro.nl/services" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<country xmlns="http://xxx">NL</country>
</soapenv:Header>
<soapenv:Body>
<invesRequestType
xmlns:ns2="http://xxx">
<currencyCode>USD</currencyCode>
<locale>en</locale>
<forceRealtime>false</forceRealtime>
</invesRequestType>
</soapenv:Body>
</soapenv:Envelope>

So the only difference in the message is the ns2 in the invesResult

So why did this occur?

After comparing the InvesRequestType to another, working, class the difference was an annotation

@XmlRootElement

I used this before for exposing the class through rest

Apparently websphere does not like the outcome of adding this annotation.

woensdag 31 augustus 2011

Flickering in JQueryMobile

At some time we where bothered by some flickering occurring in our JQueryMobile app.

Turns out, for me, its fixed when I put

input {
outline: none;
}

in the css

Unable to create JAXBContext due to the security restriction

I got this error trying to deploy an application on WebSphere.

The error doesn't really speak for itself and you need to go digging in the stacktrace to find what went wrong. Turns out I simply forgot to change the porpOrder so it matches the actual properties of the class.

@XmlType(name = "SearchRequestType", namespace = "http://foo.bar.com/services", propOrder = {
"property1", "property2", "property3", "..."
})

donderdag 25 augustus 2011

Double swipe event firing in JQueryMobile

I was having some trouble with swipe events firing twice in JQueryMobile

e.bind('swipeleft swiperight',function(event){
//....
};

changing this to a live() fixed it

e.live('swipeleft swiperight',function(event){
//....
};

the bind event will only attach to elements already rendered in the dom, so somehow i guess it gets bound twice

dinsdag 15 februari 2011

Rendersnake 1.0 released


RenderSnake is a presentation library for creating HTML pages and components, all written in Java.

Its purpose is to support the creation of Web applications that are better maintainable, easier to reuse, have testable UI components and produce compact HTML in an efficient way.

and now version 1.0 is out!

donderdag 1 juli 2010

Using property file outside of runnable JAR with spring

What I needed to deliver was quite simple, a runnable jar file configured by a property file located in the same directory as the jar file.

As it turns out, the classpath of runable jar files does not include the execution directory, so i needed to come up with another solution.

That solution turned out to be as simple as the problem, apart from the fact that i spent half a day to figure it out. This was the bean description in the spring context.xml :

<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:environment.properties"/>
</bean>

and this is what it should look like to get spring to load the property file from the execution path :

<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="file:environment.properties"/>
</bean>

donderdag 25 maart 2010

Getting started with GWT 2.0, GXT and Eclipse

GWT 2.0.3
Ext GWT SDK 2.1.1 for GWT 2.0
Eclipse Galileo

1. download latest GWT 2.0 release from http://code.google.com/intl/nl-NL/webtoolkit/download.html and unzip it

2. download latest version of GXT for GWT 2.0 from http://www.extjs.com/products/gwt/download.php and unzip it

3. install the eclipse plugin
- in eclipse select "Install new Software" from the "Help" menu
- in the "work with:" field, enter "http://dl.google.com/eclipse/plugin/3.5" (or see http://code.google.com/intl/nl-NL/eclipse/docs/download.html for other eclipse versions)
-install the plugin
-restart eclipse

4. set the SDK for the plugin
- select preferences from the Window menu
- Select Google->Web Toolkit
- click "Add..." and browse to the folder where you unpacked GWT
-click "OK"

5. create a GWT 2.0 project
- select file->new->other
- in "Google" select "Web application project"
- click "next"
- enter a name
- enter a package name
- uncheck the box "Use Google App Engine"
- click "Finish"

You now have a new google web toolkit project with an example application. Try to run the example by selecting Run As->Web Application from the Run menu.

Now we need to enable the GWT project to use GXT

in gwt.xml include this line :
<inherits name="com.extjs.gxt.ui.GXT" />



in the default html page [projectname].html add the GXT css :
<link rel="stylesheet" type="text/css" href="css/ext-all.css">


then copy the 'css' and 'images' directories from the 'gxt dirercotry'/resources to the war directory and you are all set with GWT 2.0 and GXT!