JBOSS eap 6.3 beta 与 websocket 和 stockjs - stomp.js 使用 spring 框架

2023-11-29

我使用 jboss eap 6.3 并启用了 websocket 支持,连接显然可以工作,但在连接的某些点上,Sock.js 抛出 500 服务器错误,如下所示:

Opening Web Socket... stomp.js:130
XHR finished loading: "http://localhost:8080/frontEnd/track/info". sockjs.js:807
XHR finished loading: "http://localhost:8080/frontEnd/resources/templates/navigation.html". angular.js:8377
WebSocket connection to 'ws://localhost:8080/frontEnd/track/308/fdnevktb/websocket' failed: Error during WebSocket handshake: Unexpected response code: 500 sockjs.js:1213
Web Socket Opened... stomp.js:130
>>> CONNECT
accept-version:1.1,1.0
heart-beat:10000,10000

 stomp.js:130
XHR finished loading: "http://localhost:8080/frontEnd/track/308/2b68n54s/xhr_send". sockjs.js:807
<<< CONNECTED
heart-beat:0,0
version:1.1

 stomp.js:130
connected to server undefined stomp.js:130
Connected: CONNECTED
version:1.1
heart-beat:0,0

然后当我在 Eclipse 中看到 jboss 的输出时,完整的异常是:

