Just came across Craig Wall post on Roo/OSGi Blueprint/Karaf. I've been fooling around with Roo lately and similar idea of deploying Roo code as OSGi bundle has occurred to me. In particular I like the Roo Rich-Domain-Object concept; the implementation using inter-type declaration and add hosts of functionality to the domain class ... and so on. But I don't care too much about the SpringMVC based web layer personally.
Thursday, October 22, 2009
Roo Karaf
Just came across Craig Wall post on Roo/OSGi Blueprint/Karaf. I've been fooling around with Roo lately and similar idea of deploying Roo code as OSGi bundle has occurred to me. In particular I like the Roo Rich-Domain-Object concept; the implementation using inter-type declaration and add hosts of functionality to the domain class ... and so on. But I don't care too much about the SpringMVC based web layer personally.
Posted by
Unknown
at
9:00 PM
0
comments
Tuesday, October 20, 2009
Wave real-time collaboration, BPM modeling
This Gravity screencast demo providing real-time, cloud-based collaborative business process modelling within Google Wave. Gravity is a BPMN modeler created with GWT.
Leveraging the collaborative features of Google Wave, all business process modelling activities get propagated in near real-time to all other participants of the Wave. In addition, participants of the Wave can use all other features provided by Google and its developer community to enrich the collaborative modelling experience.Very interesting demo and illustrates how real-time collaboration is going to change the way we do our business. This is just a gleam of the business implication of Wave as a collaboration technology.
Posted by
Unknown
at
7:50 PM
0
comments
Monday, October 19, 2009
Sling in Karaf
Sling in Karaf
There is a contributed bundle, contrib/launchpad/karaf in Sling SVN. The bundle defines a simple Karaf features for Sling.
Instruction is included in README.txt in the bundle project.
Now you can create your custom bundles, create a features definition and use the Karaf Shell to manage your bundles during development. Say you are using declarative service, you can start and stop the provider(s) and test that the consumer(s) are behaving as expected.
Posted by
Unknown
at
11:16 PM
0
comments
Wednesday, October 7, 2009
Building Servicemix 4
Has been working with the SMX4 source lately. A note about the build and run procedure; after building the project (mvn install) at the root level, the distributions (zip/tgz) can be found at ./features/assembly/target/ under the name apache-servicemix-4.1.0-SNAPSHOT.(zip|tar.gz).
Posted by
Unknown
at
8:29 PM
0
comments
Monday, September 21, 2009
Rest and Enterprise Integration
Rest and Enterprise Integration
Posted by
Unknown
at
11:56 PM
0
comments
Monday, January 21, 2008
JNDI with jetty-env.xml
JNDI with jetty-env.xml
It toke me a couple hours to figure out how to setup a JNDI datasource in jetty-env.xml. So hopefully this will save some time for others trying to do the same.
In my case I'm using maven 2 to manage my web project and maven-jetty-plugin to quickly test the application. The project use JPA for ORM and I'm using Spring JPA support for configuration.
So this is what you need to do:
- Tell jetty the location of the jetty-env.xml files in the pom
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.6</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<jettyEnvXml>${basedir}/src/test/resources/jetty-env.xml</jettyEnvXml>
</configuration>
....
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-plus</artifactId>
<version>6.1.6</version>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-naming</artifactId>
<version>6.1.6</version>
</dependency>
</plugin>
....
</plugins>
....
</build>
- Create the jetty-env.xml configuration file, for example:
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Set name="contextPath">/dev</Set>
<New id="LibraryDS" class="org.mortbay.jetty.plus.naming.Resource">
<Arg>jdbc/LibraryDS</Arg>
<Arg>
<New class="org.apache.commons.dbcp.BasicDataSource">
<Set name="Url">jdbc:mysql://localhost:3306/fornaxDS</Set>
<Set name="DriverClassName">com.mysql.jdbc.Driver</Set>
<Set name="Username">admin</Set>
<Set name="Password">adminpasswd</Set>
<Set name="MaxActive">30</Set>
<Set name="MaxIdle">10</Set>
<Set name="MinIdle">2</Set>
<Set name="MaxWait">5000</Set>
<Set name="MinEvictableIdleTimeMillis">25000</Set>
<Set name="TimeBetweenEvictionRunsMillis">30000</Set>
</New>
</Arg>
</New>
</Configure> - Add a resource-env-ref to your web.xml:
<resource-env-ref>
<resource-env-ref-name>jdbc/LibraryDS</resource-env-ref-name>
<resource-env-ref-type>
javax.sql.DataSource
</resource-env-ref-type>
</resource-env-ref>
- Define your sessionFactory as follow:
<bean class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" id="sessionFactory">
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.query.substitutions">true 1, false 0</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.connection.datasource">java:comp/env/jdbc/LibraryDS</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
<prop key="hibernate.current_session_context_class">org.hibernate.context.ManagedSessionContext</prop>
<prop key="hibernate.transaction.auto_close_session">false</prop>
</props>
</property>
....
</bean>
What is not obvious (I did not read the document carefully enough) is that "Object bindings declared in jetty-env.xml will automatically be bound into the java:comp/env namespace",
Posted by
Unknown
at
1:35 AM
4
comments
Sunday, May 27, 2007
ActiveRecord-JDBC db:schema:dump
AcitveRecord-JDBC JTDS db:schema:dump
I have a MS-Sql Server DB that I would like to test out under JRuby (0.9) and ActiveRecord-JDBC (0.3.1). I'm using JTDS. Two problems I ran into, and the patches that to fix them:
- The first problem is "no type for date", and the fix has been posted somewhere by can-remember-who: add the bold line to ../ActiveRecord-JDBC-0.3.1/lib/active_record/connection_adapters/jdbc_adapter.rb
:date => [ lambda {|r| Jdbc::Types::DATE == r['data_type'].to_i},
lambda {|r| r['type_name'] =~ /^date$/i},
lambda {|r| r['type_name'] =~ /^datetime$/i}],
- The next problem occures when I try to do a "rake db:schema:dump". I've search the web but failed to come up with any solution. There is actually a multitude of related problems:
- method indexes is no defined in ../ActiveRecord-JDBC-0.3.1/lib/jdbc_adapter/jdbc_mssql.rb. So I simply copy it from jdbc_mysql.rb:
#### copy from mysql ###
def indexes(table_name, name = nil)#:nodoc:
r = @connection.indexes(table_name.upcase)
end
- with the above modification, the tables are dumped in the resulting schema.rb (althought it also dump a bunch of system-tables and numeric(xx,yy) columns are not defined properly with the correct precision and scale, I could live with that for now). But all index tables failed. This look like a peculiarity with the JTDS driver that is not properly handled by jdbc_adapter. Here is the fix to jdbc_adapter.rb:
def indexes(table_name, name = nil)
metadata = @connection.getMetaData
unless String === table_name
table_name = table_name.to_s
else
table_name = table_name.dup
end
table_name.upcase! if metadata.storesUpperCaseIdentifiers
table_name.downcase! if metadata.storesLowerCaseIdentifiers
resultset = metadata.getIndexInfo(nil, nil, table_name, false, false)
primary_keys = primary_keys(table_name)
indexes = []
current_index = nil
while resultset.next
# index_name = resultset.get_string(Jdbc::IndexMetaData::INDEX_NAME).downcase
# The first resultset seems to contain information other than that of a index's column. INDEX_NAME is null.
# And you get a nil.downcase not defined
index_name = resultset.get_string(Jdbc::IndexMetaData::INDEX_NAME)
# just ignore if index_name is null
next if !index_name
index_name.downcase! if index_name
column_name = resultset.get_string(Jdbc::IndexMetaData::COLUMN_NAME).downcase
Note that the above fixes are more of a hack than a real solution.
I'm actually using Dr. Nic Magic Models on the legacy SQL Server database. I may blog about that when I find time for that.
Posted by
Unknown
at
1:38 AM
2
comments