Archive for the ‘System architecture’ Category
« Older EntriesUsing RPC-style, encoded Axis 1 webservices with spring-remoting
Monday, October 12th, 2009
Posted in: Axis 1, Jax-ws, Spring-Remoting J2EE, System architecture, java, open source.
Preamble
When working with enterprise integration you will quite often deal with legacy systems integration.
I recently had the case where integration of webservices was requested, and much to my surprise there are huge issues when attempting to integrate old webservices (as in pre axis2 and pre jax-ws).
These webservices use outdated or unsupported methods, such as rpc-style/encoded communication, or even worce, outdated elements in the XML messages, for instance <multiref>’s. Having to integrate such services does of course imply that you cannot change anything on the server side, and thus such an outdated format must still be consumed.
This is a huge problem, since current WS implementations, such as the popular axis2 framework, do simply not support these formats.
What surprised me the most about this is that webservices are designed to make systems independent by defining a common communication and data format, which is the exact opposite of what is going on here – and these formats are not that old, we are probably talking 4-5 years.
Developers facing these problems are taking rather desperate measures to work around these problems, such as using on-the-fly XSLT transformation to convert incoming and outgoing WS messages. However, this binds your application even stronger to the outdated format and specific service data.
In my case I wanted to use Spring-remoting. Since the service was RPC-style, I wanted to use the JaxRpcPortProxyFactoryBean to create an on-the-fly proxy implementing the service interface. What I did not want to do is having to write any additional code to consume the service. Furthermore, I wanted the complex objects transferred by the services to be represented by standard JAVA beans, and not be generated using the wsdl2java axis1 tools. Here is how I got this to work.
Read the rest of “Using RPC-style, encoded Axis 1 webservices with spring-remoting”
Modular development with OSGI about to be very, very popular – finally.
Monday, March 2nd, 2009
Posted in: J2EE, JPA, OSGI, System architecture, eclipselink, java, open source, spring.
It’s quite exciting to see the tremendous progress in development tools, patterns, frameworks and libraries since the release of JAVA 1.0 in 1996.
Within just thirteen years, development improved from the first applets, from the dark ages of the first EJB standardization attempts and a lack of suitable development processes into an age where aspect oriented programming, dependency injection and a freely available range of lightweight yet extremely powerful frameworks, libraries and API’s finally permitted the humble programmer to do what he always wanted to do – analyze problems, and elegantly write them down without spending all of his precious time on the syntax.
I would even go as far as saying that there was no object orientation before programming crosscutting concerns and using dependency injection became established mechanisms.
Think about it: The original goal of OO is not to use inheritance, encapsulation, identity and polymorphism, but to express the real world of things – our reality – using an abstract world of things, while preserving most of the properties and relationships we observe in reality.
Before AOP, before being able to separate the description of things from creating, configurating and connecting concrete instances through dependency injection frameworks, this goal was hard to achieve.
Modules larger than classes with OSGI
Now however, we are about to reach a new stage in development of object orientation in JAVA: Developing modules that are larger than classes, modules which can, once properly identified, be developed independently using all the wonderful technology described beforehand. The technology used to achieve this has a name: OSGI. This technology has quite a long history of development, but a certain lack of elegance and light-weightiness barred this component model from becoming a real hit in the worldwide development community. This is about to change.
Read the rest of “Modular development with OSGI about to be very, very popular – finally.”
Facts on open source projects for decision-makers
Friday, October 17th, 2008
Posted in: QA, System architecture, hibernate, ohloh.net, open source.
Summary
Finding useful information about open source software projects can be tedious – especially when trying to find facts that your customers understand.
ohloh.net provides excellent, comparable meta information for open source projects and should be on every decision-makers favorites list.
Why this software and not another?
I often find the need to justify the use of a specific open source software. Why is is better than another, competing open source software? How much better is the community support? How many supporters does it have? How active is the project and how much effort was spend on it’s development? How about metrics for the code, and how do you compare software in general?
Those are about the most important questions i have to answer.
Read the rest of “Facts on open source projects for decision-makers”
Howto use acegi-security and the @Secured annotation for method interception
Friday, July 4th, 2008
Posted in: J2EE, System architecture, acegi, java, spring.
Acegi-security (now spring-security) provides a @Secured (org.acegisecurity.annotation.Secured) annotation.
Classes using this annotation can be processed by a suitable BeanPostProcessor, which will proxy the class so that calls to @Secured methods are intercepted and the required authentication is validated against the acegi security context. Note that the following is a configuration for acegi-security, things might be different with spring-security.
2008-07-12: Comment: It is indeed a lot simpler using spring-security, as Craig Walls demonstrates in this posting in his blog “Spring-Loaded”).
In order to activate the post processing for the @Secured annotations, a spring configuration such as the following is required:
Read the rest of “Howto use acegi-security and the @Secured annotation for method interception”
Why it’s better to integrate XML schema files into the classpath
Saturday, May 10th, 2008
Posted in: J2EE, System architecture, java, spring.
When using schema files in your XML configuration, it’s might happen that your XML parser will attempt to actually download the schema file using the configured schema URI.
This is the case when there is no mechanism for resolving the schema URI to a local schema file (as, for example the bean handler registration in spring) or when such a mechanism fails.
Read the rest of “Why it’s better to integrate XML schema files into the classpath”
Why @Configurable and @Transactional don’t belong to into the same class
Wednesday, March 26th, 2008
Posted in: J2EE, JPA, System architecture, java, spring.
When using the Spring framework, one can still benefit from dependency injection etc. even if a bean is not obtained from a bean factory by using the @Configurable annotation, f.e.:
Read the rest of “Why @Configurable and @Transactional don’t belong to into the same class”
ClassCastException, PersistentCollection, Hibernate & JPA
Tuesday, March 25th, 2008
Posted in: J2EE, JPA, System architecture, hibernate, java.
Verwendet man Hibernate (und JPA) kann es mitunter zu recht exotischen Fehlern kommen.
Ein Beispiel, zu dem ich bei google heute nicht einen einzigen Treffer gefunden habe ist folgende Exception:
...
Caused by: javax.persistence.RollbackException: Error while commiting the transaction
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:71)
at org.springframework.orm.jpa.JpaTransactionManager.doCommit(
JpaTransactionManager.java:438)
... 55 more
Caused by: java.lang.ClassCastException: java.util.HashSet
cannot be cast to org.hibernate.collection.PersistentCollection
at org.hibernate.event.def.FlushVisitor.processCollection(FlushVisitor.java:34)
...
Read the rest of “ClassCastException, PersistentCollection, Hibernate & JPA”
Typparameter einer generischen java-Klasse zur Laufzeit bestimmen
Tuesday, March 25th, 2008
Posted in: System architecture, generics, java.
Einer der etwas komplizierten Teile von Java generics ist der Umgang mit Typparametern zur Laufzeit.
Oftmals wird behauptet, dass es nicht möglich sei, den konkreten Typ eines Typ-Parameters zur Laufzeit zu erhalten. Das stimmt so aber nicht.
Read the rest of “Typparameter einer generischen java-Klasse zur Laufzeit bestimmen”
Spring-loaded
Saturday, March 22nd, 2008
Posted in: J2EE, System architecture, java, spring.
Craig Walls, einer der Autoren des famosen “Spring in action” Buches, schreibt in seinem Weblog vieles extrem lesenswertes rund um Spring. Dank der zahlreichen Codebeispiele eine gute Quelle für best practice Spring – und natürlich sehr aktuell!
No CommentsSpring context, überall – auch mit openAMF
Wednesday, March 12th, 2008
Posted in: J2EE, System architecture, java, spring, tomcat.
Benutzt man zur Anbindung eines Flash-Frontends openAMF oder macht man irgend etwas ähnliches, was am DispatcherServlet vorbei geht, muss man nicht auf die AOP basierten scopes verzichten. In diesem Fall stellt ein einfacher Filter in der web.xml die entsprechenden Scopes ur Verfügung:
<filter>
<filter-name>springContextFilter</filter-name>
<filter-class>org.springframework.web.filter.RequestContextFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>springContextFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Mehr dazu gibt’s natürlich in der spring-doku!
No Comments « Older Entries