gembin

OSGi JSF Eclipse RCP

 

我的评论

共2页: 1 2 下一页 
re: JSF1.2 +Spring2.0 +Hibernate3.2 gembin 2008-06-16 13:37  
java.lang.NoClassDefFoundError: org/apache/commons/digester/RuleSet

看样子是少commons-digester 包把
re: 精品Ajax图书下载 gembin 2008-06-13 19:50  
@王应天
我这没有源码
re: JSF1.2 +Spring2.0 +Hibernate3.2 gembin 2008-06-12 00:03  
<context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>client</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.SKIN</param-name>
<param-value>blueSky</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
<servlet-name>Faces Servlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<!--servlet>
<servlet-name>spring</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet-->
<!-- Faces Servlet -->
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>

<!-- Faces Servlet Mapping -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<application>
<variable-resolver>
org.springframework.web.jsf.DelegatingVariableResolver
</variable-resolver>
<!-- locale-config>
<default-locale>en</default-locale>
<supported-locale>en</supported-locale>
<supported-locale>es</supported-locale>
</locale-config>
<message-bundle>messages</message-bundle-->
</application>
re: JSF1.2 +Spring2.0 +Hibernate3.2 gembin 2008-06-11 23:56  
RichFaces3.2.0+Spring2.5.4 +Hibernate3.2 怎么配置

我的 BackingBean Setter方法里设的值总是 NULL
Spring 2.5+ hibernate3.0 不能部署到Tomcat中

