- 浏览: 2870087 次
- 性别:
- 来自: 武汉
文章分类
- 全部博客 (1173)
- 名言警句 (5)
- 心情随笔 (50)
- 数据库 (57)
- Java基础 (241)
- J2EE框架 (91)
- 数据结构 (12)
- 程序设计 (21)
- WEB技术 (128)
- 网络日志 (12)
- IT资讯 (247)
- linux (64)
- solaris (2)
- 其它 (143)
- WebService (4)
- 日语学习 (2)
- 机器人 (5)
- Android (5)
- cgywin (3)
- Game (1)
- DWR (1)
- spring (8)
- canvas (1)
- Guava (3)
- Modbus (5)
- 测试 (6)
- mongodb (9)
- Quartz (2)
- Cron (1)
- windows (2)
- 持续集成 (1)
- bootstrap (3)
- 结对编程 (1)
- nodejs (1)
- Netty (1)
- 安全 (3)
- webstorm (2)
- sparkline (1)
- Job (1)
- git (3)
- Maven (3)
- knockout (5)
- jquery (1)
- bower (1)
- docker (1)
- confluence (4)
- wiki (1)
- GoogleMap (1)
- jekyll (10)
- ruby (2)
- npm (3)
- browserify (1)
- gulp (3)
- openwrt (1)
- discuz (3)
- 输入法 (1)
- JPA (1)
- eclipse (2)
- IntelliJ (1)
- css (1)
- 虚拟机 (1)
- 操作系统 (1)
- azkaban (2)
- scrum (1)
最新评论
-
pangxiea_:
你好, 想请问一下 Linux下 这么使用rxtxcomm 在 ...
使用Java进行串口通信 -
abababudei:
请教一下,这个您是怎么解决的:/dev/ttyS2enteri ...
Java应用程序的MODBUS通讯 -
xuniverse:
hannibal005 写道楼主,我问下 request.se ...
用javascript与java进行RSA加密与解密 -
atxkm:
找了一下午,终于找到了
gulp 拷贝文件时如何移除文件目录结构 -
kalogen:
gtczr 写道非常感谢,经过我自己的修改,已经完美实现。发出 ...
用javascript与java进行RSA加密与解密
一、域模型
先从最底层开始,把域模型建立起来,创建一个Plug-in
project -
domain里面的logic,引用了dao,dao也引用了domain,会导致一个错误,于是将logic做为一个独立的bundle,就称为域逻辑吧
二、域逻辑
创建一个Plug-in project - org.phrancol.osgi.jpetstore.domain.logic,不创建Activator,创建一个同名package,将jpetstore\src\org\springframework\samples\jpetstore\domain\logic里面的java文件copy进去,在MANIFEST.MF里面把依赖包导入
三、DAO
该做dao部分了,创建一个 Plug-in project - org.phrancol.osgi.jpetstore.dao 并创建一个同名package,将jpetstore\src\org\springframework\samples\jpetstore\dao里面的东西全部copy进去,在MANIFEST.MF里面导入依赖包(有一些包需要导入成bundle,例如 spring-jdbc,spring-ibatis),启动看看,发现spring-ibatis和persistence没有启动,手动启动spring-ibatis,发现缺少ibatis,于是 New-> Other -> Plug-in from existing JAR archives ,导入ibatis,再启动,发现少 javax.transaction,于是用相同方法导入。
四、配置文件
关于spring的配置文件,只有3个
petstore-servlet.xml - 用于mvc的,定义dispatch bean
applicationContext.xml - 用于域逻辑的
dataAccessContext-local.xml - 用于DAO的,定义了DataSource
(一)dataAccessContext-local.xml
1,将 jdbc.properties和sql-map-config.xml拷贝到META-INF目录里,sql-map-config.xml里面的资源路径可能需要修改一下,maps里面的模型的class属性也需要改一下
2,在META-INF目录中创建一个目录spring,将dataAccessContext-local.xml拷贝进去,将applicationContext.xml里面的加载jdbc.properties的bean移植过来,放在DataSource的上面
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>META-INF/jdbc.properties</value>
</list>
</property>
</bean>
<property name="locations">
<list>
<value>META-INF/jdbc.properties</value>
</list>
</property>
</bean>
再把dataAccessContext-local.xml里面的dao-bean->class属性值修改一下,再把sqlMapClient的configLocation的值修改成META-INF/sql-map-config.xml,例如
<!-- SqlMap setup for iBATIS Database Layer -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="META-INF/sql-map-config.xml"/>
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- ========================= DAO DEFINITIONS: IBATIS IMPLEMENTATIONS ========================= -->
<bean id="accountDao" class="org.phrancol.sogi.jpetstore.dao.ibatis.SqlMapAccountDao">
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
3,启动,报错,找不到ibatis的某个类,报错信息如下<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="META-INF/sql-map-config.xml"/>
<property name="dataSource" ref="dataSource"/>
</bean>
<!-- ========================= DAO DEFINITIONS: IBATIS IMPLEMENTATIONS ========================= -->
<bean id="accountDao" class="org.phrancol.sogi.jpetstore.dao.ibatis.SqlMapAccountDao">
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.ibatis.SqlMapClientFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: com.ibatis.sqlmap.engine.transaction.external.ExternalTransactionConfig
Caused by: java.lang.NoClassDefFoundError: com.ibatis.sqlmap.engine.transaction.external.ExternalTransactionConfig
at org.springframework.orm.ibatis.SqlMapClientFactoryBean.class$(SqlMapClientFactoryBean.java:72)
看来是spring-ibatis找不到com.ibatis.sqlmap.engine.transaction.external.ExternalTransactionConfig,来看看spring-ibatis的MANIFEST.MF,Dependencies的Import
Packages,
加上com.ibatis.sqlmap.engine.transaction.external,再启动,找不到DBCP,导入common-DBCP和common-pool,再启动,正常,SS一下,还是正常Caused by: java.lang.NoClassDefFoundError: com.ibatis.sqlmap.engine.transaction.external.ExternalTransactionConfig
at org.springframework.orm.ibatis.SqlMapClientFactoryBean.class$(SqlMapClientFactoryBean.java:72)
(二)applicationContext.xml
1,在org.phrancol.osgi.jpetstore.domain.logic的META-INF目录中创建一个目录spring,将applicationContext.xml拷贝进去,并改名为 logic-context.xml,删除propertyConfigurer这个bean,因为它已经被移到了dataAccessContext-local.xml里面,将里面的bean的class属性修改一下,启动,发现缺少org.aspectj,导入一个,再启动,报错
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'accountDao' is defined
无法找到
accountDao,accountDao被定义在org.phrancol.osgi.jpetstore.dao里面了,于是现在需要使用spring-osgi
来进行跨bundle的引用了。2,org.phrancol.osgi.jpetstore.dao/META-INF/spring目录中创建一个spring配置文件dataAccessContext-local-osgi.xml,使用<osgi:service>将accountDao和其他被引用的DAO注册成为OSGI Service
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
<osgi:service id="accountDaoOsgi" ref="accountDao"
interface="org.phrancol.osgi.jpetstore.dao.AccountDao">
</osgi:service>
<osgi:service id="categoryDaoOsgi" ref="categoryDao"
interface="org.phrancol.osgi.jpetstore.dao.CategoryDao">
</osgi:service>
<osgi:service id="productDaoOsgi" ref="productDao"
interface="org.phrancol.osgi.jpetstore.dao.ProductDao">
</osgi:service>
<osgi:service id="itemDaoOsgi" ref="itemDao"
interface="org.phrancol.osgi.jpetstore.dao.ItemDao">
</osgi:service>
<osgi:service id="orderDaoOsgi" ref="orderDao"
interface="org.phrancol.osgi.jpetstore.dao.OrderDao">
</osgi:service>
</beans>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
<osgi:service id="accountDaoOsgi" ref="accountDao"
interface="org.phrancol.osgi.jpetstore.dao.AccountDao">
</osgi:service>
<osgi:service id="categoryDaoOsgi" ref="categoryDao"
interface="org.phrancol.osgi.jpetstore.dao.CategoryDao">
</osgi:service>
<osgi:service id="productDaoOsgi" ref="productDao"
interface="org.phrancol.osgi.jpetstore.dao.ProductDao">
</osgi:service>
<osgi:service id="itemDaoOsgi" ref="itemDao"
interface="org.phrancol.osgi.jpetstore.dao.ItemDao">
</osgi:service>
<osgi:service id="orderDaoOsgi" ref="orderDao"
interface="org.phrancol.osgi.jpetstore.dao.OrderDao">
</osgi:service>
</beans>
3,在org.phrancol.osgi.jpetstore.domain.logic/META-INF/spring 也创建一个spring配置文件logic-context-osgi.xml,使用<osgi:reference>获取服务
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
<osgi:reference id="accountDaoOsgi" interface="org.phrancol.osgi.jpetstore.dao.AccountDao"/>
<osgi:reference id="categoryDaoOsgi" interface="org.phrancol.osgi.jpetstore.dao.CategoryDao"/>
<osgi:reference id="productDaoOsgi" interface="org.phrancol.osgi.jpetstore.dao.ProductDao"/>
<osgi:reference id="itemDaoOsgi" interface="org.phrancol.osgi.jpetstore.dao.ItemDao"/>
<osgi:reference id="orderDaoOsgi" interface="org.phrancol.osgi.jpetstore.dao.OrderDao"/>
</beans>
将logic-context.xml里面的bean petStore的属性引用修改一下<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:osgi="http://www.springframework.org/schema/osgi"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd">
<osgi:reference id="accountDaoOsgi" interface="org.phrancol.osgi.jpetstore.dao.AccountDao"/>
<osgi:reference id="categoryDaoOsgi" interface="org.phrancol.osgi.jpetstore.dao.CategoryDao"/>
<osgi:reference id="productDaoOsgi" interface="org.phrancol.osgi.jpetstore.dao.ProductDao"/>
<osgi:reference id="itemDaoOsgi" interface="org.phrancol.osgi.jpetstore.dao.ItemDao"/>
<osgi:reference id="orderDaoOsgi" interface="org.phrancol.osgi.jpetstore.dao.OrderDao"/>
</beans>
<bean id="petStore" class="org.phrancol.osgi.jpetstore.domain.logic.PetStoreImpl">
<property name="accountDao" ref="accountDaoOsgi"/>
<property name="categoryDao" ref="categoryDaoOsgi"/>
<property name="productDao" ref="productDaoOsgi"/>
<property name="itemDao" ref="itemDaoOsgi"/>
<property name="orderDao" ref="orderDaoOsgi"/>
</bean>
再启动看看,还是报错<property name="accountDao" ref="accountDaoOsgi"/>
<property name="categoryDao" ref="categoryDaoOsgi"/>
<property name="productDao" ref="productDaoOsgi"/>
<property name="itemDao" ref="itemDaoOsgi"/>
<property name="orderDao" ref="orderDaoOsgi"/>
</bean>
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txAdvice': Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' is defined
原来是transactionManager的问题,在DAO里面将transactionManager注册成osgi
service,在domain.logic里面引用,然后给txAdvice加上transaction-manager属性<tx:advice id="txAdvice" transaction-manager="transactionManagerOsgi">
<tx:attributes>
<tx:method name="insert*"/>
<tx:method name="update*"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice>
OK,启动,正常了<tx:attributes>
<tx:method name="insert*"/>
<tx:method name="update*"/>
<tx:method name="*" read-only="true"/>
</tx:attributes>
</tx:advice>
(三)petstore-servlet.xml
最后到spring-mvc的配置文件了,在前面已经将这个配置文件拷贝到org.phrancol.osgi.jpetstore.springmvc/META-INF/dispatcher目录下了,并且做了一些修改,让DispatcherServlet加载用以显示首页
1,新建一个package org.phrancol.osgi.jpetstore.springmvc.controller,将jpetstore\src\org\springframework\samples\jpetstore\web\spring里面的java文件拷贝进去,将依赖包导入,然后在petstore-servlet.xml里面加上一个dispatch-bean,
<bean name="/shop/addItemToCart.do" class="org.phrancol.osgi.jpetstore.springmvc.controller.AddItemToCartController">
<property name="petStore" ref="petStore"/>
</bean>
启动看看效果,报错<property name="petStore" ref="petStore"/>
</bean>
Caused by: java.lang.ClassNotFoundException: org.phrancol.osgi.jpetstore.springmvc.controller.AddItemToCartController
居然找不到这个类,来看看ClassLoaderThread.currentThread().getContextClassLoader() -> org.eclipse.core.runtime.internal.adaptor.ContextFinder
Activator's ClassLoader -> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader
原来如此,那就这样Activator's ClassLoader -> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader())
其实这样也是可以的,但是为了不绕弯路,而且既然是Spring的配置文件,Spring-osgi也提供得有Bundle的ClassLoader
->
org.springframework.osgi.context.support.BundleDelegatingClassLoader
交给Spring的ClassLoader吧2,看一段代码 org.springframework.osgi.context.support.BundleContextAwareProcessor
public boolean postProcessAfterInstantiation(Object bean, String beanName) throws BeansException {
if (bean instanceof BundleContextAware) {
if (this.bundleContext == null) {
throw new IllegalStateException("Cannot satisfy BundleContextAware for bean '" +
beanName + "' without BundleContext");
}
if (logger.isDebugEnabled()) {
logger.debug("Invoking setBundleContext on BundleContextAware bean '" + beanName + "'");
}
((BundleContextAware) bean).setBundleContext(this.bundleContext);
}
return true;
}
if (bean instanceof BundleContextAware) {
if (this.bundleContext == null) {
throw new IllegalStateException("Cannot satisfy BundleContextAware for bean '" +
beanName + "' without BundleContext");
}
if (logger.isDebugEnabled()) {
logger.debug("Invoking setBundleContext on BundleContextAware bean '" + beanName + "'");
}
((BundleContextAware) bean).setBundleContext(this.bundleContext);
}
return true;
}
3,再来看看这个接口org.springframework.osgi.context.BundleContextAware
Interface that enables beans to find the bundle context they are defined in. Note that in most circumstances there is no need for a bean to implement this interface.
OK,那就写个BundleContextAware,然后配置成Bean就可以了4,创建一个 Plug-in project org.phrancol.osgi.jpetstore.util,并创建同名package,新建一个Interface HttpServiceRegister 用于注册Servlet或Resource,这个过程在方法 public void serviceRegister(BundleContext context);里进行,新建一个Class BundleServiceRegister
public class BundleServiceRegister implements BundleContextAware {
private HttpServiceRegister httpServiceRegister;
public BundleServiceRegister(HttpServiceRegister httpServiceRegister){
this.httpServiceRegister = httpServiceRegister;
}
public void setBundleContext(BundleContext context) {
this.httpServiceRegister.serviceRegister(context);
}
}
private HttpServiceRegister httpServiceRegister;
public BundleServiceRegister(HttpServiceRegister httpServiceRegister){
this.httpServiceRegister = httpServiceRegister;
}
public void setBundleContext(BundleContext context) {
this.httpServiceRegister.serviceRegister(context);
}
}
5,生成一个类org.phrancol.osgi.jpetstore.springmvc.SpringmvcHttpServiceRegister implements HttpServiceRegister
将Activator.start方法里的内容拷贝到SpringmvcHttpServiceRegister.serviceRegister方法里,删除Activator(MANIFEST.MF)
6,在org.phrancol.osgi.jpetstore.springmvc/META-INF/下建立一个目录spring,从别的地方copy一个bean配置文件过来,改名为logic-context.xml,加入如下配置
<beans>
<bean id="springHttpServiceRegister"
class="org.phrancol.osgi.jpetstore.util.BundleServiceRegister">
<constructor-arg>
<bean class="org.phrancol.osgi.jpetstore.springmvc.SpringmvcHttpServiceRegister" />
</constructor-arg>
</bean>
</beans>
启动,报错,petstore-servlet.xml里面的bean
petStore
找不到,这个bean被定义在org.phrancol.osgi.jpetstore.domain.logic里面,于是使用<osgi:service>和<osgi:reference>来获取<bean id="springHttpServiceRegister"
class="org.phrancol.osgi.jpetstore.util.BundleServiceRegister">
<constructor-arg>
<bean class="org.phrancol.osgi.jpetstore.springmvc.SpringmvcHttpServiceRegister" />
</constructor-arg>
</bean>
</beans>
在logic-context-osgi.xml里面加上
<osgi:service id="petStoreOsgi" ref="petStore"
interface="org.phrancol.osgi.jpetstore.domain.logic.PetStoreFacade">
</osgi:service>
在springmvc-context.xml加入如下内容(注意namespaces)interface="org.phrancol.osgi.jpetstore.domain.logic.PetStoreFacade">
</osgi:service>
<osgi:reference id="petStoreOsgi"
interface="org.phrancol.osgi.jpetstore.domain.logic.PetStoreFacade" />
修改一下petstore-servlet.xmlinterface="org.phrancol.osgi.jpetstore.domain.logic.PetStoreFacade" />
<property name="petStore" ref="petStore"/>
改成
<property name="petStore" ref="petStoreOsgi"/>
OK,这次应该没问题了,启动看看效果,还是报错改成
<property name="petStore" ref="petStoreOsgi"/>
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/shop/addItemToCart.do' defined in ServletContext resource [/META-INF/dispatcher/petstore-servlet.xml]: Cannot resolve reference to bean 'petStoreOsgi' while setting bean property 'petStore'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'petStoreOsgi' is defined
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'petStoreOsgi' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:353)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:916)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:243)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:261)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:109)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1100)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'petStoreOsgi' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:353)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:916)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:243)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:261)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:109)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1100)
居然找不到petStoreOsgi这个bean......
发表评论
-
spring mvc @controller unit test
2013-11-20 14:14 38861. spring mvc controller imple ... -
Tomcat 生产服务器性能优化
2013-07-23 06:45 1007试想以下这个情景:你已经开发好了一个程序,这个程序的排版很不 ... -
Loading Multiple Spring Application Contexts with their own ClassLoader
2013-07-11 20:45 1072package de.incompleteco.spring ... -
ActiveMQ JMS的测试
2011-04-06 18:15 3918有二种方式可以测试。 1. 透过testng, 在测试类中完 ... -
Maven系列2--pom.xml 配置详解
2011-01-06 18:00 3176<project xmlns="http ... -
fisheye2.3.6 安装笔记
2010-09-16 20:25 2235一. 准备工作 1. 下载fisheye ... -
服务器端编程的十大性能问题
2010-09-15 12:01 1233今年5 月底,瑞士计算 ... -
JMX in spring 配置
2010-09-07 12:00 3050JConsole中的连接:简单的localhost:1099 ... -
Ehcache 2.0:后写式缓存和JTA支持
2010-05-22 11:13 1854开源缓存框架Ehcache 最 ... -
Twitter系统运维经验
2010-04-12 22:24 1551最近看到的另外一个 ... -
采用OSGi框架开发项目的十个问题
2010-03-21 18:08 1462近期,InfoQ针对Java模块 ... -
IBM和Eclipse加大对OSGi的支持
2010-03-21 18:05 1272为Java提供模块性的OSGi,正在受到IBM和Eclipse ... -
Castor功能与应用参考
2010-03-12 12:48 36271. 项目简介Castor是一个开源的Java项目 ... -
hibernate之 DetachedCriteria实现多表查询
2009-07-25 17:13 13092DetachedCriteria detachedCriter ... -
spring AOP 理论知识点总结
2009-07-24 17:47 21741.1 AOP 的概念 ... -
web.xml 中的listener、 filter、servlet 加载顺序及其详解
2009-07-02 16:14 4124在项目中总会遇到一些 ... -
maven笔记
2009-06-22 22:14 1530mvn package : 项目打包 mvn help:ef ... -
利用maven构建多模块项目
2009-06-17 14:28 53611. 先单独构建各模块为一个独立的项目。 jar项目: m ... -
Maven基础
2009-06-17 12:58 1859下载Maven安装文件。 定义环境变量M2_HOME到pat ... -
安装M2eclipse步骤
2009-06-15 14:45 38221.下载下列所需文件 eclipse3.4.2 ...
相关推荐
标题 "RAP 整合 Spring(基于 Spring-osgi)" 暗示了本文将探讨如何在 RAP(Remote Application Platform)框架中集成 Spring 框架,并利用 Spring-osgi 进行服务管理和依赖注入。RAP 是一个用于构建富客户端应用...
Web Application Bundle (WAB) 是一种特殊的OSGi Bundle,它可以作为一个Web应用运行。WAB包含传统的Web项目元素,如Web-INF目录和web.xml,同时还包含OSGi元数据,如MANIFEST.MF文件,使得它们能够作为OSGi模块运行...
是一本适合新接触OSGI开发学习的一本很好的书,本书介绍了Equinox, Spring-DM和Felix这三个常用的OSGi容器的使用、开发、以及WebApplication的开发部署;介绍了OSGi的规范和Core Framework和Layer。包含书中的用例源...
5. **Web Support**:Spring DM增加了对Web应用的支持,使得开发者可以更方便地在OSGi环境中部署和管理Web应用。 6. **Classpath Resource Abstraction**:引入了资源抽象层,使得开发者可以通过统一的方式访问类...
* Building modular services using OSGi with Spring DM and Spring Dynamic Modules and SpringSource dm Server. * Delivering web applications with Spring Web Flow, Spring MVC, Spring Portals, Struts, ...
### Eclipse RCP+Spring构建富客户端Web程序 #### 摘要 随着技术的发展和用户需求的变化,构建高效、响应迅速且用户体验良好的客户端应用变得尤为重要。传统的Web 2.0和丰富的互联网应用(RIA)虽然流行,但在某些...
运行嵌入式Apache Felix OSGI容器的示例Spring Boot Web应用程序 这个想法是能够: 加载运行嵌入式Felix Framework的基本Spring Boot App。 使用标准的注解(例如Spring Web控制器和ServletFilter等),使用普通...
手册涵盖了从环境搭建到应用程序部署的全过程,是一份不可多得的学习资料。 ### 核心知识点 #### 1. **Virgo Web Server(VWS)概述** - **定义与特性**:Virgo Web Server(VWS)是基于OSGi规范构建的,旨在...
Spring Factories是Osgi服务的实现,允许我们在不修改代码的情况下动态扩展应用。 总结起来,Spring Boot的核心在于它的自动配置和简洁的启动方式。`@SpringBootApplication`注解和`SpringApplication.run()`方法是...
One of the first (if not the first) books on the latest Spring 3.x, and the first Spring code Recipes book focused on Spring Web-tier development The Spring framework is growing. It has always been ...
- **Vaadin**: 支持 Vaadin 框架,这是一个基于 GWT 的 Web RIA(Rich Internet Application)框架。 - **Velocity**: 支持 Velocity 模板引擎。 #### 二、配置建议 - **选择适合自己的插件**: 根据项目需求和个人...
部署展开形式的web应用 使用Jetty进行开发 如何使用Jetty进行开发 如何编写Jetty中的Handlers 使用构建工具 如何在Maven中使用Jetty 如何在Ant中使用Jetty Maven和Ant的更多支持 Jetty Maven插件(Plugin) Jetty ...
- **嵌入H2到应用中**(Embedding H2 in an Application):文档将提供如何将H2数据库嵌入到Java应用程序中,并启动和使用H2控制台应用程序的详细步骤。 - **H2控制台应用程序**(The H2 Console Application):...
2.5版本的Spring提供了强大的依赖注入(DI)和面向切面编程(AOP)功能,以及对Web应用的全面支持,包括MVC控制器、视图解析器等,大大提升了应用的可测试性和可维护性。 ### Struts Struts框架分为两个主要版本:...
- **WEB-INF**:存放Spring的配置文件,如applicationContext.xml、applicationOSGI.xml、applicationSecurity.xml、dispatcher-servlet.xml和web.xml,分别处理Bean声明、OSGI服务引用、安全认证和Web配置。...
应用服务器为Java Web应用提供运行环境,包括但不限于以下几类: - **P1:主流应用服务器** - **Tomcat/JBOSS/Jetty/GlassFish**:广泛使用的应用服务器,适合不同规模的应用。 - **P2:高级应用服务器** - **SOA...
- WebService、SOA(Service-Oriented Architecture)、ESB(Enterprise Service Bus)、OSGI(Open Service Gateway Initiative)、EAI(Enterprise Application Integration)等架构概念。 - **面向资源架构** ...
12. **部署与发布**:对于Web应用,Eclipse可以连接到应用服务器(如Tomcat、Jetty),进行应用的部署和调试。 13. **Problems视图和Error Log视图**:显示项目中存在的问题和错误,便于定位和修复。 14. **...
常见的Java模块化框架有Spring Boot和OSGi,它们通过定义清晰的接口和依赖关系,使得模块间的交互更加有序。本项目可能采用了Spring Boot,它简化了Spring框架的配置,并集成了多种微服务组件,如数据访问、安全控制...