08:37:18,692 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/frontEnd].[appServlet]] (http-localhost/127.0.0.1:8080-7) JBWEB000236: Servlet.service() for servlet appServlet threw exception: java.lang.IllegalStateException: JBWEB000034: Cannot upgrade from HTTP/1.1 without IO events
    at org.apache.catalina.connector.Response.sendUpgrade(Response.java:1370) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.catalina.connector.Request.upgrade(Request.java:3335) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.catalina.connector.RequestFacade.upgrade(RequestFacade.java:1062) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.tomcat.websocket.server.UpgradeUtil.doUpgrade(UpgradeUtil.java:187) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.tomcat.websocket.server.WsServerContainer.doUpgrade(WsServerContainer.java:271) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.springframework.web.socket.server.standard.TomcatRequestUpgradeStrategy.upgradeInternal(TomcatRequestUpgradeStrategy.java:72) [spring-websocket-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.web.socket.server.standard.AbstractStandardUpgradeStrategy.upgrade(AbstractStandardUpgradeStrategy.java:119) [spring-websocket-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.web.socket.server.support.DefaultHandshakeHandler.doHandshake(DefaultHandshakeHandler.java:215) [spring-websocket-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.web.socket.sockjs.transport.handler.WebSocketTransportHandler.handleRequest(WebSocketTransportHandler.java:83) [spring-websocket-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.web.socket.sockjs.transport.TransportHandlingSockJsService.handleTransportRequest(TransportHandlingSockJsService.java:254) [spring-websocket-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.web.socket.sockjs.support.AbstractSockJsService.handleRequest(AbstractSockJsService.java:317) [spring-websocket-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler.handleRequest(SockJsHttpRequestHandler.java:88) [spring-websocket-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter.handle(HttpRequestHandlerAdapter.java:51) [spring-webmvc-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938) [spring-webmvc-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870) [spring-webmvc-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) [spring-webmvc-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) [spring-webmvc-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) [spring-webmvc-4.0.4.RELEASE.jar:4.0.4.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter.doFilter(DefaultLoginPageGeneratingFilter.java:155) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108) [spring-web-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) [spring-security-web-3.2.3.RELEASE.jar:3.2.3.RELEASE]
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344) [spring-web-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261) [spring-web-4.0.1.RELEASE.jar:4.0.1.RELEASE]
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.4.0.Final-redhat-11.jar:7.4.0.Final-redhat-11]
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:340) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) [jbossweb-7.4.2.Final-redhat-1.jar:7.4.2.Final-redhat-1]
    at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_55]

我的应用程序由两个项目组成,一个用于后端,另一个用于使用 maven 引用后端的前端,我的前端 pom.xml(已部署项目)如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.siellano</groupId>
    <artifactId>frontEnd</artifactId>
    <packaging>war</packaging>
    <version>1.0.0-BUILD-SNAPSHOT</version>
    <properties>
        <java-version>1.6</java-version>
        <org.springframework-version>4.0.4.RELEASE</org.springframework-version>
        <org.aspectj-version>1.6.10</org.aspectj-version>
        <org.slf4j-version>1.6.6</org.slf4j-version>
    </properties>
    <dependencies>
        <!-- Spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${org.springframework-version}</version>
            <exclusions>
                <!-- Exclude Commons Logging in favor of SLF4j -->
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                 </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>

        <!-- AspectJ -->
        <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjrt</artifactId>
            <version>${org.aspectj-version}</version>
        </dependency>   

        <!-- Logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${org.slf4j-version}</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>${org.slf4j-version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${org.slf4j-version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.15</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.mail</groupId>
                    <artifactId>mail</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.jms</groupId>
                    <artifactId>jms</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jdmk</groupId>
                    <artifactId>jmxtools</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun.jmx</groupId>
                    <artifactId>jmxri</artifactId>
                </exclusion>
            </exclusions>
            <scope>runtime</scope>
        </dependency>

        <!-- @Inject -->
        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
            <version>1</version>
        </dependency>

        <!-- Servlet -->
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>

        <!-- Test -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.7</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.siellano</groupId>
            <artifactId>backend</artifactId>
            <version>1.0.0-BUILD-SNAPSHOT</version>
            <type>war</type>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-websocket</artifactId>
            <version>4.0.4.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-messaging</artifactId>
            <version>4.0.4.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>javax.websocket</groupId>
            <artifactId>javax.websocket-api</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.9</version>
                <configuration>
                    <additionalProjectnatures>
                        <projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
                    </additionalProjectnatures>
                    <additionalBuildcommands>
                        <buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
                    </additionalBuildcommands>
                    <downloadSources>true</downloadSources>
                    <downloadJavadocs>true</downloadJavadocs>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <compilerArgument>-Xlint:all</compilerArgument>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>1.2.1</version>
                <configuration>
                    <mainClass>org.test.int1.Main</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <name>frontEnd</name>
</project>

最后,我的后端项目中 Spring 的 websocket xml 配置是:

<?xml version="1.0" encoding="UTF-8"?> 
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xmlns:websocket="http://www.springframework.org/schema/websocket"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/websocket
        http://www.springframework.org/schema/websocket/spring-websocket.xsd">

    <websocket:message-broker application-destination-prefix="/app">
        <websocket:stomp-endpoint path="/track" >
            <websocket:sockjs ></websocket:sockjs>
        </websocket:stomp-endpoint>
        <websocket:simple-broker prefix="/update"/>
    </websocket:message-broker>
</beans:beans>

根据官方文档以及其他来源,例如气氛的维基,需要:

  • have a jboss-web.xml文件带有<enable-websockets>true</enable-websockets> element
  • 使用提供的脚本配置 NIO 连接器EAP_HOME/bin/jboss-cli.sh --connect --file=configure-http-connector.cli

注意Spring的参考文档在兼容性列表中提到了 Wildfly,但没有提到 Jboss EAP。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

JBOSS eap 6.3 beta 与 websocket 和 stockjs - stomp.js 使用 spring 框架 的相关文章

随机推荐

  • PHP CURL 将 cookie 保存到 cookiejar 但不使用它

    我有一个 PHP 脚本 它使用 CURL 通过简单的登录页面登录到网站 它向站点发送一个初始请求 并查看它是否已经登录 由于 cookie 或者是否出现登录页面 如果出现 则登录 然而 最近我注意到 每次脚本运行时 它都不会登录 使用 VE
  • 定制ABPeoplePickerNavigationController,如viber、whatsapp

    如何像 viber 一样显示 ABPeoplePickerNavigationController 其中 viber 图标出现在已经使用它的联系人前面 请检查屏幕截图 这是我正在尝试做但面临问题的代码 ABPeoplePickerNavig
  • 为什么 StreamReader.EndOfStream 属性更改 BaseStream.Position 值

    我编写了这个小程序 它从 Random txt 中读取每 5 个字符 在 random txt 中 我有一行文本 ABCDEFGHIJKLMNOPRST 我得到了预期的结果 A的位置为0 F的位置是5 K的位置是10 P的位置是15 这是代
  • 在 PHP 中比较字符串之前使编码统一

    我正在开发一项功能 该功能要求我获取网页的内容 然后检查该页面中是否存在某些文本 这是一个反向链接检查工具 问题是这样的 该函数在大多数情况下运行完美 但有时 当链接明显存在时 它会标记页面没有链接 我已经追踪到了对输出中的字符串进行视觉比
  • 将索引从常规表传递到临时表?

    我正在使用如下查询创建临时表 CREATE TEMPORARY TABLE temp table SELECT FROM regular table WHERE 1 但regular table在某些字段上有FULLTEXT索引 我尝试对新
  • 如何在yaml中创建动态列表?

    我正在尝试渲染模板 我必须创建一个列表 host 111 222 333 444 555 666 777 888 必须从另一个主机文件中获取 我正在使用这样的东西 for host in groups hostgroup host host
  • 在 ggplot 中向轴标签和刻度添加换行符

    我正在寻找一种在绘图的 x 轴上使用长变量名称的方法 当然 我可以使用较小的字体或稍微旋转它们 但我希望保持它们垂直且可读 举个例子 df lt data frame a LETTERS 1 20 b rnorm 20 c rnorm 20
  • 如何向 Anaconda 添加模块

    这就是我这样做时得到的 蟒蛇 V Python 2 7 11 Anaconda 2 4 0 64 位 我通常使用我的终端来玩IDLE 但现在我也安装了IDLE shell I tried 导入 sys sys path两者都有 他们抛出了不
  • SQL Server 中的聚合替换?

    我想要实现的目标是使必须在某个字段上执行的一系列替换动态化 为了让事情变得更简单 我实际上想删除数据 所以我会一直与 假设有时我只需要进行一项替换 REPLACE myField stringToRemove 有时 我需要两个替换 REPL
  • 如果 href 页面包含包含 noindex 和 nofollow 的 robots 元标记,我是否需要向链接添加 nofollow rel 属性?

    如果我有一个带有元标记的页面 dontFollowMe html lt meta name robots content noindex nofollow gt 我链接到该页面 我需要在 a 元素中包含 nofollow rel 属性吗 a
  • 如何在 Threejs 中克隆 Collada 模型?

    我已经加载了一个 dae模型 我想在我的场景中使用更多次 此代码适用于网格 但是collada scene对象不是网格 var mesh2 new THREE Mesh loadedMesh geometry loadedMesh mate
  • 如何扩展 Array.prototype.push()?

    我正在尝试延长Array push方法 这样使用push就会触发回调方法 然后执行普通的数组功能 我不太确定如何做到这一点 但这里有一些我一直没有成功使用的代码 arr arr push function data callback met
  • Laravel Artisan 使用内存挂起直至冻结

    Laravel 5 4 Artisan 将无法运行并使用大量内存 它在相同版本之前可以工作很长时间 也许除了 PHP 7 0 14 到 7 0 15 Problem any artistan命令不执行任何操作 观看时htop我注意到内存从2
  • “警告无法确定响应正文的内容长度。”是什么意思?意思是我该如何摆脱它?

    自从升级到 Rails 3 1 以来 我在开发日志中看到以下警告消息 警告无法确定响应正文的内容长度 设置响应或设置的内容长度Response chunked true 这是什么意思以及如何删除它 这是个问题吗 向 Rails Core 的
  • DownloadManager 通知不显示百分比

    我正在尝试使用 DownloadManager 从 API11 下载文件 到目前为止 文件下载进展顺利 但操作栏通知显示未确定大小的进度条 并且查询轮询在文件完全下载之前不会返回任何大小 Code DownloadManager Reque
  • 突出显示热图中的单元格

    我目前正在尝试根据其他两个矩阵设置矩阵的热图并突出显示特定的单元格 一个例子 gt SOI NAP G021 NAP G033 NAP G039 NAP G120 NAP G122 2315101 59 69418 27 26002 69
  • 艰难地学习 Python Ex.41 对 For 循环感到困惑

    我无法理解 Learn Python the Hard Way ex 41 中的 for 循环之一是如何工作的 http learnpythonthehardway org book ex41 html以下是课程中的代码 我感到困惑的循环是
  • std::string 格式如 sprintf

    我必须格式化std string with sprintf并将其发送到文件流中 我怎样才能做到这一点 现代 C 使这变得超级简单 C 20 C 20介绍std format 这使您可以做到这一点 它使用类似于的替换字段那些在Python中
  • 删除完整 S3 存储桶 CLI

    我需要删除其中包含一些对象的 S3 存储桶 aws s3 rb force s3 ansible prod us east remove bucket failed s3 ansible prod us east An error occu
  • JBOSS eap 6.3 beta 与 websocket 和 stockjs - stomp.js 使用 spring 框架

    我使用 jboss eap 6 3 并启用了 websocket 支持 连接显然可以工作 但在连接的某些点上 Sock js 抛出 500 服务器错误 如下所示 Opening Web Socket stomp js 130 XHR fin