如何集成Myfaces和OSGi!??
re: FCKeditor与JSF的整合 gembin 2008-05-28 23:05  
等到现在还没发给我。。。。。。。。。。。。 :(
@盼回复
http://127.0.0.1:4469/rap?startup=XXXX

Plugin.xml

<extension
point="org.eclipse.rap.ui.entrypoint">
<entrypoint
class="rap.Application"
parameter="XXXX"
id="rap.Application">
</entrypoint>
</extension>
re: 让OSGi支持JSF Web开发 gembin 2008-05-25 18:20  
给我发1份Demo,急需阿,十分感谢!!gembin@gmail.com
请问如何让JBoss的Ajax4JSF,RichFaces运行在OSGi 环境下
不会把,四川汶川阿,地球人都知道了
re: Web信息抽取技术纵览一 gembin 2008-05-15 22:49  
太理论了吧,有没实际点的。。。
Web容器中部署RAP
RAP的运行依赖于OSGI框架,而对于现有的JEE Web容器一般都不提供直接支持OSGI的能力。因此部署RAP的过程实际上相当与部署OSGI框架的过程。以下用Eclipse中集成的OSGI框架equinox为例介绍部署过程。

1. 首先需要下载equinox和servlet容器集成的工具包org.eclipse.equinox.servletbridge。可以通过eclipse的cvs站点(http://www.eclipse.org/equinox/server/downloads/servletbridge-anon.psf)下载这个项目集;
2. 针对RAP项目创建一个feature项目(过程同RCP);
3. 根据RAP项目的依赖创建feature项目的插件依赖;
为了让OSGI框架和RAP应用能在应用服务器中部署运行,必须包含如下插件依赖:
必须依赖插件

<plugin
id="org.eclipse.core.commands"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.core.contenttype"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.core.expressions"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.core.jobs"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.core.runtime"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.equinox.app"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.equinox.common"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.equinox.http.registry"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.equinox.http.servlet"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.equinox.http.servletbridge"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.equinox.preferences"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.equinox.registry"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.osgi"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.osgi.services"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.rap.jface"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.rap.rwt"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.rap.ui"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.rap.ui.workbench"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.eclipse.update.configurator"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

版本号必须设置为0.0.0以便于pde工具导出依赖插件的时候能够同步版本号。
4. 在feature项目得根目录创建script(存放构建脚本)文件夹和templates(存放标准Web应用格式文件)文件夹;
5. 在script文件夹下创建一个ant构建文件;
webappBuilder.xml

<?xml version="1.0"?>
<project name="project" default="default">
<description>
Example of a webapplication build script for RAP applications that use
the equinox servlet bridge to run in a servlet container.
</description>

<!-- =================================
target: init
================================= -->
<target name="init">
<property name="proj.dir" value="${basedir}/.." />
<!--
This script assumes that the servlet bridge project is available
in the current workspace. Note: The location is hardcoded and must be
adjusted to your needs.
-->
<property name="servletbridge.dir"
value="D:/RAP/eclipse/workspace/org.eclipse.equinox.servletbridge" />
<!--
On windows be cautious about long file names for ${build.dir}
These long path problems were resolved in JRE 1.5.0_08
-->
<property name="build.dir" value="${proj.dir}/build" />
<property name="templates.dir" value="${proj.dir}/templates" />
<property name="webapp.name" value="xwiki" />
<property name="features" value="rcp.feature" />
<!--
If you are using this script in a head-less build define the following properties:
"ignore.pdeExportFeatures" (available only in the IDE - do the feature export with PDE Build)
"ignore.servletbridge.jar" (if you're compiling or extracting the jar yourself)
-->
</target>

<!-- =================================
target: prepare
================================= -->
<target name="prepare" depends="init">
<delete dir="${build.dir}/${webapp.name}" />
<mkdir dir="${build.dir}/${webapp.name}/WEB-INF/lib" />
</target>

<!-- =================================
target: default
================================= -->
<target name="default"
depends="copyResources, servletbridge.jar, pdeExportFeatures" />

<!-- =================================
target: copyResources
================================= -->
<target name="copyResources" depends="prepare">
<copy todir="${build.dir}/${webapp.name}">
<fileset dir="${templates.dir}" />
</copy>
</target>

<!-- =================================
target: servletbridge.jar
================================= -->
<target name="servletbridge.jar"
depends="prepare"
unless="ignore.servletbridge.jar">
<antcall target="jar-servletbridge.jar" />
<antcall target="copy-servletbridge.jar" />
</target>

<!-- =================================
target: copy-servletbridge.jar
================================= -->
<target name="copy-servletbridge.jar" if="servletbridge.jar-present">
<copy todir="${build.dir}/${webapp.name}/WEB-INF/lib">
<fileset file="${servletbridge.dir}/servletbridge.jar" />
</copy>
</target>

<!-- =================================
target: jar-servletbridge.jar
================================= -->
<target name="jar-servletbridge.jar" unless="servletbridge.jar-present">
<jar destfile="${build.dir}/${webapp.name}/WEB-INF/lib/servletbridge.jar">
<fileset dir="${servletbridge.dir}/bin">
<include name="**/*.class" />
</fileset>
</jar>
</target>

<!-- =================================
target: pdeExportFeatures
================================= -->
<target name="pdeExportFeatures"
depends="prepare"
unless="ignore.pdeExportFeatures">
<!--
Features get built asynchronously but this approach is sometimes convenient.
So that the pde.exportFeatures task is available in the IDE select
"Run in the same JRE as the workspace" from the JRE tab from "Run Ant.."
-->
<pde.exportFeatures features="${features}"
destination="${build.dir}/${webapp.name}/WEB-INF/eclipse"
exportType="directory"
useJARFormat="true"
exportSource="false" />
</target>
</project>

6. 在templates文件夹下创建如下文件结构;

WEB-INF
|--eclipse
| |--configuration
| | |--config.ini
| |--launch.ini
|--web.xml

launch.ini

# Eclipse Runtime Configuration Overrides
# These properties are loaded prior to starting the framework and can also be used to override System Properties
# @null is a special value used to override and clear the framework's copy of a System Property prior to starting the framework
# "*" can be used together with @null to clear System Properties that match a prefix name.

osgi.*=@null
org.osgi.*=@null
eclipse.*=@null

osgi.parentClassloader=app
osgi.contextClassLoaderParent=app

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app id="WebApp">
<servlet id="bridge">
<servlet-name>equinoxbridgeservlet</servlet-name>
<display-name>Equinox Bridge Servlet</display-name>
<description>Equinox Bridge Servlet</description>
<servlet-class>org.eclipse.equinox.servletbridge.BridgeServlet</servlet-class>
<init-param>
<param-name>commandline</param-name>
<param-value>-console</param-value>
</init-param>
<init-param>
<param-name>enableFrameworkControls</param-name>
<param-value>true</param-value>
</init-param>
<!--
org.eclipse.equinox.servletbridge and the Servlet API are exported automatically to the underlying OSGi framework.
The extendedFrameworkExports parameter allows the specification of additional java package exports.
The format is a comma separated list of exports as specified by the "Export-Package" bundle manifest header.
For example: com.mycompany.exports; version=1.0.0, com.mycompany.otherexports; version=1.0.0
-->
<init-param>
<param-name>extendedFrameworkExports</param-name>
<param-value></param-value>
</init-param>

<!--
You can specify your own framework launcher here.
The default is: org.eclipse.equinox.servletbridge.FrameworkLauncher
<init-param>
<param-name>frameworkLauncherClass</param-name>
<param-value>org.eclipse.equinox.servletbridge.FrameworkLauncher</param-value>
</init-param>
-->
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>equinoxbridgeservlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<!--
This is required if your application bundles expose JSPs.
-->
<servlet-mapping>
<servlet-name>equinoxbridgeservlet</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
</web-app>

7. 用ant执行script下的构建脚本;


再用Ant执行脚本的时候,应当把JRE标签下的"Run in the same JRE as the workspace"选中,否则PDE工具可能无法导出依赖插件。
8. 编辑configration目录下的config.ini文件,根据项目需要设定bundles,可用如下程序生成后拷贝到config.ini文件中。
ConfigIniCreator.java

/*******************************************************************************
* Copyright (c) 2002-2006 Innoopract Informationssysteme GmbH.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Innoopract Informationssysteme GmbH - initial API and implementation
******************************************************************************/

package org.eclipse.rap.tools;

import java.io.File;


/**
* <p>This tool creates the content of a simple config.ini file.
* Run this after the ANT build scripts (webappBuilder.xml and the
* pde.exportFeatures) have finished. After that replace the content
* of the config.ini file in the build.</p>
*
* <p>Note: this is not meant to be a high end deployment tool or the only
* possibility of how the content of your config.ini should look like if you
* are creating a RAP WAR. This should simplify the task to get
* a minimalistic runtime configuration that works...</p>
*/
public class ConfigIniCreator {

public static void main( final String[] arx ) {
////////////////////////////////////////////////////////////////////////////
// replace this with the absolute path to the plugin directory of
// the deployment build for example
// File file = new File( "C:\\projects\\org.eclipse.rap\\org.eclipse.rap.demo.feature\\build\\rapdemo\\WEB-INF\\eclipse\\plugins" );
File file = new File( "D:\\RAP\\eclipse\\workspace\\rcp.feature\\build\\xwiki\\WEB-INF\\eclipse\\plugins" );
////////////////////////////////////////////////////////////////////////////

String[] list = file.list();
StringBuffer buffer = new StringBuffer();
buffer.append( "#Eclipse Runtime Configuration File\n" );

buffer.append( "osgi.bundles=" );
for( int i = 0; i < list.length; i++ ) {
if( list[ i ].endsWith( ".jar" )
&& !list[ i ].startsWith( "org.eclipse.osgi_" ) )
{
buffer.append( list[ i ] );
if( list[ i ].startsWith( "org.eclipse.equinox.common_" ) ) {
buffer.append( "@2:start" );
} else {
buffer.append( "@start" );
}
if( i + 1 < list.length ) {
buffer.append( "," );
}
}
}
buffer.append( "\n" );
buffer.append( "osgi.bundles.defaultStartLevel=4\n" );

// write the content to the console
System.out.print( buffer );
}
}

在控制台上可看到类似信息:
config.ini

#Eclipse Runtime Configuration File
osgi.bundles=org.eclipse.core.commands_3.3.0.I20070605-0010.jar@start,
org.eclipse.core.contenttype_3.2.100.v20070319.jar@start,
org.eclipse.core.expressions_3.3.0.v20070606-0010.jar@start,
org.eclipse.core.jobs_3.3.0.v20070423.jar@start,
org.eclipse.core.runtime_3.3.100.v20070530.jar@start,
org.eclipse.equinox.app_1.0.0.v20070606.jar@start,
org.eclipse.equinox.common_3.3.0.v20070426.jar@2:start,
org.eclipse.equinox.http.registry_1.0.0.jar@start,
org.eclipse.equinox.http.servletbridge_1.0.0.jar@start,
org.eclipse.equinox.http.servlet_1.0.0.jar@start,
org.eclipse.equinox.preferences_3.2.100.v20070522.jar@start,
org.eclipse.equinox.registry_3.3.0.v20070522.jar@start,
org.eclipse.osgi.services_3.1.200.v20070605.jar@start,
org.eclipse.rap.jface_1.0.0.jar@start,
org.eclipse.rap.rwt_1.0.0.jar@start,
org.eclipse.rap.ui.workbench_1.0.0.jar@start,
org.eclipse.rap.ui_1.0.0.jar@start,
org.eclipse.update.configurator_1.0.0.jar@start,
rcp_1.0.0.jar@start
osgi.bundles.defaultStartLevel=4

9. 构建完成,打包应用(用jar命令归档为一个war文件);
10. 拷贝到Web容器相应的Web应用目录下,或采用Web服务器的部署工具部署。
re: 精品Ajax图书下载 gembin 2008-05-12 14:20  
@kerry
无法到达以下收件人:
kerrywu.tw@yahoo.com.tw,时间为 5/12/2008 1:44 PM
电子邮件系统无法传递此邮件,但未报告具体原因。请检查邮件地址,然后重新发送。如果再次失败,请与系统管理员联系。
< host mx1.mail.tw.yahoo.com[203.188.197.9] said: 554 delivery error: dd Sorry your message to kerrywu.tw@yahoo.com.tw cannot be delivered because it is too large. - mta186.mail.tp2.yahoo.com (in reply to end of DATA command)>

请确认Yahoo的邮箱能否接收11MB的收件。。。。。
re: 精品Ajax图书下载 gembin 2008-05-12 13:35  
@thinkfree
具体要哪本,太大了不好发几百MB呢,需要哪个发哪个把
re: OSGi Bundle Repository(OBR) gembin 2008-05-08 22:06  
OSGi 的Deployment Admin 怎么用?

用的是FELIX的Impl

FileInputStream in= new FileInputStream(bundleLocation);
DeploymentPackage dPackage=deployAdmin.installDeploymentPackage(in);

却得到各DeploymentException ERROR CODE=451 (Missing mandatory manifest header)

但是直接在Console Install 这个Bundle 没任何错误。

不知道怎么回事


re: IBM 将大力推动Eclipse RCP gembin 2008-05-08 21:49  
支持RCP
恩 看上去不错啊!
re: 中国移动飞信 gembin 2008-05-06 00:43  
光发短信应该是免费的吧
re: 精品Ajax图书下载 gembin 2008-05-05 10:54  
@王天桂
已发送
re: 精品Ajax图书下载 gembin 2008-04-28 17:14  
@笨笨 @涟漪
已发送

是啊,把Eclipse的界面风格以及其扩展性用在Web上了。原来做桌面开发的人也可以快速上手做Web开发了~~还可以很方便定制界面风格。
尝试了一下真的不错,有时间得好好研究1下。
Document doc = db.parse(ConfigFactoryImplTest.class.getResource("") + "boss-connector-service.xml");

改成这样不就行了

Document doc = db.parse(ConfigFactoryImplTest.class.getResource("boss-connector-service.xml") );
re: 精品Ajax图书下载 gembin 2008-04-07 11:37  
已经发了几本给sccn.sq@gmail.com ,wyz_java@163.com,jackcao1985@gmail.com ,mljmalongjiang@163.com 了
re: 精品Ajax图书下载 gembin 2008-04-07 11:36  
不知道怎么传,QQ超大附件也慢。

哪位大哥有FTP。。。。呵呵 资源共享
re: JSF深入--控制跳转 gembin 2008-04-01 18:05  
关注JSF
re: 精品Ajax图书下载 gembin 2008-04-01 16:33  
先整理1下,在发。
现在上面所有的书,未压缩时:大概350MB
re: 《SOA Using Java Web Services》 gembin 2008-04-01 16:28  
@Robin's Java World
OK,弄好了。。。
re: 精品外文Ajax图书 gembin 2008-03-31 18:45  
这些1起 有>100MB 先给你发几个小的
re: 用SWT实现MSN风格的下拉框 gembin 2008-03-26 19:14  
Good!!!!!!!!!
re: Infragistics的JSF组件 gembin 2008-03-12 13:43  
有IBM JSF extension的源码吗?
re: Strategy(策略)模式 gembin 2008-03-12 10:43  
请问这个UML图用什么画的
不是原创吧
照上面的代码我运行之后,为什么有如下错误
SEVERE: Exception in PhaseListener RESTORE_VIEW(1) afterPhase
java.lang.NullPointerException: No component found under specified client id: j_id_jsp_1270516925_2
at com.sterning.jsf.ajax.AjaxListener.handleAjaxRequest(AjaxListener.java:60)
at com.sterning.jsf.ajax.AjaxListener.afterPhase(AjaxListener.java:42)
我晕,怎么贴的都是书的目录和一些....信息
给人感觉像卖书的
re: Eclipse精粹学习笔记 gembin 2008-03-05 16:47  
Eclipse精粹学习笔记 ?

题目和内容不太吻合把
把书的目录贴出来干嘛
re: 学习Eclipse NLS gembin 2008-03-05 11:57  
是可以的。请看如下例子:
message.properties
------------------
key_1=Say {0} hello to {1} !!
key_2=Say {0} hello to {1} !!
key3=Say {0} hello to {1} !!
key4=Say {0} hello to {1} !!

TobeBindedMsg.java
---------------------
public class TobeBindedMsg {
public static String key3;

static class InnerMsg{
public static String key4;
}
}

TestNLS.java
------------------
import org.eclipse.osgi.util.NLS;
public class TestNLS {
private static final String BUNDLE_NAME = "com.meccala.blog.util.message"; //$NON-NLS-1$
public static String key_2;
static {
NLS.initializeMessages(BUNDLE_NAME, TestNLS.class);
NLS.initializeMessages(BUNDLE_NAME, Inner.class);
NLS.initializeMessages(BUNDLE_NAME, TobeBindedMsg.class);
NLS.initializeMessages(BUNDLE_NAME, TobeBindedMsg.InnerMsg.class);
}

static class Inner {
public static String key_1;
}

public static void main(String ggg[]) {
String s = NLS.bind(Inner.key_1, "1", "gembin");
System.out.println(s);
String s1 = NLS.bind(TestNLS.key_2, "2", "gembin");
System.out.println(s1);
String s2 = NLS.bind(TobeBindedMsg.key3, "3", "gembin");
System.out.println(s2);
String s3 = NLS.bind(TobeBindedMsg.InnerMsg.key4, "4", "gembin");
System.out.println(s3);
}
}



最后的输出:
Say 1 hello to gembin !!
Say 2 hello to gembin !!
Say 3 hello to gembin !!
Say 4 hello to gembin !!
NOTE:因为Key要求是public static 的所以Inner Class必需是static
re: JAVA网页浏览器 gembin 2008-02-29 16:12  
Eclipse RCP 不错!
re: FCKeditor与JSF的整合 gembin 2008-02-26 16:06  
gembin@gmail.com
强烈需要源码阿,谢谢!!!!!!!!!!!!!!!!!!!!!
re: AjaxFaces 1.0 released gembin 2008-02-24 21:40  
网页打不开阿,博主能发给我吗,谢谢
re: 学习Eclipse NLS gembin 2008-01-26 15:31  
Eclipse SRC里的: No need Localized String 1
可代替ResourceBundle,用来处理资源文件*.properties,效率更好,更方便,很好的扩展性。
当有Key没定义,会get a compile error.
缺点是:必须维护2个文件1个Properties和1个Java文件,他们必须同步
re: 关于服务端生成js的构思 gembin 2008-01-02 18:46  
如何动态生成JS并在客户端加载?

似乎第一次加载时往往有些JS不能被加载
re: Java Annotation手册 gembin 2007-12-29 17:45  
good
什么是微内核概念??
GGGGGGGGGGG
请点击这里下载本文的Eclipse工程]

无法下载+!

如何下载?

Gembin@gmail.com
gembin@gmail.com
就这么点。。。。。。早就知道了
WorkbenchWindow ww = (WorkbenchWindow) Activator.getDefault().getWorkbench().getActiveWorkbenchWindow();


不行,没有这个方法getWorkbench().
共2页: 1 2 下一页 

导航

统计

常用链接

留言簿(2)

随笔分类(176)

随笔档案(173)

文章档案(1)

新闻档案(1)

相册

收藏夹(1)

Favorite Links

最新随笔

搜索

积分与排名

最新评论

阅读排行榜

评论排行榜

60天内阅读排行