I had been using BlazeDS 3 on Sun Glassfish Enterprise Application Server V2.1.1 for a long time. At that time, I followed someone's guide and hacked TomcatValve.java. And then BlazeDS 3 will be fully supported on Glassfish V2.1.1, including authentication of course.
But for Glassfish V3, I cannot find any guide, and authentication failed for Glassfish V3.1.1. And then I downloaded the source code of Glassfish V3.1.1 and BlazeDS 4, after 1 day's debugging. I got the solution hacking TomcatValve again. If you don't want to know the detail, just download the jar file or java file. For java file you have to compile that by yourself in BlazeDS 4 open source project. And for jar file, put them into the following directory:
$glassfish_home/glassfish/lib/
If you want to know all the detail about this issue, you can read the article below.
What caused BlazeDS's TomcatValve failed to authenticate?
No method found for Realm.authenticate(String username, String password).
Why BlazeDS's TomcatValve doesn't work for Glassfish V3.1.1 Server?
Glassfish changed it's method signature to Realm.authenticate(String username, char[] password).
How to hack?
Simple replace the method invocation with the following code segment:
char[] passwordCharArray = password.toCharArray();
try {
Method m = realm.getClass().getMethod("authenticate",
String.class, char[].class);
principal = (Principal) m.invoke(realm, username,
passwordCharArray);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
More details.
Glassfish(Tomcat) Server will configure Web Module via following class and method:
WebModule.configureCatalinaProperties
/**
* Configure the <code>WebModule</code< properties.
* @param propName the property name
* @param propValue the property value
*/
protected void configureCatalinaProperties(String propName,
String propValue){
if (propName == null || propValue == null) {
logger.log(Level.WARNING,
"webcontainer.nullWebModuleProperty",
getName());
return;
}
if (propName.startsWith("valve_")) {
addValve(propValue);
} else if (propName.startsWith("listener_")) {
addCatalinaListener(propValue);
}
}
We can see, why we have to configure "<property name="valve_1" value="flex.messaging.security.TomcatValve"/>" into glassfish-web.xml,
分享到:
相关推荐
flex远程对象操作(简单对象到复杂对象) 服务器为glassfish 工作过程录制,语言为成都方言:),听不明白的只有光看了
工作录制,语言为成都方言 主要实际操作Flex远程对象实现
工作录制,语言为成都方言 主要实际操作Flex远程对象实现
工作录制,语言为成都方言 主要实际操作Flex远程对象实现
工作录制,语言为成都方言 主要实际操作Flex远程对象实现
blazeds4整合spring3 这是我新近研究的方法 与整合spring2.5以下的方法有不同了,(看过一些教程觉得不是很好,用起来不顺手) 最终参考了官方的sample,得到了这个不错的整合方法。 把要用blazeds公开给flex的java...
BlazeDS通信到Java的PureMVC——Flex框架,BlazeDS的服务器配置比较麻烦,这里使用的是直接下载blazeds_turnkey_3-0-0-544.zip中的tomcat BlazeDS模板路径为: blazeds_turnkey_3-0-0-544.zip解压后路径\tomcat\...
Blazeds4+spring3+mybatis集成
spring+blazeDS+flex4整合的例子,项目可以直接运行,jar包都齐全 模拟数据库返回的list 在页面上 输出
BlazeDS是一个基于服务器的Java远程调用(remoting)和Web消息传递(messaging)技术,使得后台的Java应用程序和运行在浏览器上的Flex应用程序能够相互通信。
blazeds.war blazeds
Flashbuilder4.5 BlazeDS4 Cairngrom3 Spring 实例教程
Flex4+J2EE+Blazeds配置jspweb工程
MyEclipse_8.5+flex_4+Blazeds配置 需要软件: apachetomcat.exe、 myeclipse-8.0.0-win32.exe、 jdk-6u12-windows-i586-p.exe、 blazeds-turnkey-4.0.0.14931.zip、 ...
Flex技术本身和Java就有很强的关联性,它提供了一个基于Eclipse的IDE和BlazeDS.BlazeDS是个基于服务端的Java远程调用和Web消息的一个开源的技术。有许多应用都是以Java为后端处理的。Flex用于前端。由于Java和Flex...
Spring BlazeDS Integration,Flex通过remoteObject与java通讯,附带例子 文档
包含blazeds.war blazeds-spring.war 以及解压后的blazeds,blazeds-spring文件夹, 可直接拷贝到javaee项目下的WebRoot文件夹下
BlazeDS入门:HTTP Service BlazeDS入门:HTTP Service BlazeDS入门:HTTP Service
Blazeds入门教程.doc
Flex4+Blazeds4.0+Spring3.0+hibernate2.5.2整合笔记,自己看了不少网上所说,都没配置成功,后来通过spring的一个插件搞定了,希望对大家有帮助吧!