当前位置: 首页 > 编程日记 > 正文

CAS (10) —— JBoss EAP 6.4下部署CAS时出现错误exception.message=Error decoding flow execution的解决办法...

CAS (10) —— JBoss EAP 6.4下部署CAS时出现错误exception.message=Error decoding flow execution的解决办法


jboss版本: jboss-eap-6.4-CVE-2015-7501

jdk版本: 1.7.0_79

cas版本: cas 4.1.3

参考来源:

Nabble: exception.message=Error+decoding+flow+execution

Nabble: Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.Slf4jLogger from [Module "deployment.cas.war:main" from Service Module Loader]

JBoss7.1.1版本和CAS3的集成(未完)

CAS 4.1.1 - JDBC authentication, failed to deploy

Securing JBoss EAP 6 - Implementing SSL

JBoss eap 6.4 mutual (two way) ssl configuration

Tomcat (1) —— Mac下配置Tomcat Https/SSL

问题描述

在CAS部署到jboss后台启动时会出现下面错误1,如果忽略此问题,在登录成功并且尝试重定会应用的页面时,会在重定向url后面加上&exception.message=Error+decoding+flow+execution字样,下面所描述的错误2。

1. Slf4jLogger

    15:28:30,587 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/cas].[cas]] (http-/0.0.0.0:8443-3) JBWEB000236: Servlet.service() for servlet cas threw exception: java.lang.ClassNotFoundException: org.slf4j.impl.Slf4jLogger from [Module "deployment.cas.war:main" from Service Module Loader]at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.6.Final-redhat-1]at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.6.Final-redhat-1]at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.6.Final-redhat-1]at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.6.Final-redhat-1]at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.6.Final-redhat-1]at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_79]at java.lang.Class.forName(Class.java:274) [rt.jar:1.7.0_79]at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:625) [rt.jar:1.7.0_79]at org.hibernate.internal.util.SerializationHelper$CustomObjectInputStream.resolveClass(SerializationHelper.java:369) [hibernate-core-4.3.10.Final.jar:4.3.10.Final]at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1612) [rt.jar:1.7.0_79]at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517) [rt.jar:1.7.0_79]at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771) [rt.jar:1.7.0_79]at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) [rt.jar:1.7.0_79]

613455-20160112140707647-509039132.png

2. exception.message=

https://proxy.sso.hoau.com/cas/login?service=https%3A%2F%2Fapp1.hoau.com%3A8413%2Fcas1&exception.message=Error+decoding+flow+execution

613455-20160112140730616-1453037929.png

解决方案

在应用中去掉jboss容器自带的slf4j的依赖

1. 在路径/../webapp/WEB-INF/下

新建文件"jboss-deployment-structure.xml"

2. 文件配置如下

    <jboss-deployment-structure><deployment><exclusions><module name="org.slf4j" /><module name="org.slf4j.impl" /><module name="org.slf4j.jcl-over-slf4j" /><module name="org.slf4j.ext" /></exclusions></deployment></jboss-deployment-structure>

3. 重新发布

扩展

