]]>cas server使用mysql数据库和oralce数据库的差异http://www.aygfsteel.com/tufanshu/archive/2011/01/26/343543.html雪地孤`雪地孤`Wed, 26 Jan 2011 01:05:00 GMThttp://www.aygfsteel.com/tufanshu/archive/2011/01/26/343543.htmlhttp://www.aygfsteel.com/tufanshu/comments/343543.htmlhttp://www.aygfsteel.com/tufanshu/archive/2011/01/26/343543.html#Feedback0http://www.aygfsteel.com/tufanshu/comments/commentRss/343543.htmlhttp://www.aygfsteel.com/tufanshu/services/trackbacks/343543.html
认证用户的sql语句在mysql下ؓQ?br />
select password from user_login where username=? and enabled=true
而在oracle下应该ؓ
select password from user_login where username=? and enabled=1
主要׃oralce和mysql对boolean字段的处理不一致导致的?br />
]]>cas server logout的问?/title>http://www.aygfsteel.com/tufanshu/archive/2011/01/21/343318.html雪地孤`雪地孤`Fri, 21 Jan 2011 05:38:00 GMThttp://www.aygfsteel.com/tufanshu/archive/2011/01/21/343318.htmlhttp://www.aygfsteel.com/tufanshu/comments/343318.htmlhttp://www.aygfsteel.com/tufanshu/archive/2011/01/21/343318.html#Feedback0http://www.aygfsteel.com/tufanshu/comments/commentRss/343318.htmlhttp://www.aygfsteel.com/tufanshu/services/trackbacks/343318.htmlcas server logout后,默认是停留在cas的退出页面,一般我们需要重新{向到客户端网站的d或是相关的页面,一般需要进行一下配|?/p>
<property name="authenticationHandlers">
<list>
<!--
| This is the authentication handler that authenticates services by means of callback via SSL, thereby validating
| a server side SSL certificate.
+-->
<bean class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
p:httpClient-ref="httpClient" />
<!--
| This is the authentication handler declaration that every CAS deployer will need to change before deploying CAS
| into production. The default SimpleTestUsernamePasswordAuthenticationHandler authenticates UsernamePasswordCredentials
| where the username equals the password. You will need to replace this with an AuthenticationHandler that implements your
| local authentication strategy. You might accomplish this by coding a new such handler and declaring
| edu.someschool.its.cas.MySpecialHandler here, or you might use one of the handlers provided in the adaptors modules.
+-->
<!--<bean class="org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler" />--> <bean class="org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler">
<property name="dataSource" ref="dataSource" /> <property name="sql" value="select password from userInfo where username=? and enabled=true" />
//用户密码~码方式
<property name="passwordEncoder"
ref="passwordEncoderBean"/>
</bean> </list>
</property>
]]>JForum ?SSO集成的问题解?/title>http://www.aygfsteel.com/tufanshu/archive/2008/06/26/210852.html雪地孤`雪地孤`Thu, 26 Jun 2008 08:54:00 GMThttp://www.aygfsteel.com/tufanshu/archive/2008/06/26/210852.htmlhttp://www.aygfsteel.com/tufanshu/comments/210852.htmlhttp://www.aygfsteel.com/tufanshu/archive/2008/06/26/210852.html#Feedback3http://www.aygfsteel.com/tufanshu/comments/commentRss/210852.htmlhttp://www.aygfsteel.com/tufanshu/services/trackbacks/210852.html
1.应用服务器:weblogic8.1
2.数据库:oracle10g
3.已有一个电子商务网站,需要和jforumq行单的集成Q提供ssoQ单点登录的功能Q?br />
4.说明Q已有的电子商务|站域名Qhttp://www.123.com jforum域名Qwww.123.com/forum,电子商务|站和jfroum在统一台服务器和同一应用服务器下Q如果分开可能会存在session或cookie讉K的问题?br />
5.JForum版本Q?.1.8
下面要的介绍一下用cookieq行jforum和电子商务网站的sso集成的过E:
(1)实现net.jforum.sso接口 public class CookieUserSSO implements SSO {
static final Logger logger = Logger.getLogger(CookieUserSSO.class.getName());
public String authenticateUser(RequestContext request) {
// login cookie set by my web LOGIN application
Cookie cookieNameUser = ControllerUtils.getCookie(SystemGlobals
.getValue(ConfigKeys.COOKIE_NAME_USER));
String username = null;
if (cookieNameUser != null) {
username = cookieNameUser.getValue();
}
logger.info("cookie username="+username);
System.out.println("cookie username="+username);
return username; // return username for jforum
// jforum will use this name to regist database or set in HttpSession
}
public boolean isSessionValid(UserSession userSession,
RequestContext request) {
Cookie cookieNameUser = ControllerUtils.getCookie(SystemGlobals
.getValue(ConfigKeys.COOKIE_NAME_USER)); // user cookie
String remoteUser = null;
if (remoteUser == null
&& userSession.getUserId() != SystemGlobals
.getIntValue(ConfigKeys.ANONYMOUS_USER_ID)) {
// user has since logged out
return false;
} else if (remoteUser != null
&& userSession.getUserId() == SystemGlobals
.getIntValue(ConfigKeys.ANONYMOUS_USER_ID)) {
// anonymous user has logged in
return false;
} else if (remoteUser != null
&& !remoteUser.equals(userSession.getUsername())) {
// not the same user (cookie and session)
return false;
}
return true; // myapp user and forum user the same. valid user.
}
]]>tomcat 服务器抛出socket异常“文件打开太多”的问题http://www.aygfsteel.com/tufanshu/archive/2006/07/31/60981.html雪地孤`雪地孤`Mon, 31 Jul 2006 03:39:00 GMThttp://www.aygfsteel.com/tufanshu/archive/2006/07/31/60981.htmlhttp://www.aygfsteel.com/tufanshu/comments/60981.htmlhttp://www.aygfsteel.com/tufanshu/archive/2006/07/31/60981.html#Feedback0http://www.aygfsteel.com/tufanshu/comments/commentRss/60981.htmlhttp://www.aygfsteel.com/tufanshu/services/trackbacks/60981.html 警告: Reinitializing ServerSocket 2006-7-28 15:07:40 org.apache.tomcat.util.net.PoolTcpEndpoint acceptSocket 严重: Endpoint ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport=80] ignored exception: java.net.SocketException: Too many open files java.net.SocketException: Too many open files at java.net.PlainSocketImpl.socketAccept(Native Method) at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384) at java.net.ServerSocket.implAccept(ServerSocket.java:450) at java.net.ServerSocket.accept(ServerSocket.java:421) at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:60) at org.apache.tomcat.util.net.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.java:407) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:70) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:595)
原本以ؓ是tomcat的配|或是应用本w的问题Q?h"一把后才发玎ͼ该问题的Ҏ原因是由于系l文件资源的限制D的。具体可以参?a >http://www.bea.com.cn/support_pattern/Too_Many_Open_Files_Pattern.html 的说明。具体的解决方式可以参考一下: 1。ulimit -a 查看pȝ目前资源限制的设定?br /> [root@test security]# umlimit -a -bash: umlimit: command not found [root@test security]# ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 7168 virtual memory (kbytes, -v) unlimited [root@test security]# 通过以上命oQ我们可以看到open files 的最大数?024 那么我们可以通过一下命令修改该参数的最大?br />2. ulimit -n 4096 [root@test security]# ulimit -n 4096 [root@test security]# ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 4096 pipe size (512 bytes, -p) 8 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 7168 virtual memory (kbytes, -v) unlimited
]]>jdk1.4升到JDK1.5的问?/title>http://www.aygfsteel.com/tufanshu/archive/2005/11/17/20309.html雪地孤`雪地孤`Thu, 17 Nov 2005 12:28:00 GMThttp://www.aygfsteel.com/tufanshu/archive/2005/11/17/20309.htmlhttp://www.aygfsteel.com/tufanshu/comments/20309.htmlhttp://www.aygfsteel.com/tufanshu/archive/2005/11/17/20309.html#Feedback3http://www.aygfsteel.com/tufanshu/comments/commentRss/20309.htmlhttp://www.aygfsteel.com/tufanshu/services/trackbacks/20309.html最q将手上的项?tomcat5.0+spring+struts)的jdk1.4升?.5的时?出现了一堆的问题,l过不懈的努力和|上朋友的提C终于将问题解决?现在记录如下 1.java.lang.UnsupportedClassVersionError: com/mdcchina/userinfo/logic/UserManager (Unsupported major.minor version 49.0)提示如上的错?很是郁闷 l过研究和比较在两个不同环境下的~译q行,l于发现q个主要是由于我的机子上安装了两个不同版本的JDKD?我想很多的朋友在试新的JDK的时?可能不会删除1.4的版?但是要注意的是要JAVA_HOME,CLASS_PATH,PATH{等的环境变量都修改成相关的JDK1.5的目录下面去,因ؓ1.5相对于以前的版本的变化比较大. 2.上面的问题排除后,在运行TOMCAT5.0时候由出现了如下的错误: 2005-11-17 19:38:47 StandardWrapperValve[action]: Servlet.service() for servlet action threw exception org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error: bad class file: C:\application\Java\jdk1.5.0\jre\lib\rt.jar(java/lang/Object.class) class file has wrong version 49.0, should be 48.0 Please remove or make sure it appears in the correct subdirectory of the classpath. public final class layout_005findex_jsp extends org.apache.jasper.runtime.HttpJspBase ^ 1 error