Skip to content

Instantly share code, notes, and snippets.

@zarzen
Created November 4, 2015 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zarzen/6b64465f2972fc2b984a to your computer and use it in GitHub Desktop.
Save zarzen/6b64465f2972fc2b984a to your computer and use it in GitHub Desktop.
convert dropwizard application to camel restlet application

最近的工作是把dropwizard的一个提供restful API的程序转化成能够在jboss-fuse中运行的,利用camel restful DSL提供restful API的 程序。一开始没什么思路,不过后来想想就把dropwizard start application的那部分去掉,而jersey提供的那些restful API注解去掉, 用camel搞个route指向对应的logic bean就可以了。 不过其中把新的,去掉了dropwizard包装的程序运行在fuse中需要把,程序依赖的包安装到fuse容器中,并且需要能够被引用的到。也就是 安装进去的bundle需要export对应的包,给别的java程序使用。安装jdbi的bundle的时候出现了问题。这个jar并不是一个osgi-bundle的, 没有定义需要export的packages。我手动改了MF文件也没用。后来被告知放到deploy目录下去。然而我把那个改了MF的jar放到那儿并没有被 自动安装到fuse中。另一没有修改的,在第二天的时候是成功的安装了上去。而且export了所有的packages。这个可能是deploy的特别的地方。 但是既然这样可以,那么fuse必然提供了一种机制,可以在MF文件之外指定需要export的packages。

@zarzen
Copy link
Author

zarzen commented Nov 10, 2015

<bean id="testDS" class="oracle.jdbc.pool.OracleDataSource">
        <property name="URL" value="${URL}" />
        <property name="user" value="${username}" />
        <property name="password" value="${password}" />
</bean>

在上面这个坑爹的配置中需要注意,URL需要是大写的。 user 而不是username。
下面这种形式不知道为什么一直是:org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nested exception is java.lang.IllegalStateException: Could not load JDBC driver class [oracle.jdbc.driver.OracleDriver] 这个错误,我确认了osgi容器里是有oracle driver的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment