Using spring mvc and the @ResponseBody annotation might give you the HttpMediaTypeNotAcceptableException if you set the "Accept" header to "application/json". To solve this, add jackson-jaxrs to your classpath. Nothing else needs to be done, spring does it's magic.
In your test , slap on a @Autowired on your AnnotationMethodHandlerAdapter.
Monday, February 14, 2011
Sunday, February 13, 2011
Maven + appengine
This memo is about using maven with your google appengine project.
Prerequisites:
Maven 3.0x
Command line interface
Know how to edit your pom
Howto:
Prerequisites:
Maven 3.0x
Command line interface
Know how to edit your pom
Howto:
- mvn archetype:generate choose gae-jsp and enter your project group/artifactid
- cd
- edit your pom.xml file to define at least the 1.4.2 version of google appengine, found under the properties tag.
1.4.2 - type mvn install to check that everything is ok
- type mvn gae:unpack to download and install the gae runtime into your local repository
- Edit the src/main/webapp/index.jsp, remove all jsp tags.
- type mvn gae:run and open localhost:8080
- mvn eclipse:eclipse and import the project into eclipse.
- Add spring, spring-mvc and spring-jdo or spring-jpa to your projects pom-file.
Update: updated version from 1.4.0 to 1.4.2
Wednesday, November 24, 2010
Setting up your favourites in Eclipse
I have started to use the corematchers from org.hamcrest, and find them very useful and easy to understand. They give a grammatical touch to my assert-statements that the regular assertEquals(...) does not. E.g. assertTrue(a > 0) can be written as assertThat( a , is(greaterThan(0))), which can be easier for non-technical people to understand.
Anyway, to avoid manual static imports, let eclipse do the job for you. Configure it as follows:
Anyway, to avoid manual static imports, let eclipse do the job for you. Configure it as follows:
Wednesday, November 10, 2010
Remote logging with GWT
Remote logging was introduced in gwt 2.1, but the documentation is still a bit incomplete. To enable remote logging you will have to
- Add configuration-stuff in your .gwt.xml file:
< inherits name="com.google.gwt.logging.Logging" >
< set-property name="gwt.logging.simpleRemoteHandler" value="ENABLED" >
< /set-property >
< /inherits >
- Add the remote logging servlet in your web.xml (remember to replace YOURPROJECT with your projects name):
< servlet >
< servlet-class>com.google.gwt.logging.server.RemoteLoggingServiceImpl </servlet-class >
< servlet-name >logger < /servlet-name >
< /servlet >
< servlet-mapping >
< servlet-name>logger </servlet-name >
< url-pattern>/YOURPROJECT/remote_logging </url-pattern >
< /servlet-mapping >
Friday, February 5, 2010
Declarative UI programming with GWT
If you have tried programming something on the GWT - 'platform' you should take at declarative UI programming at the guide at DevGuideUiBinder.html .oHowever, you should NOT add the panels with Document.get().appendChild( new MyBrandNewUIWidget().getElement()) as NONE of your events will ever trigger. You should however add your new widgets the old fashioned way with RootPanel.get().add( new MyBrandNewUIWidget());
Happy programming!
(Maybe I should put out an example of how great the new GWT 2.0 is, it's a lot of fun!)
Happy programming!
(Maybe I should put out an example of how great the new GWT 2.0 is, it's a lot of fun!)
Tuesday, November 3, 2009
Building CUDA examples on Snow Leopard
The usual 'make' command failed for me, but doing 'make clobber && make i386=1' worked perfect :)
Now it's time to learn some serious gpu-programming...
Now it's time to learn some serious gpu-programming...
Wednesday, September 30, 2009
got an javax.jdo.JDOFatalUserException ?
I was experimenting with junit test in combination with the JDO bundled with google app-engines java framwork when I got this message: "javax.jdo.JDOFatalUserException: No PersistenceManagerFactory configurable via properties resource "" or no named PMF or persistence unit named "" found."
This was resolved by replacing
pmf = JDOHelper.getPersistenceManagerFactory();
with
pmf = JDOHelper.getPersistenceManagerFactory("transactions-optional");
Duh.
This was resolved by replacing
pmf = JDOHelper.getPersistenceManagerFactory();
with
pmf = JDOHelper.getPersistenceManagerFactory("transactions-optional");
Duh.
Subscribe to:
Posts (Atom)