启动服务的时候总是出现这个提示Redirecting to /bin/systemctl start httpd.service

我的系统是fedora20,启动服务(service httpd start)的时候总是会显示以下的错误Redirecting to /bin/systemctl start httpd.service,在网上查了一些资料,照着去做,修改了主机名,也关掉了selinux和检查了iptables,但是还是不行,希望了解这方面知识的您可以给出一些可行的建议,谢谢。

2个回答

这个是新版本. 按照提示的命令执行 (/bin/systemctl start httpd.service)

ouwen001
ouwen001 回复ouwen001: service nginx start 这是我输入的命令
一年多之前 回复
ouwen001
ouwen001 感谢大神指出的问题, 能不能再弱弱的请教一下大神, 新的命令要怎么输入丫
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
阿里云 centos7 mysql服务无法停止,提示Failed to stop mysqld.service: Unit mysqld.service not loaded.
很久没管过的一台服务器,现在想要升级做个备份,结果无法停止mysql了..... 目前在这台服务器上跑的网站一切都正常 service mysqld stop 提示: Redirecting to /bin/systemctl stop mysqld.service Failed to stop mysqld.service: Unit mysqld.service not loaded. 搜遍了网络也没同样问题的,求大神解答,万分感谢
centos7下启动mysql5.7不产生日志,启动失败
只有这个提示,请各位大神帮帮忙 Redirecting to /bin/systemctl start mysqld.service Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.
linux tomcat 启动不了
[root@iZ4u0uks68thxyZ ~]# service tomcat start Redirecting to /bin/systemctl start tomcat.service Failed to start tomcat.service: Unit not found. 怎么解决
在linux下启动openvpn是报错
报错如下 [root@iz2zedvir4lnvq8zgseoa3z bin]# service openvpn start Redirecting to /bin/systemctl start openvpn.service Failed to start openvpn.service: Unit not found. 求大神解惑
service vncserver start
[root@localhost home]# cd .. [root@localhost /]# cd .. [root@localhost /]# vi /etc/sysconfig/vncservers [root@localhost /]# su dark [dark@localhost /]$ vnc passwd bash: vnc: 未找到命令... [dark@localhost /]$ vncpasswd Password: Verify: [dark@localhost /]$ exit exit [root@localhost /]# service vncserver start Redirecting to /bin/systemctl start vncserver.service Failed to issue method call: Unit vncserver.service failed to load: No such file or directory. 不明白为什么启动失败
fedora下安装mysql无法运行,缺少mysql.sock
系统以前可能安装过mysql,后来卸载了,也可能没安装过mysql。 总之在我安装之前用 rpm -qa|grep mysql查看,有mysql-libs和mysql-server两个。 我删掉这两个后,用yum -y install mysql && yum -y install mysql-server。安装,运行不了。 一下是我现在系统中的状态 ``` [root@s1 dsz]# rpm -qa|grep mysql mysql-server-5.5.29-1.fc16.i686 mysql-5.5.29-1.fc16.i686 mysql-libs-5.5.29-1.fc16.i686 mysql-devel-5.5.29-1.fc16.i686 [root@s1 dsz]# ps -ef|grep mysqld root 1923 1855 0 14:57 pts/0 00:00:00 grep --color=auto mysqld [root@s1 dsz]# ps -aux|grep mysql Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ root 1931 0.0 0.0 6304 808 pts/0 S+ 14:58 0:00 grep --color=auto mysql [root@s1 dsz]# rpm -ql mysql /usr/bin/msql2mysql /usr/bin/my_print_defaults /usr/bin/mysql /usr/bin/mysql_config /usr/bin/mysql_find_rows /usr/bin/mysql_waitpid /usr/bin/mysqlaccess /usr/bin/mysqladmin /usr/bin/mysqlbinlog /usr/bin/mysqlcheck /usr/bin/mysqldump /usr/bin/mysqlimport /usr/bin/mysqlshow /usr/bin/mysqlslap /usr/lib/mysql/mysql_config /usr/share/doc/mysql-5.5.29 /usr/share/doc/mysql-5.5.29/COPYING /usr/share/doc/mysql-5.5.29/README /usr/share/doc/mysql-5.5.29/README.mysql-docs /usr/share/doc/mysql-5.5.29/README.mysql-license /usr/share/man/man1/my_print_defaults.1.gz /usr/share/man/man1/mysql.1.gz /usr/share/man/man1/mysql_config.1.gz /usr/share/man/man1/mysql_find_rows.1.gz /usr/share/man/man1/mysql_waitpid.1.gz /usr/share/man/man1/mysqlaccess.1.gz /usr/share/man/man1/mysqladmin.1.gz /usr/share/man/man1/mysqldump.1.gz /usr/share/man/man1/mysqlshow.1.gz /usr/share/man/man1/mysqlslap.1.gz [root@s1 dsz]# /etc/init.d/mysql start bash: /etc/init.d/mysql: 没有那个文件或目录 [root@s1 dsz]# mysqladmin start mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists! [root@s1 dsz]# rpm -qa mysql mysql-5.5.29-1.fc16.i686 [root@s1 dsz]# service mysqld status Redirecting to /bin/systemctl status mysqld.service mysqld.service - MySQL database server Loaded: loaded (/lib/systemd/system/mysqld.service; disabled) Active: inactive (dead) CGroup: name=systemd:/system/mysqld.service [root@s1 dsz]# service mysqld start Redirecting to /bin/systemctl start mysqld.service Job failed. See system logs and 'systemctl status' for details. ```
linux部署RabbitMQ,启动报错。
Redirecting to /bin/systemctl start rabbitmq-server.service Job for rabbitmq-server.service failed because the control process exited with error code. See "systemctl status rabbitmq-server.service" and "journalctl -xe" for details. [root@ecs-c05b 15260846833]# /sbin/service rabbitmq-server status Redirecting to /bin/systemctl status rabbitmq-server.service ● rabbitmq-server.service - RabbitMQ broker Loaded: loaded (/usr/lib/systemd/system/rabbitmq-server.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Tue 2018-07-17 17:39:19 CST; 30s ago Process: 45226 ExecStop=/usr/sbin/rabbitmqctl stop (code=exited, status=0/SUCCESS) Process: 36903 ExecStart=/usr/sbin/rabbitmq-server (code=exited, status=1/FAILURE) Main PID: 36903 (code=exited, status=1/FAILURE) Jul 17 17:39:19 ecs-c05b.novalocal rabbitmqctl[45226]: /usr/lib/rabbitmq/bin/rabbitmq-env: line 34: /dev/null: Permission denied Jul 17 17:39:19 ecs-c05b.novalocal rabbitmqctl[45226]: Stopping and halting node 'rabbit@ecs-c05b' ... Jul 17 17:39:19 ecs-c05b.novalocal rabbitmqctl[45226]: Error: unable to connect to node 'rabbit@ecs-c05b': nodedown Jul 17 17:39:19 ecs-c05b.novalocal rabbitmqctl[45226]: DIAGNOSTICS Jul 17 17:39:19 ecs-c05b.novalocal rabbitmqctl[45226]: =========== Jul 17 17:39:19 ecs-c05b.novalocal rabbitmqctl[45226]: attempted to contact: ['rabbit@ecs-c05b'] Jul 17 17:39:19 ecs-c05b.novalocal rabbitmqctl[45226]: rabbit@ecs-c05b: Jul 17 17:39:19 ecs-c05b.novalocal systemd[1]: Failed to start RabbitMQ broker. Jul 17 17:39:19 ecs-c05b.novalocal systemd[1]: Unit rabbitmq-server.service entered failed state. Jul 17 17:39:19 ecs-c05b.novalocal systemd[1]: rabbitmq-server.service failed.
【java调试】jconsole远程连接超时(连不上)
阿里云的centos服务器 上面运行了一个java进程,jsp得到的是:7768 本地打开jconsole地址写:106.14.224.11:7768 然后账户密码 显示连接超时 ping 可以通 远程机器hosts设置 ``` 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 106.14.224.11 master.hadoop ``` 远程机器hostname命令 [root@master ~]# hostname master.hadoop 远程机器hostname -i命令 [root@master ~]# hostname -i 106.14.224.11 远程机器查看防火墙状态命令 [root@master ~]# service iptables status Redirecting to /bin/systemctl status iptables.service Unit iptables.service could not be found. 求解,打开jconsole连接,不是白屏,就是连接超时
小弟初来乍到。。。刚刚接触cenots,想安装mysql,但是安装完成之后报错。。求大神指点迷津
[root@localhost etc]# rpm -qa | grep mysql mysql-community-embedded-5.7.19-1.el7.x86_64 mysql-community-client-5.7.19-1.el7.x86_64 mysql-community-libs-5.7.19-1.el7.x86_64 mysql-community-minimal-debuginfo-5.7.19-1.el7.x86_64 mysql-community-embedded-devel-5.7.19-1.el7.x86_64 mysql-community-common-5.7.19-1.el7.x86_64 mysql-community-devel-5.7.19-1.el7.x86_64 mysql-community-embedded-compat-5.7.19-1.el7.x86_64 mysql-community-server-5.7.19-1.el7.x86_64 mysql-community-libs-compat-5.7.19-1.el7.x86_64 这个意思应该安装成功了吧,但是我用server mysql start启动时,提示Redirecting to /bin/systemctl start mysql.service Failed to issue method call: Unit mysql.service failed to load: No such file or directory. 百度了好久解决方法都没有成功。。。。求指点(本人刚接触linux,很多不懂,有说的不好的地方希望各位大神包含)
cygwin下mysql启动不了
[b]环境安装:[/b] 安装cygwin 安装并编译 MySQL 标准源代码包  在这个页面的最下面 Source (tar.gz)  把这个tar包解到一个Cygwin下一个mysql文件夹: [code="java"]./configure make install[/code] 安装 Ruby Gems 下载 Gems  然后解压缩,在执行 [code="java"]ruby setup.rb[/code] 安装 Rails  执行 [code="java"]gem install rails --include-dependencies[/code] 安装 rails. 安装 MySQL Gem  执行 [code="java"]gem install mysql[/code]  当提示选择的时候,选择了最新的Ruby 版本(没有linux) 运行[code="java"]ruby script/about[/code] [img]http://www.iteye.com/upload/attachment/95648/807fc9e1-c026-3243-9dbd-20546b0c53b7.gif[/img] [b]问题是:[/b] 启动mysql时: [code="java"]/usr/local/mysql/bin/mysqld_safe &[/code] 出现错误: [code="java"]$ nohup: ignoring input and redirecting stderr to stdout chown: invalid user: `mysql' Starting mysqld daemon with databases from /usr/local/var STOPPING server from pid file /usr/local/var/zhongguo-f06c36.pid 090419 23:35:08 mysqld ended[/code] 尝试安装驱动:mysql-ruby-2.8.1.tar.gz没有任何效果。 google一下,发现网上有类似错误 [code="java"]$ nohup: ignoring input and redirecting stderr to stdout Starting mysqld daemon with databases from /var/lib/mysql STOPPING server from pid file /var/run/mysqld/mysqld.pid 071112 00:22:06 mysqld ended [/code] 模仿他的解决方法,在/usr/local/var目录下,新建了zhongguo-f06c36.pid,再执行 [code="java"]/usr/local/mysql/bin/mysqld_safe &[/code] 错误依旧,新建的pid文件也自动消失了。 这对你们高手这应该是个弱智的问题,可我为了这个问题弄了三天了,一点进展都没有,请不吝帮我一下,不胜感激! [b]问题补充:[/b] 执行: [code="java"]mysqld_safe --user=mysql & [/code] 还是一样的错误呀.. [b]问题补充:[/b] 经理要求在windows Cygwin下从源码编译安装mysql,俺也想直接安装mysql ):
mesos和marathon搭配使用,marathon无法启动
下面是版本信息: mesos version : mesos-0.25.0-0.2.70.centos701406.x86_64 marathon version : marathon-0.11.1-1.0.432.el7.x86_64 chronos version : chronos-2.4.0-0.1.20151007110204.el7.x86_64 zookeeper version: mesosphere-zookeeper-3.4.6-0.1.20141204175332.centos7.x86_64 我通过下面命令在 Centos7上装了mesos,zookeeper,marathon等. sudo rpm -Uvh http://repos.mesosphere.io/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm sudo yum install mesos marathon chronos mesosphere-zookeeper 我配置了2个master, ip分别是192.168.253.129 and 192.168.253.130.我也在 [/etc/marathon/conf]目录下创建了master,zk,hostname文件.下面是这3个文件的详情 1.master>>zk://192.168.253.129:2181,192.168.253.130:2181/mesos 2.zk>>zk://192.168.253.129:2181,192.168.253.130:2181/marathon 3.hostname>>192.168.253.129 启动mesoso-master服务之后,我可以访问 url [http://192.168.253.129:5050] and http://192.168.253.130:5050,并且看到leader master被成功选举出来. 但是却无法打开marathon的url[http://192.168.253.129:8080]。 下面是我 [service marathon status -l] 我查看marathon的状态 +++++++++++++++++++++++++++++++++++++++++++++++++++++#localhost]# service marathon status -l Redirecting to /bin/systemctl status -l marathon.service marathon.service - Marathon Loaded: loaded (/usr/lib/systemd/system/marathon.service; enabled) Active: activating (auto-restart) (Result: exit-code) since Sun 2015-10-25 03:03:44 PDT; 1s ago Process: 6777 ExecStart=/usr/bin/marathon (code=exited, status=1/FAILURE) Main PID: 6777 (code=exited, status=1/FAILURE) Oct 25 03:03:44 develop-mesos-master1 #localhost.localdomain systemd[1]: marathon.service: main process exited, code=exited, status=1/FAILURE Oct 25 03:03:44 develop-mesos-master1 #localhost.localdomain systemd[1]: Unit marathon.service entered failed state. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 下面是我用命令 [journalctl -o verbose _PID=6777] 查看marathon进程的详细信息。 +++++++++++++++++++++++++++++++++++++++++++++++++++++ #localhost conf]# journalctl -o verbose _PID=6777 -- Logs begin at Sun 2015-10-25 02:48:41 PDT, end at Sun 2015-10-25 03:18:55 PDT. -- Sun 2015-10-25 03:03:44.168930 PDT [s=5827ad02b7164cdeb1947da2c9a80cc6;i=208c;b=8cdffcc7c1c849b887266e94d8cbe621;m=36175ff3;t=522eaf5bed3e2; PRIORITY=6 _UID=0 _GID=0 _SYSTEMD_SLICE=system.slice _BOOT_ID=8cdffcc7c1c849b887266e94d8cbe621 _MACHINE_ID=e485efeafe934ce99407be78a4ed3aac SYSLOG_FACILITY=3 _CAP_EFFECTIVE=1fffffffff _TRANSPORT=stdout _EXE=/usr/bin/bash _HOSTNAME=develop-mesos-master1 #localhost.localdomain SYSLOG_IDENTIFIER=marathon MESSAGE=run_jar --master zk://192.168.253.129:2181,192.168.253.130:2181/mesos --zk zk://192.168.253.129:2181,192.168.253.130:2181/marath _COMM=marathon _CMDLINE=/bin/bash /usr/bin/marathon _SYSTEMD_CGROUP=/system.slice/marathon.service _SYSTEMD_UNIT=marathon.service _PID=6777 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 有高手能给解答一下吗?
第三方登陆认证功能该怎么做?
以微软官网的向web应用加入Microsoft账号登陆功能为例 [向 ASP.NET Web 应用添加 Microsoft 登录功能](https://docs.microsoft.com/zh-cn/azure/active-directory/develop/tutorial-v2-asp-webapp#register-your-application "") 本人想做一个另外的第三方账号登陆功能, 我的Startup类: ``` public class Startup { // The Client ID is used by the application to uniquely identify itself to Azure AD. //已在webconfig文件替换 string clientId = System.Configuration.ConfigurationManager.AppSettings["ClientId"];//"d3c8b5dc-81db-48e7-b0ca-cd3c081c9287";// // RedirectUri is the URL where the user will be redirected to after they sign in. string redirectUri = System.Configuration.ConfigurationManager.AppSettings["RedirectUri"]; // Tenant is the tenant ID (e.g. contoso.onmicrosoft.com, or 'common' for multi-tenant) //我不需要这个 //static string tenant = System.Configuration.ConfigurationManager.AppSettings["Tenant"]; // Authority is the URL for authority, composed by Microsoft identity platform endpoint and the tenant name (e.g. https://login.microsoftonline.com/contoso.onmicrosoft.com/v2.0) //微软官网登陆网址 //string authority = String.Format(System.Globalization.CultureInfo.InvariantCulture, System.Configuration.ConfigurationManager.AppSettings["Authority"], tenant);//"https://auth-pre.landlog.info/connect/authorize";// //我的第三方登陆网址 string authority = "https://auth-pre.landlog.info/connect/authorize"; /// <summary> /// Configure OWIN to use OpenIdConnect /// </summary> /// <param name="app"></param> public void Configuration(IAppBuilder app) { app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType); app.UseCookieAuthentication(new CookieAuthenticationOptions()); app.UseOpenIdConnectAuthentication( new OpenIdConnectAuthenticationOptions { // Sets the ClientId, authority, RedirectUri as obtained from web.config ClientId = clientId, Authority = authority, RedirectUri = redirectUri, // PostLogoutRedirectUri is the page that users will be redirected to after sign-out. In this case, it is using the home page PostLogoutRedirectUri = redirectUri, Scope = OpenIdConnectScope.OpenIdProfile, // ResponseType is set to request the id_token - which contains basic information about the signed-in user ResponseType = OpenIdConnectResponseType.IdToken, // ValidateIssuer set to false to allow personal and work accounts from any organization to sign in to your application // To only allow users from a single organizations, set ValidateIssuer to true and 'tenant' setting in web.config to the tenant name // To allow users from only a list of specific organizations, set ValidateIssuer to true and use ValidIssuers parameter TokenValidationParameters = new TokenValidationParameters() { ValidateIssuer = false }, // OpenIdConnectAuthenticationNotifications configures OWIN to send notification of failed authentications to OnAuthenticationFailed method Notifications = new OpenIdConnectAuthenticationNotifications { AuthenticationFailed = OnAuthenticationFailed } } ); } /// <summary> /// Handle failed authentication requests by redirecting the user to the home page with an error in the query string /// </summary> /// <param name="context"></param> /// <returns></returns> private Task OnAuthenticationFailed(AuthenticationFailedNotification<OpenIdConnectMessage, OpenIdConnectAuthenticationOptions> context) { context.HandleResponse(); context.Response.Redirect("/?errormessage=" + context.Exception.Message); return Task.FromResult(0); } } ``` 在Home控制器加上 [Authorize] 后开始运行,但出现 TLS 证书错误问题。 然后我去掉控制器上的 [Authorize] 在 action 里面加入 ``` System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; if (!Request.IsAuthenticated) { HttpContext.GetOwinContext().Authentication.Challenge( new AuthenticationProperties { RedirectUri = "/" }, OpenIdConnectAuthenticationDefaults.AuthenticationType); } ``` 运行后提示 404 的错误。本人想不通为什么会出现 404,请大佬帮解答。另外请教一下这个第三方登陆,我应该怎么做?
Navicat 连接不上虚拟机centos的mysql
[root@bogon ~]# service mysql start Redirecting to /bin/systemctl start mysql.service [root@bogon ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.6.45 MySQL Community Server (GPL) Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> grant all privileges on *.* to root@"%" identified by "new_mysql"; Query OK, 0 rows affected (0.00 sec) mysql> grant all privileges on *.* to root@"bogon" identified by "new_mysql"; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> quit Bye [root@bogon ~]# iptables -F [root@bogon ~]# systemctl stop firewalld [root@bogon ~]# systemctl disable firewalld [root@bogon ~]# ifconfig ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.131.131 netmask 255.255.255.0 broadcast 192.168.131.255 inet6 fe80::20c:29ff:fe4e:4a5b prefixlen 64 scopeid 0x20<link> ether 00:0c:29:4e:4a:5b txqueuelen 1000 (Ethernet) RX packets 284 bytes 28044 (27.3 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 395 bytes 31836 (31.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255 ether 52:54:00:d0:d8:4b txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 [root@bogon ~]# ping www.baidu.com PING www.a.shifen.com (163.177.151.109) 56(84) bytes of data. 64 bytes from 163.177.151.109 (163.177.151.109): icmp_seq=1 ttl=128 time=38.4 ms 64 bytes from 163.177.151.109 (163.177.151.109): icmp_seq=2 ttl=128 time=34.7 ms 64 bytes from 163.177.151.109 (163.177.151.109): icmp_seq=3 ttl=128 time=33.1 ms ^A64 bytes from 163.177.151.109 (163.177.151.109): icmp_seq=4 ttl=128 time=33.2 ms 64 bytes from 163.177.151.109 (163.177.151.109): icmp_seq=5 ttl=128 time=30.1 ms 64 bytes from 163.177.151.109 (163.177.151.109): icmp_seq=6 ttl=128 time=32.9 ms 64 bytes from 163.177.151.109 (163.177.151.109): icmp_seq=7 ttl=128 time=47.0 ms http://img.mukewang.com/climg/5d3d2999000169bb05660668.jpg 虚拟机网络是通的 Navicat的ip地址也没错 root的密码也没错 为什么就是连接不上呢?
请问scrapy为什么会爬取失败
C:\Users\Administrator\Desktop\新建文件夹\xiaozhu>python -m scrapy crawl xiaozhu 2019-10-26 11:43:11 [scrapy.utils.log] INFO: Scrapy 1.7.3 started (bot: xiaozhu) 2019-10-26 11:43:11 [scrapy.utils.log] INFO: Versions: lxml 4.4.1.0, libxml2 2.9 .5, cssselect 1.1.0, parsel 1.5.2, w3lib 1.21.0, Twisted 19.7.0, Python 3.5.3 (v 3.5.3:1880cb95a742, Jan 16 2017, 15:51:26) [MSC v.1900 32 bit (Intel)], pyOpenSS L 19.0.0 (OpenSSL 1.1.1c 28 May 2019), cryptography 2.7, Platform Windows-7-6.1 .7601-SP1 2019-10-26 11:43:11 [scrapy.crawler] INFO: Overridden settings: {'BOT_NAME': 'xi aozhu', 'SPIDER_MODULES': ['xiaozhu.spiders'], 'NEWSPIDER_MODULE': 'xiaozhu.spid ers'} 2019-10-26 11:43:11 [scrapy.extensions.telnet] INFO: Telnet Password: c61bda45d6 3b8138 2019-10-26 11:43:11 [scrapy.middleware] INFO: Enabled extensions: ['scrapy.extensions.telnet.TelnetConsole', 'scrapy.extensions.corestats.CoreStats', 'scrapy.extensions.logstats.LogStats'] 2019-10-26 11:43:12 [scrapy.middleware] INFO: Enabled downloader middlewares: ['scrapy.downloadermiddlewares.httpauth.HttpAuthMiddleware', 'scrapy.downloadermiddlewares.downloadtimeout.DownloadTimeoutMiddleware', 'scrapy.downloadermiddlewares.defaultheaders.DefaultHeadersMiddleware', 'scrapy.downloadermiddlewares.useragent.UserAgentMiddleware', 'scrapy.downloadermiddlewares.retry.RetryMiddleware', 'scrapy.downloadermiddlewares.redirect.MetaRefreshMiddleware', 'scrapy.downloadermiddlewares.httpcompression.HttpCompressionMiddleware', 'scrapy.downloadermiddlewares.redirect.RedirectMiddleware', 'scrapy.downloadermiddlewares.cookies.CookiesMiddleware', 'scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware', 'scrapy.downloadermiddlewares.stats.DownloaderStats'] 2019-10-26 11:43:12 [scrapy.middleware] INFO: Enabled spider middlewares: ['scrapy.spidermiddlewares.httperror.HttpErrorMiddleware', 'scrapy.spidermiddlewares.offsite.OffsiteMiddleware', 'scrapy.spidermiddlewares.referer.RefererMiddleware', 'scrapy.spidermiddlewares.urllength.UrlLengthMiddleware', 'scrapy.spidermiddlewares.depth.DepthMiddleware'] 2019-10-26 11:43:12 [scrapy.middleware] INFO: Enabled item pipelines: [] 2019-10-26 11:43:12 [scrapy.core.engine] INFO: Spider opened 2019-10-26 11:43:12 [scrapy.extensions.logstats] INFO: Crawled 0 pages (at 0 pag es/min), scraped 0 items (at 0 items/min) 2019-10-26 11:43:12 [scrapy.extensions.telnet] INFO: Telnet console listening on 127.0.0.1:6023 2019-10-26 11:43:12 [scrapy.downloadermiddlewares.redirect] DEBUG: Redirecting ( 307) to <GET https://bizverify.xiaozhu.com?slideRedirect=https%3A%2F%2Fbj.xiaozh u.com%2Ffangzi%2F125535477903.html> from <GET http://bj.xiaozhu.com/fangzi/12553 5477903.html> 2019-10-26 11:43:12 [scrapy.core.engine] DEBUG: Crawled (400) <GET https://bizve rify.xiaozhu.com?slideRedirect=https%3A%2F%2Fbj.xiaozhu.com%2Ffangzi%2F125535477 903.html> (referer: None) 2019-10-26 11:43:12 [scrapy.spidermiddlewares.httperror] INFO: Ignoring response <400 https://bizverify.xiaozhu.com?slideRedirect=https%3A%2F%2Fbj.xiaozhu.com%2 Ffangzi%2F125535477903.html>: HTTP status code is not handled or not allowed 2019-10-26 11:43:12 [scrapy.core.engine] INFO: Closing spider (finished) 2019-10-26 11:43:12 [scrapy.statscollectors] INFO: Dumping Scrapy stats: {'downloader/request_bytes': 529, 'downloader/request_count': 2, 'downloader/request_method_count/GET': 2, 'downloader/response_bytes': 725, 'downloader/response_count': 2, 'downloader/response_status_count/307': 1, 'downloader/response_status_count/400': 1, 'elapsed_time_seconds': 0.427734, 'finish_reason': 'finished', 'finish_time': datetime.datetime(2019, 10, 26, 3, 43, 12, 889648), 'httperror/response_ignored_count': 1, 'httperror/response_ignored_status_count/400': 1, 'log_count/DEBUG': 2, 'log_count/INFO': 11, 'response_received_count': 1, 'scheduler/dequeued': 2, 'scheduler/dequeued/memory': 2, 'scheduler/enqueued': 2, 'scheduler/enqueued/memory': 2, 'start_time': datetime.datetime(2019, 10, 26, 3, 43, 12, 461914)} 2019-10-26 11:43:12 [scrapy.core.engine] INFO: Spider closed (finished)
通过sqoop 导入hive错误
[root@orep apps]# sqoop import --connect jdbc:mysql://192.168.3.6:3306/hive --username root --password mysql123 --table VERSION --hive-table VERSION --hive-import 17/03/09 05:45:34 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6-cdh5.10.0 17/03/09 05:45:34 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead. 17/03/09 05:45:34 INFO tool.BaseSqoopTool: Using Hive-specific delimiters for output. You can override 17/03/09 05:45:34 INFO tool.BaseSqoopTool: delimiters with --fields-terminated-by, etc. 17/03/09 05:45:34 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset. 17/03/09 05:45:34 INFO tool.CodeGenTool: Beginning code generation 17/03/09 05:45:34 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `VERSION` AS t LIMIT 1 17/03/09 05:45:34 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `VERSION` AS t LIMIT 1 17/03/09 05:45:34 INFO orm.CompilationManager: HADOOP_MAPRED_HOME is /apps/hadoop-2.7.2 Note: /tmp/sqoop-root/compile/4b54b295fba470d9743716efe53e0d48/VERSION.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 17/03/09 05:45:36 INFO orm.CompilationManager: Writing jar file: /tmp/sqoop-root/compile/4b54b295fba470d9743716efe53e0d48/VERSION.jar 17/03/09 05:45:36 WARN manager.MySQLManager: It looks like you are importing from mysql. 17/03/09 05:45:36 WARN manager.MySQLManager: This transfer can be faster! Use the --direct 17/03/09 05:45:36 WARN manager.MySQLManager: option to exercise a MySQL-specific fast path. 17/03/09 05:45:36 INFO manager.MySQLManager: Setting zero DATETIME behavior to convertToNull (mysql) 17/03/09 05:45:36 INFO mapreduce.ImportJobBase: Beginning import of VERSION SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/apps/hadoop-2.7.2/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/apps/hbase/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 17/03/09 05:45:36 INFO Configuration.deprecation: mapred.jar is deprecated. Instead, use mapreduce.job.jar 17/03/09 05:45:37 INFO Configuration.deprecation: mapred.map.tasks is deprecated. Instead, use mapreduce.job.maps 17/03/09 05:45:37 INFO client.RMProxy: Connecting to ResourceManager at /192.168.3.6:8032 17/03/09 05:45:41 INFO db.DBInputFormat: Using read commited transaction isolation 17/03/09 05:45:41 INFO db.DataDrivenDBInputFormat: BoundingValsQuery: SELECT MIN(`VER_ID`), MAX(`VER_ID`) FROM `VERSION` 17/03/09 05:45:41 INFO db.IntegerSplitter: Split size: 0; Num splits: 4 from: 1 to: 1 17/03/09 05:45:41 INFO mapreduce.JobSubmitter: number of splits:1 17/03/09 05:45:41 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1488979391372_0005 17/03/09 05:45:42 INFO impl.YarnClientImpl: Submitted application application_1488979391372_0005 17/03/09 05:45:42 INFO mapreduce.Job: The url to track the job: http://Kylin01:8088/proxy/application_1488979391372_0005/ 17/03/09 05:45:42 INFO mapreduce.Job: Running job: job_1488979391372_0005 17/03/09 05:45:50 INFO mapred.ClientServiceDelegate: Application state is completed. FinalApplicationStatus=FAILED. Redirecting to job history server 17/03/09 05:45:50 INFO mapreduce.Job: Job job_1488979391372_0005 running in uber mode : false 17/03/09 05:45:50 INFO mapreduce.Job: map 0% reduce 100% 17/03/09 05:45:50 INFO mapreduce.Job: Job job_1488979391372_0005 failed with state FAILED due to: 17/03/09 05:45:50 INFO mapreduce.ImportJobBase: The MapReduce job has already been retired. Performance 17/03/09 05:45:50 INFO mapreduce.ImportJobBase: counters are unavailable. To get this information, 17/03/09 05:45:50 INFO mapreduce.ImportJobBase: you will need to enable the completed job store on 17/03/09 05:45:50 INFO mapreduce.ImportJobBase: the jobtracker with: 17/03/09 05:45:50 INFO mapreduce.ImportJobBase: mapreduce.jobtracker.persist.jobstatus.active = true 17/03/09 05:45:50 INFO mapreduce.ImportJobBase: mapreduce.jobtracker.persist.jobstatus.hours = 1 17/03/09 05:45:50 INFO mapreduce.ImportJobBase: A jobtracker restart is required for these settings 17/03/09 05:45:50 INFO mapreduce.ImportJobBase: to take effect. 17/03/09 05:45:50 ERROR tool.ImportTool: Error during import: Import job failed! 烦请给我大神帮我诊断一下,谢谢
python scrapy爬虫 抓取的内容只有一条,怎么破??
目标URL:http://218.92.23.142/sjsz/szxx/Index.aspx(工作需要) 主要目的是爬取网站中的信件类型、信件主题、写信时间、回复时间、回复状态以及其中链接里面的具体内容,然后保存到excel表格中。里面的链接全部都是POST方法,没有出现一个具体的链接,所以我感觉非常恼火。 目前碰到的问题: 1、 但是我只能抓到第一条的信息,后面就抓不到了。具体是这条:市长您好: 我是一名事... 2、 scrapy运行后出现的信息是: 15:01:33 [scrapy] INFO: Scrapy 1.0.3 started (bot: spider2) 2016-01-13 15:01:33 [scrapy] INFO: Optional features available: ssl, http11 2016-01-13 15:01:33 [scrapy] INFO: Overridden settings: {'NEWSPIDER_MODULE': 'spider2.spiders', 'FEED_URI': u'file:///F:/\u5feb\u76d8/workspace/Pythontest/src/Scrapy/spider2/szxx.csv', 'SPIDER_MODULES': ['spider2.spiders'], 'BOT_NAME': 'spider2', 'USER_AGENT': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.54 Safari/536.5', 'FEED_FORMAT': 'CSV'} 2016-01-13 15:01:36 [scrapy] INFO: Enabled extensions: CloseSpider, FeedExporter, TelnetConsole, LogStats, CoreStats, SpiderState 2016-01-13 15:01:38 [scrapy] INFO: Enabled downloader middlewares: HttpAuthMiddleware, DownloadTimeoutMiddleware, UserAgentMiddleware, RetryMiddleware, DefaultHeadersMiddleware, MetaRefreshMiddleware, HttpCompressionMiddleware, RedirectMiddleware, CookiesMiddleware, ChunkedTransferMiddleware, DownloaderStats 2016-01-13 15:01:38 [scrapy] INFO: Enabled spider middlewares: HttpErrorMiddleware, OffsiteMiddleware, RefererMiddleware, UrlLengthMiddleware, DepthMiddleware 2016-01-13 15:01:38 [scrapy] INFO: Enabled item pipelines: 2016-01-13 15:01:38 [scrapy] INFO: Spider opened 2016-01-13 15:01:38 [scrapy] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min) 2016-01-13 15:01:38 [scrapy] DEBUG: Telnet console listening on 127.0.0.1:6023 2016-01-13 15:01:39 [scrapy] DEBUG: Crawled (200) <GET http://218.92.23.142/sjsz/szxx/Index.aspx> (referer: None) 2016-01-13 15:01:39 [scrapy] DEBUG: Filtered duplicate request: <GET http://218.92.23.142/sjsz/szxx/Index.aspx> - no more duplicates will be shown (see DUPEFILTER_DEBUG to show all duplicates) 2016-01-13 15:01:39 [scrapy] DEBUG: Crawled (200) <GET http://218.92.23.142/sjsz/szxx/Index.aspx> (referer: http://218.92.23.142/sjsz/szxx/Index.aspx) 2016-01-13 15:01:39 [scrapy] DEBUG: Crawled (200) <POST http://218.92.23.142/sjsz/szxx/Index.aspx> (referer: http://218.92.23.142/sjsz/szxx/Index.aspx) 2016-01-13 15:01:39 [scrapy] DEBUG: Redirecting (302) to <GET http://218.92.23.142/sjsz/szxx/GkResult.aspx?infoid=3160105094757> from <POST http://218.92.23.142/sjsz/szxx/Index.aspx> 2016-01-13 15:01:39 [scrapy] DEBUG: Crawled (200) <GET http://218.92.23.142/sjsz/szxx/GkResult.aspx?infoid=3160105094757> (referer: http://218.92.23.142/sjsz/szxx/Index.aspx) 2016-01-13 15:01:39 [scrapy] DEBUG: Scraped from <200 http://218.92.23.142/sjsz/szxx/GkResult.aspx?infoid=3160105094757> 第一条的信息(太多了,就省略了。。。。) 2016-01-13 15:01:39 [scrapy] DEBUG: Crawled (200) <POST http://218.92.23.142/sjsz/szxx/Index.aspx> (referer: http://218.92.23.142/sjsz/szxx/Index.aspx) ………… 后面的差不多,就不写出来了 2016-01-13 15:01:41 [scrapy] INFO: Stored csv feed (1 items) in: file:///F:/快盘/workspace/Pythontest/src/Scrapy/spider2/szxx.csv 2016-01-13 15:01:41 [scrapy] INFO: Dumping Scrapy stats: {'downloader/request_bytes': 56383, 'downloader/request_count': 17, 'downloader/request_method_count/GET': 3, 'downloader/request_method_count/POST': 14, 'downloader/response_bytes': 118855, 'downloader/response_count': 17, 'downloader/response_status_count/200': 16, 'downloader/response_status_count/302': 1, 'dupefilter/filtered': 120, 'finish_reason': 'finished', 'finish_time': datetime.datetime(2016, 1, 13, 7, 1, 41, 716000), 'item_scraped_count': 1, 'log_count/DEBUG': 20, 'log_count/INFO': 8, 'request_depth_max': 14, 'response_received_count': 16, 'scheduler/dequeued': 17, 'scheduler/dequeued/memory': 17, 'scheduler/enqueued': 17, 'scheduler/enqueued/memory': 17, 'start_time': datetime.datetime(2016, 1, 13, 7, 1, 38, 670000)} 2016-01-13 15:01:41 [scrapy] INFO: Spider closed (finished) 具体的代码如下(代码写的不好,误喷): import sys, copy reload(sys) sys.setdefaultencoding('utf-8') sys.path.append("../") from scrapy.spiders import CrawlSpider from scrapy.http import FormRequest, Request from scrapy.selector import Selector from items import Spider2Item class Domeszxx(CrawlSpider): name = "szxx" allowed_domain = ["218.92.23.142"] start_urls = ["http://218.92.23.142/sjsz/szxx/Index.aspx"] item = Spider2Item() def parse(self, response): selector = Selector(response) # 获得下一页的POST参数 viewstate = ''.join(selector.xpath('//input[@id="__VIEWSTATE"]/@value').extract()[0]) eventvalidation = ''.join(selector.xpath('//input[@id="__EVENTVALIDATION"]/@value').extract()[0]) nextpage = ''.join( selector.xpath('//input[@name="ctl00$ContentPlaceHolder1$GridView1$ctl12$txtGoPage"]/@value').extract()) nextpage_data = { '__EVENTTARGET': 'ctl00$ContentPlaceHolder1$GridView1$ctl12$cmdNext', '__EVENTARGUMENT': '', '__VIEWSTATE': viewstate, '__VIEWSTATEGENERATOR': '9DEFE542', '__EVENTVALIDATION': eventvalidation, 'ctl00$ContentPlaceHolder1$GridView1$ctl12$txtGoPage': nextpage } # 获得抓取当前内容的xpath xjlx = ".//*[@id='ContentPlaceHolder1_GridView1_Label2_" xjzt = ".//*[@id='ContentPlaceHolder1_GridView1_LinkButton5_" xxsj = ".//*[@id='ContentPlaceHolder1_GridView1_Label4_" hfsj = ".//*[@id='ContentPlaceHolder1_GridView1_Label5_" nextlink = '//*[@id="ContentPlaceHolder1_GridView1_cmdNext"]/@href' # 获取当前页面公开答复的行数 listnum = len(selector.xpath('//tr')) - 2 # 获得抓取内容 for i in range(0, listnum): item_all = {} xjlx_xpath = xjlx + str(i) + "']/text()" xjzt_xpath = xjzt + str(i) + "']/text()" xxsj_xpath = xxsj + str(i) + "']/text()" hfsj_xpath = hfsj + str(i) + "']/text()" # 信件类型 item_all['xjlx'] = selector.xpath(xjlx_xpath).extract()[0].decode('utf-8').encode('gbk') # 信件主题 item_all['xjzt'] = str(selector.xpath(xjzt_xpath).extract()[0].decode('utf-8').encode('gbk')).replace('\n', '') # 写信时间 item_all['xxsj'] = selector.xpath(xxsj_xpath).extract()[0].decode('utf-8').encode('gbk') # 回复时间 item_all['hfsj'] = selector.xpath(hfsj_xpath).extract()[0].decode('utf-8').encode('gbk') # 获取二级页面中的POST参数 eventtaget = 'ctl00$ContentPlaceHolder1$GridView1$ctl0' + str(i + 2) + '$LinkButton5' content_data = { '__EVENTTARGET': eventtaget, '__EVENTARGUMENT': '', '__VIEWSTATE': viewstate, '__VIEWSTATEGENERATOR': '9DEFE542', '__EVENTVALIDATION': eventvalidation, 'ctl00$ContentPlaceHolder1$GridView1$ctl12$txtGoPage': nextpage } # 完成抓取信息的传递 yield Request(url="http://218.92.23.142/sjsz/szxx/Index.aspx", callback=self.send_value, meta={'item_all': item_all, 'content_data': content_data}) # 进入页面中的二级页面的链接,必须利用POST方法才能提交,无法看到直接的URL,同时将本页中抓取的item和进入下一页的POST方法进行传递 # yield Request(url="http://218.92.23.142/sjsz/szxx/Index.aspx", callback=self.getcontent, # meta={'item': item_all}) # yield FormRequest(url="http://218.92.23.142/sjsz/szxx/Index.aspx", formdata=content_data, # callback=self.getcontent) # 进入下一页 if selector.xpath(nextlink).extract(): yield FormRequest(url="http://218.92.23.142/sjsz/szxx/Index.aspx", formdata=nextpage_data, callback=self.parse) # 将当前页面的值传递到本函数并存入类的item中 def send_value(self, response): itemx = response.meta['item_all'] post_data = response.meta['content_data'] Domeszxx.item = copy.deepcopy(itemx) yield FormRequest(url="http://218.92.23.142/sjsz/szxx/Index.aspx", formdata=post_data, callback=self.getcontent) return # 将二级链接中值抓取并存入类的item中 def getcontent(self, response): item_getcontent = { 'xfr': ''.join(response.xpath('//*[@id="lblXFName"]/text()').extract()).decode('utf-8').encode('gbk'), 'lxnr': ''.join(response.xpath('//*[@id="lblXFQuestion"]/text()').extract()).decode('utf-8').encode( 'gbk'), 'hfnr': ''.join(response.xpath('//*[@id="lblXFanswer"]/text()').extract()).decode('utf-8').encode( 'gbk')} Domeszxx.item.update(item_getcontent) yield Domeszxx.item return
亲们,loadrunner中录制飞机订票系统,怎么参数化航班?求详细介绍
Virtual User Script started at : 2015-09-30 10:25:58 Starting action vuser_init. Web Turbo Replay of LoadRunner 11.0.0 for WINXP; build 8859 (Aug 18 2010 20:14:31) [MsgId: MMSG-27143] Run Mode: HTML [MsgId: MMSG-26000] Run-Time Settings file: "D:\lr_text\fight\\default.cfg" [MsgId: MMSG-27141] Ending action vuser_init. Running Vuser... Starting iteration 1. Starting action Action. Action.c(4): Redirecting "http://127.0.0.1:1080/WebTours" (redirection depth is 0) [MsgId: MMSG-26694] Action.c(4): To location "http://127.0.0.1:1080/WebTours/" [MsgId: MMSG-26693] Action.c(4): Detected non-resource "http://127.0.0.1:1080/WebTours/header.html" in "http://127.0.0.1:1080/WebTours/" [MsgId: MMSG-26574] Action.c(4): Detected non-resource "http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true" in "http://127.0.0.1:1080/WebTours/" [MsgId: MMSG-26574] Action.c(4): Detected non-resource "http://127.0.0.1:1080/WebTours/nav.pl?in=home" in "http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true" [MsgId: MMSG-26574] Action.c(4): Detected non-resource "http://127.0.0.1:1080/WebTours/home.html" in "http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true" [MsgId: MMSG-26574] Action.c(4): Found resource "http://127.0.0.1:1080/WebTours/images/hp_logo.png" in HTML "http://127.0.0.1:1080/WebTours/header.html" [MsgId: MMSG-26659] Action.c(4): Found resource "http://127.0.0.1:1080/WebTours/images/webtours.png" in HTML "http://127.0.0.1:1080/WebTours/header.html" [MsgId: MMSG-26659] Action.c(4): Found resource "http://127.0.0.1:1080/WebTours/images/mer_login.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?in=home" [MsgId: MMSG-26659] Action.c(4): web_url("WebTours") was successful, 6448 body bytes, 1724 header bytes [MsgId: MMSG-26386] Action.c(15): Submitting form to "http://127.0.0.1:1080/WebTours/login.pl", Target Frame="body" [MsgId: MMSG-27978] Action.c(15): Detected non-resource "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home" in "http://127.0.0.1:1080/WebTours/login.pl" [MsgId: MMSG-26574] Action.c(15): Detected non-resource "http://127.0.0.1:1080/WebTours/login.pl?intro=true" in "http://127.0.0.1:1080/WebTours/login.pl" [MsgId: MMSG-26574] Action.c(15): Found resource "http://127.0.0.1:1080/WebTours/images/flights.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(15): Found resource "http://127.0.0.1:1080/WebTours/images/itinerary.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(15): Found resource "http://127.0.0.1:1080/WebTours/images/in_home.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(15): Found resource "http://127.0.0.1:1080/WebTours/images/signoff.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(15): web_submit_form("login.pl") was successful, 5694 body bytes, 1482 header bytes [MsgId: MMSG-26386] Action.c(24): Image-linking to "http://127.0.0.1:1080/WebTours/welcome.pl?page=search", Target Frame="body" [MsgId: MMSG-27993] Action.c(24): Detected non-resource "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=flights" in "http://127.0.0.1:1080/WebTours/welcome.pl?page=search" [MsgId: MMSG-26574] Action.c(24): Detected non-resource "http://127.0.0.1:1080/WebTours/reservations.pl?page=welcome" in "http://127.0.0.1:1080/WebTours/welcome.pl?page=search" [MsgId: MMSG-26574] Action.c(24): Found resource "http://127.0.0.1:1080/WebTours/images/button_next.gif" in HTML "http://127.0.0.1:1080/WebTours/reservations.pl?page=welcome" [MsgId: MMSG-26659] Action.c(24): Found resource "http://127.0.0.1:1080/WebTours/images/in_flights.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=flights" [MsgId: MMSG-26659] Action.c(24): Resource "http://127.0.0.1:1080/WebTours/images/itinerary.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655] Action.c(24): Found resource "http://127.0.0.1:1080/WebTours/images/home.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=flights" [MsgId: MMSG-26659] Action.c(24): Resource "http://127.0.0.1:1080/WebTours/images/signoff.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655] Action.c(24): web_image("Search Flights Button") was successful, 8360 body bytes, 1173 header bytes [MsgId: MMSG-26386] Action.c(31): Submitting form to "http://127.0.0.1:1080/WebTours/reservations.pl", Target Frame="" [MsgId: MMSG-27978] Action.c(31): Resource "http://127.0.0.1:1080/WebTours/images/button_next.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655] Action.c(31): web_submit_form("reservations.pl") was successful, 2359 body bytes, 253 header bytes [MsgId: MMSG-26386] Action.c(46): Error -27979: Requested form not found [MsgId: MERR-27979] Action.c(46): web_submit_form("reservations.pl_2") highest severity level was "ERROR", 0 body bytes, 0 header bytes [MsgId: MMSG-26388] Ending action Action. Ending iteration 1. Starting iteration 2. Starting action Action. Action.c(4): Redirecting "http://127.0.0.1:1080/WebTours" (redirection depth is 0) [MsgId: MMSG-26694] Action.c(4): To location "http://127.0.0.1:1080/WebTours/" [MsgId: MMSG-26693] Action.c(4): Detected non-resource "http://127.0.0.1:1080/WebTours/header.html" in "http://127.0.0.1:1080/WebTours/" [MsgId: MMSG-26574] Action.c(4): Detected non-resource "http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true" in "http://127.0.0.1:1080/WebTours/" [MsgId: MMSG-26574] Action.c(4): Detected non-resource "http://127.0.0.1:1080/WebTours/nav.pl?in=home" in "http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true" [MsgId: MMSG-26574] Action.c(4): Detected non-resource "http://127.0.0.1:1080/WebTours/home.html" in "http://127.0.0.1:1080/WebTours/welcome.pl?signOff=true" [MsgId: MMSG-26574] Action.c(4): Found resource "http://127.0.0.1:1080/WebTours/images/hp_logo.png" in HTML "http://127.0.0.1:1080/WebTours/header.html" [MsgId: MMSG-26659] Action.c(4): Found resource "http://127.0.0.1:1080/WebTours/images/webtours.png" in HTML "http://127.0.0.1:1080/WebTours/header.html" [MsgId: MMSG-26659] Action.c(4): Found resource "http://127.0.0.1:1080/WebTours/images/mer_login.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?in=home" [MsgId: MMSG-26659] Action.c(4): web_url("WebTours") was successful, 6448 body bytes, 1724 header bytes [MsgId: MMSG-26386] Action.c(15): Submitting form to "http://127.0.0.1:1080/WebTours/login.pl", Target Frame="body" [MsgId: MMSG-27978] Action.c(15): Detected non-resource "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home" in "http://127.0.0.1:1080/WebTours/login.pl" [MsgId: MMSG-26574] Action.c(15): Detected non-resource "http://127.0.0.1:1080/WebTours/login.pl?intro=true" in "http://127.0.0.1:1080/WebTours/login.pl" [MsgId: MMSG-26574] Action.c(15): Found resource "http://127.0.0.1:1080/WebTours/images/flights.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(15): Found resource "http://127.0.0.1:1080/WebTours/images/itinerary.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(15): Found resource "http://127.0.0.1:1080/WebTours/images/in_home.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(15): Found resource "http://127.0.0.1:1080/WebTours/images/signoff.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=home" [MsgId: MMSG-26659] Action.c(15): web_submit_form("login.pl") was successful, 5694 body bytes, 1482 header bytes [MsgId: MMSG-26386] Action.c(24): Image-linking to "http://127.0.0.1:1080/WebTours/welcome.pl?page=search", Target Frame="body" [MsgId: MMSG-27993] Action.c(24): Detected non-resource "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=flights" in "http://127.0.0.1:1080/WebTours/welcome.pl?page=search" [MsgId: MMSG-26574] Action.c(24): Detected non-resource "http://127.0.0.1:1080/WebTours/reservations.pl?page=welcome" in "http://127.0.0.1:1080/WebTours/welcome.pl?page=search" [MsgId: MMSG-26574] Action.c(24): Found resource "http://127.0.0.1:1080/WebTours/images/button_next.gif" in HTML "http://127.0.0.1:1080/WebTours/reservations.pl?page=welcome" [MsgId: MMSG-26659] Action.c(24): Found resource "http://127.0.0.1:1080/WebTours/images/in_flights.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=flights" [MsgId: MMSG-26659] Action.c(24): Resource "http://127.0.0.1:1080/WebTours/images/itinerary.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655] Action.c(24): Found resource "http://127.0.0.1:1080/WebTours/images/home.gif" in HTML "http://127.0.0.1:1080/WebTours/nav.pl?page=menu&in=flights" [MsgId: MMSG-26659] Action.c(24): Resource "http://127.0.0.1:1080/WebTours/images/signoff.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655] Action.c(24): web_image("Search Flights Button") was successful, 8360 body bytes, 1173 header bytes [MsgId: MMSG-26386] Action.c(31): Submitting form to "http://127.0.0.1:1080/WebTours/reservations.pl", Target Frame="" [MsgId: MMSG-27978] Action.c(31): Resource "http://127.0.0.1:1080/WebTours/images/button_next.gif" is in the cache already and will not be downloaded again [MsgId: MMSG-26655] Action.c(31): web_submit_form("reservations.pl") was successful, 2351 body bytes, 253 header bytes [MsgId: MMSG-26386] Action.c(46): Error -27979: Requested form not found [MsgId: MERR-27979] Action.c(46): web_submit_form("reservations.pl_2") highest severity level was "ERROR", 0 body bytes, 0 header bytes [MsgId: MMSG-26388] Ending action Action. Ending iteration 2. Ending Vuser... Starting action vuser_end. Ending action vuser_end. Vuser Terminated.
Spring Security OAuth2
在使用Spring Security OAuth2测试时,授权之后报错: Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Wed Dec 20 16:14:18 CST 2017 There was an unexpected error (type=Unauthorized, status=401). Authentication Failed: Could not obtain user details from token 客户端DEBUG信息: 2017-12-20 16:14:17.948 DEBUG 7932 --- [nio-8082-exec-4] o.s.s.oauth2.client.OAuth2RestTemplate : Created GET request for "http://localhost:8081/resource/user" 2017-12-20 16:14:17.967 DEBUG 7932 --- [nio-8082-exec-4] o.s.s.oauth2.client.OAuth2RestTemplate : Setting request Accept header to [application/json, application/*+json] 2017-12-20 16:14:18.204 DEBUG 7932 --- [nio-8082-exec-4] o.s.s.oauth2.client.OAuth2RestTemplate : GET request for "http://localhost:8081/resource/user" resulted in 401 (null); invoking error handler 2017-12-20 16:14:18.213 WARN 7932 --- [nio-8082-exec-4] o.s.b.a.s.o.r.UserInfoTokenServices : Could not fetch user details: class org.springframework.security.oauth2.common.exceptions.InvalidRequestException, Possible CSRF detected - state parameter was required but no state could be found 2017-12-20 16:14:18.280 DEBUG 7932 --- [nio-8082-exec-4] uth2ClientAuthenticationProcessingFilter : Authentication request failed: org.springframework.security.authentication.BadCredentialsException: Could not obtain user details from token 认证服务器DEBUG信息: 2017-12-20 16:14:08.230 DEBUG 8704 --- [nio-8080-exec-7] o.s.s.w.a.i.FilterSecurityInterceptor : Secure object: FilterInvocation: URL: /favicon.ico; Attributes: [authenticated] 2017-12-20 16:14:08.230 DEBUG 8704 --- [nio-8080-exec-7] o.s.s.w.a.i.FilterSecurityInterceptor : Previously Authenticated: org.springframework.security.authentication.AnonymousAuthenticationToken@6fa90ed4: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@fffc7f0c: RemoteIpAddress: 0:0:0:0:0:0:0:1; SessionId: 41D379AFB367FD4316A06BAC18AB91DA; Granted Authorities: ROLE_ANONYMOUS 2017-12-20 16:14:08.230 DEBUG 8704 --- [nio-8080-exec-7] o.s.s.access.vote.AffirmativeBased : Voter: org.springframework.security.web.access.expression.WebExpressionVoter@72127537, returned: -1 2017-12-20 16:14:08.231 DEBUG 8704 --- [nio-8080-exec-7] o.s.s.w.a.ExceptionTranslationFilter : Access is denied (user is anonymous); redirecting to authentication entry point 资源服务器DEBUG信息: 2017-12-20 16:14:18.132 DEBUG 10100 --- [nio-8081-exec-1] o.s.security.web.FilterChainProxy : /user at position 5 of 11 in additional filter chain; firing Filter: 'OAuth2AuthenticationProcessingFilter' 2017-12-20 16:14:18.137 DEBUG 10100 --- [nio-8081-exec-1] p.a.OAuth2AuthenticationProcessingFilter : Authentication request failed: error="invalid_token", error_description="Invalid access token: fbde02a4-d6b9-41c8-a8aa-332390482c1e" 2017-12-20 16:14:18.192 DEBUG 10100 --- [nio-8081-exec-1] w.c.HttpSessionSecurityContextRepository : SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession. 2017-12-20 16:14:18.199 DEBUG 10100 --- [nio-8081-exec-1] s.s.o.p.e.DefaultOAuth2ExceptionRenderer : Written [error="invalid_token", error_description="Invalid access token: fbde02a4-d6b9-41c8-a8aa-332390482c1e"] as "application/json;charset=UTF-8" using [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter@74bcb39b] 2017-12-20 16:14:18.200 DEBUG 10100 --- [nio-8081-exec-1] s.s.w.c.SecurityContextPersistenceFilter : SecurityContextHolder now cleared, as request processing completed 网上找了很久都没有解决,有研究过的大神指教一下
spring security cas单点登录拒绝访问
[b]cas服务端和cas客户端都已经配合,访问cas服务端可以登录,访问客户端应用资源的时候出现拒绝访问问题,但是[color=red]能成功跳转到cas服务端的login页面,输入账号密码后控制台打印显示出服务端登录成功,但是关于客户端的打印出现拒绝访问异常,而且httpSession不为null但是里面没值[/color][/b]。 初次使用spring security和cas望多多指教. 异常信息: [color=red][b]首次登录直接出现拒绝访问,但是却能跳转到cas 登录页面,[/b][/color] [quote] 信息: Server startup in 21955 ms 2012-6-6 11:51:31 org.apache.catalina.core.ApplicationContext log 信息: HTMLManager: init: Associated with Deployer 'Catalina:type=Deployer,host=localhost' 2012-6-6 11:51:31 org.apache.catalina.core.ApplicationContext log 信息: HTMLManager: init: Global resources are available 2012-6-6 11:51:31 org.apache.catalina.core.ApplicationContext log 信息: HTMLManager: list: Listing contexts for virtual host 'localhost' 2012-06-06 11:51:32,593 INFO [org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] - <Beginning ticket cleanup.> 2012-06-06 11:51:32,593 INFO [org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] - <0 tickets found to be removed.> 2012-06-06 11:51:32,593 INFO [org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner] - <Finished ticket cleanup.> 11:51:33,906 DEBUG org.springframework.security.web.FilterChainProxy:318 - /index.jsp at position 1 of 12 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter' 11:51:33,921 DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository:127 - No HttpSession currently exists 11:51:33,921 DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository:85 - No SecurityContext was available from the HttpSession: null. A new one will be created. 11:51:33,921 DEBUG org.springframework.security.web.FilterChainProxy:318 - /index.jsp at position 2 of 12 in additional filter chain; firing Filter: 'LogoutFilter' 11:51:33,921 DEBUG org.springframework.security.web.FilterChainProxy:318 - /index.jsp at position 3 of 12 in additional filter chain; firing Filter: 'CasAuthenticationFilter' 11:51:33,937 DEBUG org.springframework.security.cas.web.CasAuthenticationFilter:311 - serviceTicketRequest = false 11:51:33,937 DEBUG org.springframework.security.cas.web.CasAuthenticationFilter:362 - proxyReceptorConfigured = false 11:51:33,937 DEBUG org.springframework.security.cas.web.CasAuthenticationFilter:349 - proxyReceptorRequest = false 11:51:33,937 DEBUG org.springframework.security.cas.web.CasAuthenticationFilter:327 - proxyTicketRequest = false 11:51:33,937 DEBUG org.springframework.security.cas.web.CasAuthenticationFilter:262 - requiresAuthentication = false 11:51:33,937 DEBUG org.springframework.security.web.FilterChainProxy:318 - /index.jsp at position 4 of 12 in additional filter chain; firing Filter: 'UsernamePasswordAuthenticationFilter' 11:51:33,937 DEBUG org.springframework.security.web.FilterChainProxy:318 - /index.jsp at position 5 of 12 in additional filter chain; firing Filter: 'DefaultLoginPageGeneratingFilter' 11:51:33,937 DEBUG org.springframework.security.web.FilterChainProxy:318 - /index.jsp at position 6 of 12 in additional filter chain; firing Filter: 'BasicAuthenticationFilter' 11:51:33,937 DEBUG org.springframework.security.web.FilterChainProxy:318 - /index.jsp at position 7 of 12 in additional filter chain; firing Filter: 'RequestCacheAwareFilter' 11:51:33,937 DEBUG org.springframework.security.web.FilterChainProxy:318 - /index.jsp at position 8 of 12 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter' 11:51:33,937 DEBUG org.springframework.security.web.FilterChainProxy:318 - /index.jsp at position 9 of 12 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter' 11:51:33,937 DEBUG org.springframework.security.web.authentication.AnonymousAuthenticationFilter:102 - Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@9055e4a6: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS' 11:51:33,937 DEBUG org.springframework.security.web.FilterChainProxy:318 - /index.jsp at position 10 of 12 in additional filter chain; firing Filter: 'SessionManagementFilter' 11:51:33,937 DEBUG org.springframework.security.web.session.SessionManagementFilter:91 - Requested session IDFED78FFF2BDBC0647461CBFA29AB9B23 is invalid. 11:51:33,937 DEBUG org.springframework.security.web.FilterChainProxy:318 - /index.jsp at position 11 of 12 in additional filter chain; firing Filter: 'ExceptionTranslationFilter' 11:51:33,937 DEBUG org.springframework.security.web.FilterChainProxy:318 - /index.jsp at position 12 of 12 in additional filter chain; firing Filter: 'FilterSecurityInterceptor' 11:51:33,937 DEBUG org.springframework.security.web.access.intercept.FilterSecurityInterceptor:193 - Secure object: FilterInvocation: URL: /index.jsp; Attributes: [ROLE_USER] 11:51:33,937 DEBUG org.springframework.security.web.access.intercept.FilterSecurityInterceptor:298 - Previously Authenticated: org.springframework.security.authentication.AnonymousAuthenticationToken@9055e4a6: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@957e: RemoteIpAddress: 127.0.0.1; SessionId: null; Granted Authorities: ROLE_ANONYMOUS 11:51:33,937 DEBUG org.springframework.security.access.vote.AffirmativeBased:65 - Voter: org.springframework.security.access.vote.RoleVoter@13e02ed, returned: -1 11:51:33,953 DEBUG org.springframework.security.access.vote.AffirmativeBased:65 - Voter: org.springframework.security.access.vote.AuthenticatedVoter@322394, returned: 0 11:51:33,968 DEBUG org.springframework.security.web.access.ExceptionTranslationFilter:165 - Access is denied (user is anonymous); redirecting to authentication entry point org.springframework.security.access.AccessDeniedException: Access is denied at org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:83) at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:205) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:114) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:91) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675) at java.lang.Thread.run(Thread.java:662) 11:51:33,984 DEBUG org.springframework.security.web.savedrequest.HttpSessionRequestCache:41 - DefaultSavedRequest added to Session: DefaultSavedRequest[http://localhost:8080/Cas_Client/] 11:51:33,984 DEBUG org.springframework.security.web.access.ExceptionTranslationFilter:185 - Calling Authentication entry point. 11:51:33,984 DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository:269 - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession. 11:51:34,015 DEBUG org.springframework.security.web.context.SecurityContextPersistenceFilter:97 - SecurityContextHolder now cleared, as request processing completed 2012-06-06 11:51:34,921 INFO [org.jasig.cas.web.flow.InitialFlowSetupAction] - <Setting path for cookies to: /casServer/> [/quote] [color=red][b]跳转到登录页面后输入账号密码出现cas服务端的信息正常,但是关于cas客户端的和上面的异常一样:[/b][/color] 打印信息: [quote] 2012-06-06 12:03:21,625 INFO [org.jasig.cas.services.DefaultServicesManagerImpl] - <Reloading registered services.> 2012-06-06 12:03:21,625 INFO [org.jasig.cas.services.DefaultServicesManagerImpl] - <Loaded 0 services.> start[1338955402531] time[603] tag[QueryDatabaseAuthenticationHandler] 2012-06-06 12:03:23,125 INFO [org.jasig.cas.authentication.AuthenticationManagerImpl] - <AuthenticationHandler: org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler successfully authenticated the user which provided the following credentials: [username: wucht]> 2012-06-06 12:03:23,234 INFO [org.jasig.cas.authentication.AuthenticationManagerImpl] - <Resolved principal wucht> 2012-06-06 12:03:23,234 INFO [org.jasig.cas.authentication.AuthenticationManagerImpl] - <Principal found: wucht> 2012-06-06 12:03:23,250 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN ============================================================= WHO: [username: wucht] WHAT: supplied credentials: [username: wucht] ACTION: AUTHENTICATION_SUCCESS APPLICATION: CAS WHEN: Wed Jun 06 12:03:23 CST 2012 CLIENT IP ADDRESS: 127.0.0.1 SERVER IP ADDRESS: 127.0.0.1 ============================================================= > 2012-06-06 12:03:23,250 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN ============================================================= WHO: [username: wucht] WHAT: TGT-1-0WNh4MDLT57myMG77eF54B9ix5oQP0OItPnVBGDZBYac9Bj42E-casServer ACTION: TICKET_GRANTING_TICKET_CREATED APPLICATION: CAS WHEN: Wed Jun 06 12:03:23 CST 2012 CLIENT IP ADDRESS: 127.0.0.1 SERVER IP ADDRESS: 127.0.0.1 ============================================================= > 2012-06-06 12:03:23,265 INFO [org.jasig.cas.CentralAuthenticationServiceImpl] - <Granted service ticket [ST-1-eOK4CG7zd7cApkahlva9-casServer] for service [http://localhost:8080/Cas_Client/j_acegi_cas_security_check] for user [wucht]> 2012-06-06 12:03:23,265 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN ============================================================= WHO: wucht WHAT: ST-1-eOK4CG7zd7cApkahlva9-casServer for http://localhost:8080/Cas_Client/j_acegi_cas_security_check ACTION: SERVICE_TICKET_CREATED APPLICATION: CAS WHEN: Wed Jun 06 12:03:23 CST 2012 CLIENT IP ADDRESS: 127.0.0.1 SERVER IP ADDRESS: 127.0.0.1 ============================================================= > 12:03:23,296 DEBUG org.springframework.security.web.FilterChainProxy:318 - /j_acegi_cas_security_check?ticket=ST-1-eOK4CG7zd7cApkahlva9-casServer at position 1 of 12 in additional filter chain; firing Filter: 'SecurityContextPersistenceFilter' 12:03:23,296 DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository:139 - HttpSession returned null object for SPRING_SECURITY_CONTEXT 12:03:23,296 DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository:85 - No SecurityContext was available from the HttpSession: org.apache.catalina.session.StandardSessionFacade@1ef3d12. A new one will be created. 12:03:23,296 DEBUG org.springframework.security.web.FilterChainProxy:318 - /j_acegi_cas_security_check?ticket=ST-1-eOK4CG7zd7cApkahlva9-casServer at position 2 of 12 in additional filter chain; firing Filter: 'LogoutFilter' 12:03:23,296 DEBUG org.springframework.security.web.FilterChainProxy:318 - /j_acegi_cas_security_check?ticket=ST-1-eOK4CG7zd7cApkahlva9-casServer at position 3 of 12 in additional filter chain; firing Filter: 'CasAuthenticationFilter' 12:03:23,296 DEBUG org.springframework.security.cas.web.CasAuthenticationFilter:311 - serviceTicketRequest = false 12:03:23,296 DEBUG org.springframework.security.cas.web.CasAuthenticationFilter:362 - proxyReceptorConfigured = false 12:03:23,296 DEBUG org.springframework.security.cas.web.CasAuthenticationFilter:349 - proxyReceptorRequest = false 12:03:23,296 DEBUG org.springframework.security.cas.web.CasAuthenticationFilter:327 - proxyTicketRequest = false 12:03:23,296 DEBUG org.springframework.security.cas.web.CasAuthenticationFilter:262 - requiresAuthentication = false 12:03:23,296 DEBUG org.springframework.security.web.FilterChainProxy:318 - /j_acegi_cas_security_check?ticket=ST-1-eOK4CG7zd7cApkahlva9-casServer at position 4 of 12 in additional filter chain; firing Filter: 'UsernamePasswordAuthenticationFilter' 12:03:23,296 DEBUG org.springframework.security.web.FilterChainProxy:318 - /j_acegi_cas_security_check?ticket=ST-1-eOK4CG7zd7cApkahlva9-casServer at position 5 of 12 in additional filter chain; firing Filter: 'DefaultLoginPageGeneratingFilter' 12:03:23,296 DEBUG org.springframework.security.web.FilterChainProxy:318 - /j_acegi_cas_security_check?ticket=ST-1-eOK4CG7zd7cApkahlva9-casServer at position 6 of 12 in additional filter chain; firing Filter: 'BasicAuthenticationFilter' 12:03:23,296 DEBUG org.springframework.security.web.FilterChainProxy:318 - /j_acegi_cas_security_check?ticket=ST-1-eOK4CG7zd7cApkahlva9-casServer at position 7 of 12 in additional filter chain; firing Filter: 'RequestCacheAwareFilter' 12:03:23,296 DEBUG org.springframework.security.web.savedrequest.DefaultSavedRequest:309 - pathInfo: both null (property equals) 12:03:23,296 DEBUG org.springframework.security.web.savedrequest.DefaultSavedRequest:317 - queryString: arg1=null; arg2=ticket=ST-1-eOK4CG7zd7cApkahlva9-casServer (property not equals) 12:03:23,296 DEBUG org.springframework.security.web.savedrequest.HttpSessionRequestCache:75 - saved request doesn't match 12:03:23,296 DEBUG org.springframework.security.web.FilterChainProxy:318 - /j_acegi_cas_security_check?ticket=ST-1-eOK4CG7zd7cApkahlva9-casServer at position 8 of 12 in additional filter chain; firing Filter: 'SecurityContextHolderAwareRequestFilter' 12:03:23,296 DEBUG org.springframework.security.web.FilterChainProxy:318 - /j_acegi_cas_security_check?ticket=ST-1-eOK4CG7zd7cApkahlva9-casServer at position 9 of 12 in additional filter chain; firing Filter: 'AnonymousAuthenticationFilter' 12:03:23,296 DEBUG org.springframework.security.web.authentication.AnonymousAuthenticationFilter:102 - Populated SecurityContextHolder with anonymous token: 'org.springframework.security.authentication.AnonymousAuthenticationToken@6fa86552: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@fffd148a: RemoteIpAddress: 127.0.0.1; SessionId: 659060E504E41E2F28CF873803A07F81; Granted Authorities: ROLE_ANONYMOUS' 12:03:23,312 DEBUG org.springframework.security.web.FilterChainProxy:318 - /j_acegi_cas_security_check?ticket=ST-1-eOK4CG7zd7cApkahlva9-casServer at position 10 of 12 in additional filter chain; firing Filter: 'SessionManagementFilter' 12:03:23,312 DEBUG org.springframework.security.web.FilterChainProxy:318 - /j_acegi_cas_security_check?ticket=ST-1-eOK4CG7zd7cApkahlva9-casServer at position 11 of 12 in additional filter chain; firing Filter: 'ExceptionTranslationFilter' 12:03:23,312 DEBUG org.springframework.security.web.FilterChainProxy:318 - /j_acegi_cas_security_check?ticket=ST-1-eOK4CG7zd7cApkahlva9-casServer at position 12 of 12 in additional filter chain; firing Filter: 'FilterSecurityInterceptor' 12:03:23,312 DEBUG org.springframework.security.web.access.intercept.FilterSecurityInterceptor:193 - Secure object: FilterInvocation: URL: /j_acegi_cas_security_check?ticket=ST-1-eOK4CG7zd7cApkahlva9-casServer; Attributes: [ROLE_USER] 12:03:23,312 DEBUG org.springframework.security.web.access.intercept.FilterSecurityInterceptor:298 - Previously Authenticated: org.springframework.security.authentication.AnonymousAuthenticationToken@6fa86552: Principal: anonymousUser; Credentials: [PROTECTED]; Authenticated: true; Details: org.springframework.security.web.authentication.WebAuthenticationDetails@fffd148a: RemoteIpAddress: 127.0.0.1; SessionId: 659060E504E41E2F28CF873803A07F81; Granted Authorities: ROLE_ANONYMOUS 12:03:23,312 DEBUG org.springframework.security.access.vote.AffirmativeBased:65 - Voter: org.springframework.security.access.vote.RoleVoter@13e02ed, returned: -1 12:03:23,312 DEBUG org.springframework.security.access.vote.AffirmativeBased:65 - Voter: org.springframework.security.access.vote.AuthenticatedVoter@322394, returned: 0 12:03:23,312 DEBUG org.springframework.security.web.access.ExceptionTranslationFilter:165 - Access is denied (user is anonymous); redirecting to authentication entry point org.springframework.security.access.AccessDeniedException: Access is denied at org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:83) at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:205) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:114) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:91) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:877) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:594) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1675) at java.lang.Thread.run(Thread.java:662) 12:03:23,312 DEBUG org.springframework.security.web.savedrequest.HttpSessionRequestCache:41 - DefaultSavedRequest added to Session: DefaultSavedRequest[http://localhost:8080/Cas_Client/j_acegi_cas_security_check?ticket=ST-1-eOK4CG7zd7cApkahlva9-casServer] 12:03:23,312 DEBUG org.springframework.security.web.access.ExceptionTranslationFilter:185 - Calling Authentication entry point. 12:03:23,312 DEBUG org.springframework.security.web.context.HttpSessionSecurityContextRepository:269 - SecurityContext is empty or contents are anonymous - context will not be stored in HttpSession. 12:03:23,343 DEBUG org.springframework.security.web.context.SecurityContextPersistenceFilter:97 - SecurityContextHolder now cleared, as request processing completed [/quote] [b]cas服务端配置:[/b] cas.properties [quote] #server.prefix=http://localhost:8080/cas #server.prefix=http://cas.wucht.com:8080/casServer server.prefix=http://localhost:8080/casServer cas.securityContext.serviceProperties.service=${server.prefix}/j_acegi_cas_security_check # Names of roles allowed to access the CAS service manager cas.securityContext.serviceProperties.adminRoles=ROLE_ADMIN cas.securityContext.casProcessingFilterEntryPoint.loginUrl=${server.prefix}/login cas.securityContext.ticketValidator.casServerUrlPrefix=${server.prefix} cas.themeResolver.defaultThemeName=cas-theme-default #cas.themeResolver.defaultThemeName=default cas.viewResolver.basename=default_views #host.name=cas host.name=casServer #database.hibernate.dialect=org.hibernate.dialect.OracleDialect database.hibernate.dialect=org.hibernate.dialect.MySQLDialect #database.hibernate.dialect=org.hibernate.dialect.HSQLDialect [/quote] deployerConfigContext.xml [quote] <?xml version="1.0" encoding="UTF-8"?> <!-- | deployerConfigContext.xml centralizes into one file some of the declarative configuration that | all CAS deployers will need to modify. | | This file declares some of the Spring-managed JavaBeans that make up a CAS deployment. | The beans declared in this file are instantiated at context initialization time by the Spring | ContextLoaderListener declared in web.xml. It finds this file because this | file is among those declared in the context parameter "contextConfigLocation". | | By far the most common change you will need to make in this file is to change the last bean | declaration to replace the default SimpleTestUsernamePasswordAuthenticationHandler with | one implementing your approach for authenticating usernames and passwords. +--> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:sec="http://www.springframework.org/schema/security" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"> <!-- | This bean declares our AuthenticationManager. The CentralAuthenticationService service bean | declared in applicationContext.xml picks up this AuthenticationManager by reference to its id, | "authenticationManager". Most deployers will be able to use the default AuthenticationManager | implementation and so do not need to change the class of this bean. We include the whole | AuthenticationManager here in the userConfigContext.xml so that you can see the things you will | need to change in context. +--> <bean id="authenticationManager" class="org.jasig.cas.authentication.AuthenticationManagerImpl"> <!-- | This is the List of CredentialToPrincipalResolvers that identify what Principal is trying to authenticate. | The AuthenticationManagerImpl considers them in order, finding a CredentialToPrincipalResolver which | supports the presented credentials. | | AuthenticationManagerImpl uses these resolvers for two purposes. First, it uses them to identify the Principal | attempting to authenticate to CAS /login . In the default configuration, it is the DefaultCredentialsToPrincipalResolver | that fills this role. If you are using some other kind of credentials than UsernamePasswordCredentials, you will need to replace | DefaultCredentialsToPrincipalResolver with a CredentialsToPrincipalResolver that supports the credentials you are | using. | | Second, AuthenticationManagerImpl uses these resolvers to identify a service requesting a proxy granting ticket. | In the default configuration, it is the HttpBasedServiceCredentialsToPrincipalResolver that serves this purpose. | You will need to change this list if you are identifying services by something more or other than their callback URL. +--> <property name="credentialsToPrincipalResolvers"> <list> <!-- | UsernamePasswordCredentialsToPrincipalResolver supports the UsernamePasswordCredentials that we use for /login | by default and produces SimplePrincipal instances conveying the username from the credentials. | | If you've changed your LoginFormAction to use credentials other than UsernamePasswordCredentials then you will also | need to change this bean declaration (or add additional declarations) to declare a CredentialsToPrincipalResolver that supports the | Credentials you are using. +--> <bean class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver"> <!--增加此属性,为认证过的用户的Principal添加属性--> <property name="attributeRepository" ref="attributeRepository"></property> </bean> <!-- | HttpBasedServiceCredentialsToPrincipalResolver supports HttpBasedCredentials. It supports the CAS 2.0 approach of | authenticating services by SSL callback, extracting the callback URL from the Credentials and representing it as a | SimpleService identified by that callback URL. | | If you are representing services by something more or other than an HTTPS URL whereat they are able to | receive a proxy callback, you will need to change this bean declaration (or add additional declarations). +--> <bean class="org.jasig.cas.authentication.principal.HttpBasedServiceCredentialsToPrincipalResolver" /> </list> </property> <!-- | Whereas CredentialsToPrincipalResolvers identify who it is some Credentials might authenticate, | AuthenticationHandlers actually authenticate credentials. Here we declare the AuthenticationHandlers that | authenticate the Principals that the CredentialsToPrincipalResolvers identified. CAS will try these handlers in turn | until it finds one that both supports the Credentials presented and succeeds in authenticating. +--> <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" /> --> <!-- 数据库认证.wucht--> <bean class="org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler"> <property name="dataSource" ref="dataSource" /> <property name="sql" value="select password from users where name=?" /> </bean> </list> </property> </bean> <!-- DATABASE 增加数据源配置 --> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property> <property name="url"><value>jdbc:mysql://localhost:3306/mysql?useUnicode=true&amp;characterEncoding=utf-8</value></property> <property name="username"><value>root</value></property> <property name="password"><value>root</value></property> </bean> <!-- This bean defines the security roles for the Services Management application. Simple deployments can use the in-memory version. More robust deployments will want to use another option, such as the Jdbc version. The name of this should remain "userDetailsService" in order for Spring Security to find it. --> <!-- <sec:user name="@@THIS SHOULD BE REPLACED@@" password="notused" authorities="ROLE_ADMIN" />--> <sec:user-service id="userDetailsService"> <sec:user name="@@THIS SHOULD BE REPLACED@@" password="notused" authorities="ROLE_ADMIN" /> </sec:user-service> <!-- Bean that defines the attributes that a service may return. This example uses the Stub/Mock version. A real implementation may go against a database or LDAP server. The id should remain "attributeRepository" though. --> <!-- <bean id="attributeRepository" class="org.jasig.services.persondir.support.StubPersonAttributeDao"> <property name="backingMap"> <map> <entry key="uid" value="uid" /> <entry key="eduPersonAffiliation" value="eduPersonAffiliation" /> <entry key="groupMembership" value="groupMembership" /> </map> </property> </bean> --> <!-- 使用SingleRowJdbcPersonAttributeDao 获取更多用户的信息 --> <bean id="attributeRepository" class="org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao"> <constructor-arg index="0" ref="dataSource"/> <constructor-arg index="1" value="select role_name from role where login_name = ?"/> <!--这里的key需写username,value对应数据库用户名字段 --> <property name="queryAttributeMapping"> <map> <entry key="username" value="login_name"/> </map> </property> <!--key对应数据库字段,value对应客户端获取参数 --> <!-- 返回数据认证后的数据 --> <property name="resultAttributeMapping"> <map> <!--这个从数据库中获取的角色,用于在应用中security的权限验证--> <entry key="role_name" value="authorities"/> </map> </property> </bean> <!-- Sample, in-memory data store for the ServiceRegistry. A real implementation would probably want to replace this with the JPA-backed ServiceRegistry DAO The name of this bean should remain "serviceRegistryDao". --> <bean id="serviceRegistryDao" class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl"> <!-- <property name="registeredServices"> <list> <bean class="org.jasig.cas.services.RegisteredServiceImpl"> <property name="id" value="0" /> <property name="name" value="HTTP" /> <property name="description" value="Only Allows HTTP Urls" /> <property name="serviceId" value="http://**" /> <property name="evaluationOrder" value="10000001" /> </bean> <bean class="org.jasig.cas.services.RegisteredServiceImpl"> <property name="id" value="1" /> <property name="name" value="HTTPS" /> <property name="description" value="Only Allows HTTPS Urls" /> <property name="serviceId" value="https://**" /> <property name="evaluationOrder" value="10000002" /> </bean> <bean class="org.jasig.cas.services.RegisteredServiceImpl"> <property name="id" value="2" /> <property name="name" value="IMAPS" /> <property name="description" value="Only Allows HTTPS Urls" /> <property name="serviceId" value="imaps://**" /> <property name="evaluationOrder" value="10000003" /> </bean> <bean class="org.jasig.cas.services.RegisteredServiceImpl"> <property name="id" value="3" /> <property name="name" value="IMAP" /> <property name="description" value="Only Allows IMAP Urls" /> <property name="serviceId" value="imap://**" /> <property name="evaluationOrder" value="10000004" /> </bean> </list> </property> --> </bean> <bean id="auditTrailManager" class="com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager" /> </beans> [/quote] [b]spring的配置代码如下:[/b][code="ruby"] <?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:beans="http://www.springframework.org/schema/beans" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd" default-lazy-init="true"> <!-- entry-point-ref="casEntryPoint"作用是认证的入口,是一个实现AuthenticationEntryPoint接口的类 ,为ExceptionTranslationFilter类提供认证依据, <custom-filter position="FORM_LOGIN_FILTER" ref="casFilter"/> 使用自定义的Filter,放置在过滤器链的FORM_LOGIN_FILTER的位置 casEntryPoint只是提供认证入口的作用,当没有权限,将跳转到该地址。 casFilter是处理CAS service ticket的,当无权访问时,会使用casEntryPoint提供认证入口 --> <http auto-config="true" entry-point-ref="casEntryPoint" access-denied-page="/403.jsp"> <intercept-url pattern="/**" access="ROLE_USER" /> <!-- ROLE_ADMIN--> <!-- logout-success-url="/login.html" --> <!-- 注销时需要先注销应用程序,再注销cas中心认证服务 --> <logout logout-url="/logout.html" success-handler-ref="casLogoutSuccessHandler" /> <custom-filter position="CAS_FILTER" ref="casFilter" /> </http> <authentication-manager alias="authenticationManager"> <authentication-provider ref="casAuthenticationProvider" /> </authentication-manager> <!-- cas中心认证服务入口 --> <beans:bean id="casEntryPoint" class="org.springframework.security.cas.web.CasAuthenticationEntryPoint"> <beans:property name="loginUrl" value="http://localhost:8080/casServer/login" /> <beans:property name="serviceProperties" ref="serviceProperties" /> </beans:bean> <!-- cas中心认证服务配置 --> <beans:bean id="serviceProperties" class="org.springframework.security.cas.ServiceProperties"> <beans:property name="service" value="http://localhost:8080/Cas_Client/j_acegi_cas_security_check" /> <beans:property name="sendRenew" value="false" /> </beans:bean> <!-- CAS service ticket(中心认证服务凭据)验证 --> <beans:bean id="casFilter" class="org.springframework.security.cas.web.CasAuthenticationFilter"> <beans:property name="authenticationManager" ref="authenticationManager" /> <!-- <beans:property name="authenticationFailureHandler">--> <!-- <beans:bean--> <!-- class="org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler">--> <!-- <beans:property name="defaultFailureUrl"--> <!-- value="/logout.html" />--> <!-- </beans:bean>--> <!-- </beans:property>--> <!-- 登录成功后的页面,如果是固定的。否则 ref="authenticationSuccessHandler" --> <!-- <beans:property name="authenticationSuccessHandler">--> <!-- <beans:bean--> <!-- class="org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler">--> <!-- <beans:property name="defaultTargetUrl"--> <!-- value="/index.jsp" />--> <!-- </beans:bean>--> <!-- </beans:property>--> </beans:bean> <!-- 从Cas Server得到用户信息 --> <beans:bean id="authenticationUserDetailsService" class="org.springframework.security.cas.userdetails.GrantedAuthorityFromAssertionAttributesUserDetailsService"> <beans:constructor-arg> <beans:array> <beans:value>authorities</beans:value> </beans:array> </beans:constructor-arg> </beans:bean> <beans:bean id="userDetailsService" class="com.reportstart.security.service.impl.BocUserDetaislServiceImpl"> <!-- <beans:property name="userDao">--> <!-- <beans:ref bean="userDao" />--> <!-- </beans:property>--> </beans:bean> <!-- <beans:bean id="authenticationUserDetailsService"--> <!-- class="org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper">--> <!-- <beans:property name="userDetailsService">--> <!-- <beans:ref local="userDetailsService" />--> <!-- </beans:property>--> <!-- </beans:bean>--> <beans:bean id="casAuthenticationProvider" class="org.springframework.security.cas.authentication.CasAuthenticationProvider"> <!-- 使用自定义service获取用户信息 --> <!-- <beans:property name="authenticationUserDetailsService"--> <!-- ref="casAuthenticationUserDetailsService" />--> <!-- 通过Cas Server获取用户信息 --> <beans:property name="authenticationUserDetailsService" ref="authenticationUserDetailsService" /> <beans:property name="serviceProperties" ref="serviceProperties" /> <beans:property name="ticketValidator"> <beans:bean class="org.jasig.cas.client.validation.Cas20ServiceTicketValidator"> <beans:constructor-arg index="0" value="http://localhost:8080/casServer" /> </beans:bean> </beans:property> <!-- 自定义cas客户端应用标示.wucht.2012-6-4(每个cas客户端都需要一个key标示用于区分不同cas客户端) --> <beans:property name="key" value="Cas_Client" /> </beans:bean> <!-- 注销 --> <beans:bean id="casLogoutSuccessHandler" class="com.wucht.test.CasLogoutSuccessHandler"> </beans:bean> </beans:beans>[/code]
相见恨晚的超实用网站
搞学习 知乎:www.zhihu.com 简答题:http://www.jiandati.com/ 网易公开课:https://open.163.com/ted/ 网易云课堂:https://study.163.com/ 中国大学MOOC:www.icourse163.org 网易云课堂:study.163.com 哔哩哔哩弹幕网:www.bilibili.com 我要自学网:www.51zxw
花了20分钟,给女朋友们写了一个web版群聊程序
参考博客 [1]https://www.byteslounge.com/tutorials/java-ee-html5-websocket-example
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
字节跳动视频编解码面经
引言 本文主要是记录一下面试字节跳动的经历。 三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时
开源一个功能完整的SpringBoot项目框架
福利来了,给大家带来一个福利。 最近想了解一下有关Spring Boot的开源项目,看了很多开源的框架,大多是一些demo或者是一个未成形的项目,基本功能都不完整,尤其是用户权限和菜单方面几乎没有完整的。 想到我之前做的框架,里面通用模块有:用户模块,权限模块,菜单模块,功能模块也齐全了,每一个功能都是完整的。 打算把这个框架分享出来,供大家使用和学习。 为什么用框架? 框架可以学习整体
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
Python——画一棵漂亮的樱花树(不同种樱花+玫瑰+圣诞树喔)
最近翻到一篇知乎,上面有不少用Python(大多是turtle库)绘制的树图,感觉很漂亮,我整理了一下,挑了一些我觉得不错的代码分享给大家(这些我都测试过,确实可以生成喔~) one 樱花树 动态生成樱花 效果图(这个是动态的): 实现代码 import turtle as T import random import time # 画樱花的躯干(60,t) def Tree(branch
深深的码丨Java HashMap 透析
HashMap 相关概念 HashTab、HashMap、TreeMap 均以键值对像是存储或操作数据元素。HashTab继承自Dictionary,HashMap、TreeMap继承自AbstractMap,三者均实现Map接口 **HashTab:**同步哈希表,不支持null键或值,因为同步导致性能影响,很少被使用 **HashMap:**应用较多的非同步哈希表,支持null键或值,是键值对...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
Python 基础(一):入门必备知识
目录1 标识符2 关键字3 引号4 编码5 输入输出6 缩进7 多行8 注释9 数据类型10 运算符10.1 常用运算符10.2 运算符优先级 1 标识符 标识符是编程时使用的名字,用于给变量、函数、语句块等命名,Python 中标识符由字母、数字、下划线组成,不能以数字开头,区分大小写。 以下划线开头的标识符有特殊含义,单下划线开头的标识符,如:_xxx ,表示不能直接访问的类属性,需通过类提供
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
JDK12 Collectors.teeing 你真的需要了解一下
前言 在 Java 12 里面有个非常好用但在官方 JEP 没有公布的功能,因为它只是 Collector 中的一个小改动,它的作用是 merge 两个 collector 的结果,这句话显得很抽象,老规矩,我们先来看个图(这真是一个不和谐的图????): 管道改造经常会用这个小东西,通常我们叫它「三通」,它的主要作用就是将 downstream1 和 downstre...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
加快推动区块链技术和产业创新发展,2019可信区块链峰会在京召开
11月8日,由中国信息通信研究院、中国通信标准化协会、中国互联网协会、可信区块链推进计划联合主办,科技行者协办的2019可信区块链峰会将在北京悠唐皇冠假日酒店开幕。   区块链技术被认为是继蒸汽机、电力、互联网之后,下一代颠覆性的核心技术。如果说蒸汽机释放了人类的生产力,电力解决了人类基本的生活需求,互联网彻底改变了信息传递的方式,区块链作为构造信任的技术有重要的价值。   1...
程序员把地府后台管理系统做出来了,还有3.0版本!12月7号最新消息:已在开发中有github地址
第一幕:缘起 听说阎王爷要做个生死簿后台管理系统,我们派去了一个程序员…… 996程序员做的梦: 第一场:团队招募 为了应对地府管理危机,阎王打算找“人”开发一套地府后台管理系统,于是就在地府总经办群中发了项目需求。 话说还是中国电信的信号好,地府都是满格,哈哈!!! 经常会有外行朋友问:看某网站做的不错,功能也简单,你帮忙做一下? 而这次,面对这样的需求,这个程序员...
相关热词 c# plc s1200 c#里氏转换原则 c# 主界面 c# do loop c#存为组套 模板 c# 停掉协程 c# rgb 读取图片 c# 图片颜色调整 最快 c#多张图片上传 c#密封类与密封方法
立即提问