依照以上方法就可以解决本文主要关注的两个问题,但是这种方案会使我们引入一个新的问题。在jboss启动的时候服务器仍然会报slf4j的错误SLF4J: Class path contains multiple SLF4J bindings.

    14:09:52,144 ERROR [stderr] (ServerService Thread Pool -- 158)SLF4J: Class path contains multiple SLF4J bindings.14:09:52,145 ERROR [stderr] (ServerService Thread Pool -- 158) SLF4J: Found binding in [vfs:/content/cas.war/WEB-INF/lib/cas-server-core-4.1.3.jar/org/slf4j/impl/StaticLoggerBinder.class]14:09:52,145 ERROR [stderr] (ServerService Thread Pool -- 158) SLF4J: Found binding in [vfs:/content/cas.war/WEB-INF/lib/log4j-slf4j-impl-2.3.jar/org/slf4j/impl/StaticLoggerBinder.class]14:09:52,145 ERROR [stderr] (ServerService Thread Pool -- 158) SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.14:09:52,221 ERROR [stderr] (ServerService Thread Pool -- 158) SLF4J: ILoggerFactory to be used for logging is: org.apache.logging.slf4j.Log4jLoggerFactory14:09:52,221 ERROR [stderr] (ServerService Thread Pool -- 158) SLF4J: Actual binding is of type [org.slf4j.impl.CasLoggerFactory]14:09:52,221 ERROR [stderr] (ServerService Thread Pool -- 158) SLF4J: The following set of substitute loggers may have been accessed14:09:52,221 ERROR [stderr] (ServerService Thread Pool -- 158) SLF4J: during the initialization phase. Logging calls during this14:09:52,221 ERROR [stderr] (ServerService Thread Pool -- 158) SLF4J: phase were not honored. However, subsequent logging calls to these14:09:52,221 ERROR [stderr] (ServerService Thread Pool -- 158) SLF4J: loggers will work as normally expected.14:09:52,222 ERROR [stderr] (ServerService Thread Pool -- 158) SLF4J: See also http://www.slf4j.org/codes.html#substituteLogger14:09:52,627 ERROR [stderr] (ServerService Thread Pool -- 158) SLF4J: org.reflections.Reflections

尝试解决此问题

首先我们在的根目录下,从命令行运行,查看依赖树

/cas-server-webapp$mvn dependency:tree

输出结果:

    [INFO] Scanning for projects...[INFO][INFO] ------------------------------------------------------------------------[INFO] Building Apereo CAS Web Application 4.1.3[INFO] ------------------------------------------------------------------------[INFO][INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ cas-server-webapp ---[INFO] org.jasig.cas:cas-server-webapp:war:4.1.3[INFO] +- org.jasig.cas:cas-server-webapp-support:jar:4.1.3:compile[INFO] |  +- org.jasig.inspektr:inspektr-support-spring:jar:1.3.GA:runtime[INFO] |  |  +- org.jasig.inspektr:inspektr-audit:jar:1.3.GA:compile[INFO] |  |  +- org.jasig.inspektr:inspektr-error:jar:1.3.GA:runtime[INFO] |  |  +- org.jasig.inspektr:inspektr-common:jar:1.3.GA:compile[INFO] |  |  +- org.springframework:spring-web:jar:4.1.8.RELEASE:compile[INFO] |  |  +- org.springframework:spring-webmvc:jar:4.1.8.RELEASE:compile[INFO] |  |  \- org.springframework:spring-tx:jar:4.1.8.RELEASE:compile[INFO] |  +- org.springframework.security:spring-security-core:jar:4.0.1.RELEASE:compile[INFO] |  |  +- aopalliance:aopalliance:jar:1.0:compile[INFO] |  |  \- org.springframework:spring-context:jar:4.1.8.RELEASE:compile[INFO] |  +- org.springframework.security:spring-security-web:jar:4.0.1.RELEASE:compile[INFO] |  +- org.springframework.security:spring-security-config:jar:4.0.1.RELEASE:runtime[INFO] |  +- org.springframework:spring-aop:jar:4.1.8.RELEASE:compile[INFO] |  +- org.jasig.cas:cas-server-core:jar:4.1.3:compile[INFO] |  |  +- org.jasig.cas:cas-server-core-api:jar:4.1.3:compile[INFO] |  |  +- org.jasig.service.persondir:person-directory-impl:jar:1.7.0:compile[INFO] |  |  |  +- org.ldaptive:ldaptive:jar:1.0.7:compile[INFO] |  |  |  +- com.sun.xml.bind:jaxb-impl:jar:2.2.7:compile[INFO] |  |  |  |  +- com.sun.xml.bind:jaxb-core:jar:2.2.7:compile[INFO] |  |  |  |  |  +- javax.xml.bind:jaxb-api:jar:2.2.7:compile[INFO] |  |  |  |  |  \- com.sun.istack:istack-commons-runtime:jar:2.16:compile[INFO] |  |  |  |  \- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.12:compile[INFO] |  |  |  |     \- javax.xml.bind:jsr173_api:jar:1.0:compile[INFO] |  |  |  \- org.jasig.service.persondir:person-directory-api:jar:1.7.0:compile[INFO] |  |  +- commons-codec:commons-codec:jar:1.10:compile[INFO] |  |  +- org.springframework.webflow:spring-webflow:jar:2.4.1.RELEASE:compile[INFO] |  |  |  +- opensymphony:ognl:jar:2.6.11:compile[INFO] |  |  |  +- org.springframework.webflow:spring-binding:jar:2.4.1.RELEASE:compile[INFO] |  |  |  \- org.springframework.webflow:spring-js:jar:2.4.1.RELEASE:compile[INFO] |  |  |     \- org.springframework.webflow:spring-js-resources:jar:2.4.1.RELEASE:compile[INFO] |  |  +- commons-jexl:commons-jexl:jar:1.1:runtime[INFO] |  |  +- commons-io:commons-io:jar:2.4:compile[INFO] |  |  +- joda-time:joda-time:jar:2.8.1:compile[INFO] |  |  +- org.reflections:reflections:jar:0.9.10:compile[INFO] |  |  |  +- org.javassist:javassist:jar:3.19.0-GA:compile[INFO] |  |  |  \- com.google.code.findbugs:annotations:jar:2.0.1:compile[INFO] |  |  +- org.apache.httpcomponents:httpclient:jar:4.4.1:compile[INFO] |  |  |  \- org.apache.httpcomponents:httpcore:jar:4.4.1:compile[INFO] |  |  +- javax.cache:cache-api:jar:1.0.0:compile[INFO] |  |  +- org.jsr107.ri:cache-ri-impl:jar:1.0.0:runtime[INFO] |  |  |  \- javax.enterprise:cdi-api:jar:1.0-SP4:runtime[INFO] |  |  |     +- org.jboss.spec.javax.interceptor:jboss-interceptors-api_1.1_spec:jar:1.0.0.Beta1:runtime[INFO] |  |  |     +- javax.annotation:jsr250-api:jar:1.0:runtime[INFO] |  |  |     \- javax.inject:javax.inject:jar:1:runtime[INFO] |  |  +- com.google.guava:guava:jar:18.0:compile[INFO] |  |  +- org.bitbucket.b_c:jose4j:jar:0.4.1:compile[INFO] |  |  \- org.apache.commons:commons-collections4:jar:4.0:compile[INFO] |  +- org.jasig.cas:cas-server-support-generic:jar:4.1.3:runtime[INFO] |  +- org.springframework:spring-context-support:jar:4.1.8.RELEASE:compile[INFO] |  +- org.codehaus.woodstox:woodstox-core-asl:jar:4.4.1:runtime[INFO] |  |  +- javax.xml.stream:stax-api:jar:1.0-2:runtime[INFO] |  |  \- org.codehaus.woodstox:stax2-api:jar:3.1.4:runtime[INFO] |  +- org.quartz-scheduler:quartz:jar:2.2.1:runtime[INFO] |  +- org.jasig:spring-webflow-client-repo:jar:1.0.0:runtime[INFO] |  |  +- org.slf4j:jcl-over-slf4j:jar:1.7.7:runtime[INFO] |  |  \- org.cryptacular:cryptacular:jar:1.0:runtime[INFO] |  |     \- org.bouncycastle:bcprov-jdk15on:jar:1.50:runtime[INFO] |  +- com.sun.jersey:jersey-core:jar:1.19:compile[INFO] |  |  \- javax.ws.rs:jsr311-api:jar:1.1.1:compile[INFO] |  +- com.sun.jersey:jersey-server:jar:1.19:compile[INFO] |  +- com.sun.jersey:jersey-servlet:jar:1.19:compile[INFO] |  +- com.sun.jersey.contribs:jersey-spring:jar:1.19:runtime[INFO] |  \- org.apache.logging.log4j:log4j-web:jar:2.3:runtime[INFO] +- org.jasig.cas:cas-server-support-jdbc:jar:4.1.3:compile[INFO] |  +- org.apache.commons:commons-lang3:jar:3.4:compile[INFO] |  +- org.springframework:spring-jdbc:jar:4.1.8.RELEASE:compile[INFO] |  +- org.springframework:spring-orm:jar:4.1.8.RELEASE:compile[INFO] |  \- org.apache.shiro:shiro-core:jar:1.2.3:compile[INFO] |     \- commons-beanutils:commons-beanutils:jar:1.8.3:compile[INFO] +- mysql:mysql-connector-java:jar:5.1.37:compile[INFO] +- com.mchange:c3p0:jar:0.9.5.1:compile[INFO] +- com.mchange:mchange-commons-java:jar:0.2.10:compile[INFO] +- org.hibernate:hibernate-core:jar:4.3.10.Final:compile[INFO] |  +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile[INFO] |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.0.Final:compile[INFO] |  +- dom4j:dom4j:jar:1.6.1:compile[INFO] |  |  \- xml-apis:xml-apis:jar:1.4.01:compile[INFO] |  +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.5.Final:compile[INFO] |  +- antlr:antlr:jar:2.7.7:compile[INFO] |  \- org.jboss:jandex:jar:1.1.0.Final:compile[INFO] +- org.hibernate:hibernate-entitymanager:jar:4.3.10.Final:compile[INFO] |  \- org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile[INFO] +- org.hibernate:hibernate-validator:jar:5.1.3.Final:compile[INFO] |  \- com.fasterxml:classmate:jar:1.0.0:compile[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile[INFO] +- org.springframework:spring-expression:jar:4.1.8.RELEASE:runtime[INFO] |  \- org.springframework:spring-core:jar:4.1.8.RELEASE:compile[INFO] +- javax.servlet:jstl:jar:1.2:runtime[INFO] +- taglibs:standard:jar:1.1.2:runtime[INFO] +- org.jasig.cas:cas-server-security-filter:jar:2.0.4:runtime[INFO] +- com.ryantenney.metrics:metrics-spring:jar:3.1.0:runtime[INFO] |  +- io.dropwizard.metrics:metrics-core:jar:3.1.2:compile[INFO] |  +- io.dropwizard.metrics:metrics-healthchecks:jar:3.1.2:runtime[INFO] |  +- io.dropwizard.metrics:metrics-annotation:jar:3.1.2:compile[INFO] |  \- org.springframework:spring-beans:jar:4.1.8.RELEASE:compile[INFO] +- io.dropwizard.metrics:metrics-jvm:jar:3.1.2:runtime[INFO] +- io.dropwizard.metrics:metrics-servlets:jar:3.1.2:runtime[INFO] |  +- io.dropwizard.metrics:metrics-json:jar:3.1.2:runtime[INFO] |  \- com.fasterxml.jackson.core:jackson-databind:jar:2.5.3:compile[INFO] |     +- com.fasterxml.jackson.core:jackson-annotations:jar:2.5.0:compile[INFO] |     \- com.fasterxml.jackson.core:jackson-core:jar:2.5.3:compile[INFO] +- junit:junit:jar:4.12:test[INFO] |  \- org.hamcrest:hamcrest-core:jar:1.3:test[INFO] +- org.mockito:mockito-core:jar:1.10.19:test[INFO] |  \- org.objenesis:objenesis:jar:2.1:test[INFO] +- org.springframework:spring-test:jar:4.1.8.RELEASE:test[INFO] +- javax.servlet:javax.servlet-api:jar:3.0.1:provided[INFO] +- org.aspectj:aspectjrt:jar:1.8.6:compile[INFO] +- org.aspectj:aspectjweaver:jar:1.8.6:compile[INFO] +- javax.validation:validation-api:jar:1.1.0.Final:compile[INFO] +- javax.el:javax.el-api:jar:3.0.0:provided[INFO] +- org.glassfish.web:javax.el:jar:2.2.6:runtime[INFO] +- org.slf4j:slf4j-api:jar:1.7.12:compile[INFO] +- org.slf4j:jul-to-slf4j:jar:1.7.12:runtime[INFO] +- org.apache.logging.log4j:log4j-api:jar:2.3:runtime[INFO] +- org.apache.logging.log4j:log4j-core:jar:2.3:runtime[INFO] +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.3:runtime[INFO] +- org.apache.logging.log4j:log4j-jcl:jar:2.3:runtime[INFO] |  \- commons-logging:commons-logging:jar:1.2:runtime[INFO] \- org.jasig.inspektr:inspektr-aspects:jar:1.3.GA:compile[INFO] ------------------------------------------------------------------------[INFO] BUILD SUCCESS[INFO] ------------------------------------------------------------------------[INFO] Total time: 1.934 s[INFO] Finished at: 2016-01-12T14:14:58+08:00[INFO] Final Memory: 21M/439M       

经查看发现org.slf4j.impl.StaticLoggerBinder被打入了cas-server-core中,暂时不知道cas的核心开发何故为此,由于cas-server-core是核心jar,我们是否能够直接移除org.apache.logging.log4j:log4j-slf4j-impl:jar:2.3:runtime这个依赖?

    /** Licensed to Apereo under one or more contributor license* agreements. See the NOTICE file distributed with this work* for additional information regarding copyright ownership.* Apereo licenses this file to you under the Apache License,* Version 2.0 (the "License"); you may not use this file* except in compliance with the License.  You may obtain a* copy of the License at the following location:**   http://www.apache.org/licenses/LICENSE-2.0** Unless required by applicable law or agreed to in writing,* software distributed under the License is distributed on an* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY* KIND, either express or implied.  See the License for the* specific language governing permissions and limitations* under the License.*/package org.slf4j.impl;import org.slf4j.ILoggerFactory;import org.slf4j.spi.LoggerFactoryBinder;/*** The static binder for slf4j logging, which allows CAS* to select its own {@link org.slf4j.ILoggerFactory} instance at runtime.* Note that this class MUST reside in the <code>org.slf4j.impl</code>* package so it can be loaded by the runtime dynamic lookup.* @author Misagh Moayyed* @since 4.1.0*/public final class StaticLoggerBinder implements LoggerFactoryBinder {/*** The unique instance of this class.*/private static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder();/*** The {@link ILoggerFactory} instance returned by the* {@link #getLoggerFactory} method should always be the same* object.*/private final ILoggerFactory loggerFactory;/*** Instantiates a new Static logger binder.*/private StaticLoggerBinder() {this.loggerFactory = new CasLoggerFactory();}/*** Return the singleton of this class.** @return the StaticLoggerBinder singleton*/public static StaticLoggerBinder getSingleton() {return SINGLETON;}public ILoggerFactory getLoggerFactory() {return this.loggerFactory;}public String getLoggerFactoryClassStr() {return CasLoggerFactory.class.getName();}}

修改pom.xml

<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-war-plugin</artifactId><configuration><warName>cas</warName><webResources><resource><directory>${basedir}/src/main/webapp/WEB-INF</directory><filtering>true</filtering><targetPath>WEB-INF</targetPath><includes><include>**/web.xml</include></includes></resource></webResources><!--Richard Customized--><!--<packagingExcludes>--><!--WEB-INF/lib/log4j-slf4j-impl-*.jar--><!--</packagingExcludes>--></configuration></plugin>

如果去掉org.apache.logging.log4j:log4j-slf4j-impl:jar:2.3:runtime这个依赖在部署时会出错,可是目前的实现方式是显示的在slf4j中override掉原来的实现,实例化CAS自己的LogFactory

// Line:
private StaticLoggerBinder() {this.loggerFactory = new CasLoggerFactory();
}   

此问题待解

目前状态

网上很多文章介绍关于jaxb和jersey在jboss下使用方法,但是此处的警告消息warn并不会消除,这是当前6.4版本的一个bug,请参考JBEAP-69

结束

相关文章:

昇思MindSpore1.6发布 AI开发者体验再升级

智能时代&#xff0c;AI技术正在发挥至关重要的作用&#xff0c;而开源的深度学习框架不仅能够降低AI开发者的门槛&#xff0c;而且能够极大节省成本与时间&#xff0c;成为创新的重要推手。2022年3月26-27日&#xff0c;昇思MindSpore TechDay活动线上成功举办&#xff0c;包含…

深入解析:TRUNCATE TABLE 的内部原理解析与恢复思路

摘要 众所周知&#xff0c;truncate table 是一种快速清空表内数据的一种方式&#xff0c;与 delete 方式不同&#xff0c;truncate 只产生非常少的 redo 和 undo&#xff0c;就实现了清空表数据并降低表 HWM 的功能。本文主要围绕 truncate table 的实现原理和 truncate table…

Linux exec与重定向

exec和source都属于bash内部命令&#xff08;builtins commands&#xff09;&#xff0c;在bash下输入man exec或man source可以查看所有的内部命令信息。 bash shell的命令分为两类&#xff1a;外部命令和内部命令。外部命令是通过系统调用或独立的程序实现的&#xff0c;如se…

俄罗斯 Android 系统受限,或将转用 HarmonyOS!

整理 | 郑丽媛出品 | CSDN近一个月来&#xff0c;受当前局势影响&#xff0c;部分底层工具、基础软件、开源项目已相继宣布在俄罗斯停服&#xff0c;期间不少人因此担忧&#xff1a;同出自美国且占据极大智能手机市场的 Android 和 iOS 是否会趁机“作乱”&#xff1f;结果&…

Ios应用网络安全之https

戴维营教育原创文章&#xff0c;转载请注明出处。我们的梦想是做最好的iOS开发培训&#xff01;iOS应用网络安全之HTTPS1. HTTPS/SSL的基本原理安全套接字层 (Secure Socket Layer, SSL) 是用来实现互联网安全通信的最普遍的标准。Web 应用程序使用 HTTPS&#xff08;基于 SSL …

云原生应用的10大关键属性

2019独角兽企业重金招聘Python工程师标准>>> “云原生”是用于描述基于容器的环境的术语&#xff0c;而Kubernetes是一个运行云原生应用程序工作负载的理想平台。 开发人员在设计云原生应用程序时&#xff0c;一定要牢记本文内这10个关键属性&#xff01; “云原生&…

grep 正则表达式及选项以及注意

说明&#xff1a;在原文基础上稍作了修改grep命令简介&#xff1a; 在ex编辑器&#xff08;我没用过&#xff09;中&#xff0c;启动ex编辑器后要查找某个字符串时&#xff0c;在ex的命令提示符后键入::/pattern/p:/g/pattern/pgrep这个名字就由来如此。其中p的含义是print&…

iOS_25彩票_幸运转盘

终于效果图: 各个view的关系图: 背景圆盘(须要扣图处理)LuckyBaseBackground.png 盖在背景圆盘上面的转盘 LuckyRotateWheel.png 代表一个星座或生肖的button背景图片 要创建12个,并以最下方中点为锚点进行旋转 对背景圆盘进行扣图,并在其上面盖上转盘图片的核心代码 在自己定义…

Python 自动化办公之 Excel 对比工具

作者 | 周萝卜来源丨萝卜大杂烩今天我们继续分享真实的自动化办公案例&#xff0c;希望各位 Python 爱好者能够从中得到些许启发&#xff0c;在自己的工作生活中更多的应用 Python&#xff0c;使得工作事半功倍&#xff01;需求由于工作当中经常需要对比前后两个 Excel 文件&am…

jQuery简单实现iframe的高度根据页面内容自适应的方法(转)

本文实例讲述了jQuery简单实现iframe的高度根据页面内容自适应的方法。分享给大家供大家参考&#xff0c;具体如下&#xff1a;方式1&#xff1a;//注意&#xff1a;下面的代码是放在和iframe同一个页面中调用 $("#iframeId").load(function () {var mainheight $(t…

linux wc 命令简介

此wc命令不是让大家没有食欲的地方。而是linux下一个简单的小命令。NAMEwc — word, line, character, and byte countSYNOPSISwc [-clmw] [file ...]下面让我们来简单的看一下其支持的参数及其代表的含义。 参数及含义 参数含义-c显示文件的Bytes数(字节数)-l将每个文件的行数…

这个插件竟打通了Python和Excel,还能自动生成代码!

作者 | 云朵君来源丨数据STUDIO加载一个Jupyter插件后&#xff0c;无需写代码就能做数据分析&#xff0c;还帮你生成相应代码&#xff1f;没错&#xff0c;只需要加载这个名为Mito的小工具包&#xff0c;用Python做数据分析&#xff0c;变得和用Excel一样简单&#xff1a;介绍以…

集合list set Map问题

2019独角兽企业重金招聘Python工程师标准>>> ####集合list set Map的个人理解 首先集合说的对一类数据的存储容器&#xff0c;对象都是引用类型并不是基本数据类型 collection 接口 list和set都需实现它 collections 抽象了一些集合的基本功能&#xff0c;reverse s…

python学习第四课

#!/user/bin/env python#-*-coding:utf-8-*-# 一、字符串魔法# &#xff08;1&#xff09;.isalpha()是否是字母或汉字。# 例&#xff1a;# a"张san22"# b"张三lisi"# va.isalpha()# v1b.isalpha()# print(v)# print(v1)# 因为a里含有数字&#xff0c;结果…

PHP 截取字符串专题

1. 截取GB2312中文字符串<?php< ?php//截取中文字符串functionmysubstr($str, $start, $len){$tmpstr ""; $strlen $start $len; for($i 0; $i< $strlen; $i){if(ord(substr($str, $i, 1))> 0xa0){$tmpstr. substr($str, $i, 2); $i; }else$tm…

​GPT-3好“搭档”:这种方法缓解模型退化,让输出更自然

作者 | LZM来源丨数据实战派文本生成对于许多自然语言处理应用来说都是非常重要的。但神经语言模型的基于最大化的解码方法&#xff08;如 beam search&#xff09;往往导致退化解&#xff0c;即生成的文本是不自然的&#xff0c;并且常常包含不必要的重复。现有的方法通过采样…

(Question)CSS中position的绝对定位问题

RT,绝对定位相对于定位的元素存在是哪里&#xff1f; https://yunpan.cn/crjSMTiak2srZ 访问密码 1570转载于:https://www.cnblogs.com/LiuChunfu/p/5139958.html

BZOJ 4817: [Sdoi2017]树点涂色(LCT+树剖+线段树)

题目描述 Bob有一棵 nn 个点的有根树&#xff0c;其中1号点是根节点。Bob在每个点上涂了颜色&#xff0c;并且每个点上的颜色不同。 定义一条路径的权值是&#xff1a;这条路径上的点&#xff08;包括起点和终点&#xff09;共有多少种不同的颜色。 Bob可能会进行这几种操作&am…

ls -l |wc -l命令多统计一行

#ls -l |wc -l注意&#xff1a;总用量也占用1行&#xff0c;所以统计出来的是14而不是13其他网友提醒 #ls -l |wc -l 就统计实际的行&#xff0c;放大就看出效果1和l不同

驱动数字经济加速,摩尔线程发布全新元计算架构MUSA和GPU产品

2022年3月30日&#xff0c;北京——摩尔线程今天举行主题为“元动力 创无限”的春季发布会。摩尔线程创始人兼CEO张建中解读了“元计算”这一产业趋势&#xff0c;并发布全新架构及系列重磅新品&#xff0c;包括&#xff1a;MUSA&#xff08;Moore Threads Unified System Arch…

HDU 4869 Turn the pokers(思维+组合公式+高速幂)

Turn the pokers 大意&#xff1a;给出n次操作&#xff0c;给出m个扑克。然后给出n个操作的个数a[i]&#xff0c;每一个a[i]代表能够翻的扑克的个数&#xff0c;求最后可能出现的扑克的组合情况。Hint Sample Input&#xff1a; 3 3 3 2 3 For the this example: 0 express fac…

马云打响本地生活消费攻坚战,饿了么获手淘一级入口,美团危险了

8月2日&#xff0c;细心的网友可以发现&#xff0c;手机淘宝App首页已上线“饿了么外卖”&#xff0c;饿了么成为手机淘宝首页的10个默认入口之一。这也就意味着以后手机淘宝用户可以通过淘宝首页新入口进入外卖服务&#xff0c;在应用内直接完成由饿了么提供的订餐外卖服务。 …

Linux文件,文件描述符以及dup()和dup2()

一.Linux中文件 可以分为4种&#xff1a;普通文件、目录文件、链接文件和设备文件。1、普通文件是用户日常使用最多的文件&#xff0c;包括文本文件、shell脚本、二进制的可执行和各种类型的数据。ls -lh 来查看某个文件的属性&#xff0c;可以看到有类似 -rw-r--r-- &#xff…

摩尔线程推出首款数据中心级全栈功能GPU:MTT S2000

2022年3月30日&#xff0c;北京——摩尔线程正式推出首款基于其先进架构MUSA统一系统架构&#xff08;Moore Threads Unified System Architecture&#xff09;打造的数据中心级多功能GPU产品MTT S2000。摩尔线程MTT S2000基于其第一代MUSA架构GPU芯片苏堤研发制成&#xff0c;…

jquery 获取 outerHtml 包含当前节点本身的代码

在开发过程中&#xff0c;jQuery.html() 是获取当前节点下的html代码&#xff0c;并不包含当前节点本身的代码&#xff0c;然后我们有时候确需要&#xff0c;找遍jQuery api文档也没有任何方法可以拿到。 看到有的人通过parent().html()&#xff0c;如果当前元素没有兄弟元素还…

修改CentOS yum源

解决在CentOS yum源下载慢的办法最近在虚拟机下面安装了个CentOS 5.5&#xff0c;使用yum更新时发现下载速度异常慢。可以修改yum的配置文件&#xff0c;把其镜像指向国内的服务器即可。 方案一&#xff1a; # cd /etc/yum.repos.d/ # mv CentOS-Base.repo CentOS-Base.repo.b…

带monkey的测流量!

为什么80%的码农都做不了架构师&#xff1f;>>> //public static void flow(){ //String command1 "adb shell monkey -p com.netease.newsreader.activity -s 500 -v 2000"; //String command2 "adb shell ps"; //String str"com.nete…

实现AI技术自立自强,国产深度学习框架面临三大难题

作为推动AI应用大规模落地的关键力量&#xff0c;深度学习框架的重要性日益凸显。它不仅关系国计民生的行业和领域广泛的应用&#xff0c;同样也对信息系统的科技安全有着决定性的意义。 “深度学习框架在人工智能技术体系中&#xff0c;处于贯通上下的腰部位置&#xff0c;它下…

关于Android H5混合开发遇到的问题

2019独角兽企业重金招聘Python工程师标准>>> 添加WebChromeClient&#xff0c;复写onJsAlert、onJsConfirm、onJsPrompt方法后&#xff0c;弹框异常退出问题 项目经理说&#xff0c;Android没有处理弹框&#xff0c;点击按钮没有反应&#xff0c;iOS就可以。于是就复…

手动配置lnmp环境

做php开发的&#xff0c;想要进一步提升自己&#xff0c;手动搭建开发环境&#xff0c;我想是必须经历的一个坎。虽然说有很多第三方集成环境可供使用&#xff0c;但我想说的是在你没有自己搭建过一次环境的时候&#xff0c;你没有太多的资本去“偷懒”。虽然我自己也是个菜鸟&…