在模拟器中,我可以运行我的应用程序,但在使用Jelly Bean OS的设备上,我遇到了崩溃.知道为什么吗?
07-04 12:51:57.576 18243-18279/com.j4nos.moviebuffs6 E/AndroidRuntime: FATAL EXCEPTION: Thread-7940
java.lang.NoClassDefFoundError: java.nio.charset.StandardCharsets
at com.j4nos.moviebuffs6.Utility$1.run(Utility.java:52)
at java.lang.Thread.run(Thread.java:838)
Run Code Online (Sandbox Code Playgroud)
这是我需要的字符编码行:
byte[] out = str.getBytes(StandardCharsets.UTF_8);
嗨,我想删除zuul动态创建的路由。我没有使用云服务器。我无法使用添加路线discoveryclientroutelocator。
但是我找不到注销动态添加的路由的选项。这种删除应该在不重新启动网关的情况下发生。救命。
ZuulRoute zuulRoute = new ZuulRoute();
zuulRoute.setId(externalapis.getServiceId());
zuulRoute.setServiceId(externalapis.getServiceId());
zuulRoute.setPath(externalapis.getPath());
zuulRoute.setUrl(externalapis.getUrl());
zuulRoute.setRetryable(true);
discoveryClientRouteLocator.addRoute(zuulRoute);
Run Code Online (Sandbox Code Playgroud) 我是Spring Boot的新手,我遇到了很大麻烦.我可以在application.properties中设置一个与Velocity相关的Spring Boot属性的简短列表,这些属性工作正常.但是有大量的Velocity属性我无法以这种方式配置.
我发现了这个问题,这似乎解决了我需要的问题,但它并不适用于我.当我在程序启动期间在Spring Boot中使用断点时,我可以看到Spring引导正确读取和加载"spring.velocity.properties.*"键/值对 - 它们似乎没有任何影响.无论我将它们设置为什么值,Velocity运行时行为都会使用默认值.
我错过了什么?
编辑:
的pom.xml
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>docuvore</groupId>
<artifactId>docuvore-server</artifactId>
<version>0.0.1-SNAPSHOT</version>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.0.BUILD-SNAPSHOT</version>
</parent>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!-- Core Spring Boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<!-- Tomcat and Spring Web MVC -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- Spring Security
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
-->
<!-- Spring Data and MongoDB -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<!-- Apache Velocity -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-velocity</artifactId>
</dependency>
<!-- Project Lombok --> …Run Code Online (Sandbox Code Playgroud) 我在我的项目中添加了graal库来执行Java中的JavaScript。我的项目在spingboot框架上工作。
compile group: 'org.graalvm.sdk', name: 'graal-sdk', version: '1.0.0-rc9'
compile group: 'org.graalvm.js', name: 'js', version: '1.0.0-rc9'
compile group: 'org.graalvm.js', name: 'js-scriptengine', version: '1.0.0-rc9'
compile group: 'org.graalvm.tools', name: 'profiler', version: '1.0.0-rc9'
compile group: 'org.graalvm.tools', name: 'chromeinspector', version: '1.0.0-rc9'
compile group: 'org.graalvm.truffle', name: 'truffle-api', version: '1.0.0-rc9'
Run Code Online (Sandbox Code Playgroud)
如果我将项目投标到包含所有库的胖罐中,graal初始化将失败并抛出FileSystemNotFoundException。
java.nio.file.FileSystemNotFoundException: null
at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:169)
at jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:155)
at java.base/java.nio.file.Paths.get(Paths.java:143)
at com.oracle.truffle.polyglot.LanguageCache.collectLanguages(LanguageCache.java:284)
at com.oracle.truffle.polyglot.LanguageCache.createLanguages(LanguageCache.java:211)
at com.oracle.truffle.polyglot.LanguageCache.languages(LanguageCache.java:201)
at com.oracle.truffle.polyglot.PolyglotEngineImpl.initializeLanguages(PolyglotEngineImpl.java:480)
at com.oracle.truffle.polyglot.PolyglotEngineImpl.<init>(PolyglotEngineImpl.java:168)
at com.oracle.truffle.polyglot.PolyglotEngineImpl.<init>(PolyglotEngineImpl.java:152)
at com.oracle.truffle.polyglot.PolyglotImpl.buildEngine(PolyglotImpl.java:197)
at org.graalvm.polyglot.Engine$Builder.build(Engine.java:488)
at org.graalvm.polyglot.Context$Builder.build(Context.java:1083)
at org.graalvm.polyglot.Context.create(Context.java:660)
at ocpm.pcf.policyengine.engine.cache.JavaScriptPolicyParser.graalParse(JavaScriptPolicyParser.java:48)
Run Code Online (Sandbox Code Playgroud)我在异常堆栈中调试了ponit,发现graal希望在js-1.0.0-rc9.jar中初始化“启动”配置文件。但是在上述情况下,它使用了不同的URI模式。
- In …Run Code Online (Sandbox Code Playgroud) 我在servlet中出错,无法从JSP传递值。
JSP代码:
<table>
<tr>
<td>Day</td>
<td>Start</td>
<td>End</td>
<td>Date</td>
<td> </td>
</tr>
<tr>
<td><select name="availableDay">
<!--Listing days-->
</select></td>
<td><input type="time" name="availableStart"/></td>
<td><input type="time" name="availableEnd"/></td>
<td><input type="date" name="availableDate" /></td>
<td><input type="button" class="add" name="action" value="Add More"</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
我想传递availableDate给servlet。仅供参考,JSP中的行是动态生成的。因此,我通过使用[]。我的servlet代码:
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, java.io.IOException {
String[] presentationID = request.getParameterValues("selectavailability");
String[] availableDay = request.getParameterValues("availableDay");
String[] availableStart = request.getParameterValues("availableStart");
String[] availableEnd = request.getParameterValues("availableEnd");
String[] availableDate = request.getParameterValues("availableDate");
SimpleDateFormat availDate = new SimpleDateFormat("dd-MM-yyyy");
Date chosenDate = availDate.parse(availableDate);// THIS IS …Run Code Online (Sandbox Code Playgroud) 我有一个java应用程序,它曾经在java 7中运行良好.在使用以下配置迁移到java 8后,它开始挂起.
-Xms3g -Xmx3g -verbose:gc -XX:+UseG1GC -XX:G1ReservePercent=25 -XX:+PrintGCDateStamps
Run Code Online (Sandbox Code Playgroud)
我已经采取了jstack转储,它显示所有线程都处于BLOCKED状态.我也采取了jmap dump,它显示了以下信息.
有人可以帮我解决这个问题吗?
Attaching to process ID 2554, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.74-b02
using thread-local object allocation.
Garbage-First (G1) GC with 18 thread(s)
Heap Configuration:
MinHeapFreeRatio = 40
MaxHeapFreeRatio = 70
MaxHeapSize = 3221225472 (3072.0MB)
NewSize = 1363144 (1.2999954223632812MB)
MaxNewSize = 1932525568 (1843.0MB)
OldSize = 5452592 (5.1999969482421875MB)
NewRatio = 2
SurvivorRatio = 8
MetaspaceSize = 21807104 (20.796875MB)
CompressedClassSpaceSize = 1073741824 (1024.0MB)
MaxMetaspaceSize …Run Code Online (Sandbox Code Playgroud) 我无法使用Hazelcast的REST API,总是接收:
ERR_EMPTY_RESPONSE通过浏览器或java.net.SocketException: Unexpected end of file from server通过Java测试程序.在hazelcast节点:
INFO: [myIP]:5701 [dev] [3.6] Established socket connection between /127.0.0.1:5701 and /127.0.0.1:62816
06-may-2016 13:04:20 com.hazelcast.nio.tcp.TcpIpConnection
INFO: [myIP]:5701 [dev] [3.6] Connection [/127.0.0.1:62816] lost. Reason: Socket explicitly closed
Run Code Online (Sandbox Code Playgroud)使用过的代码只是hazaelcast multimap示例: 和REST API uri http:// localhost:5701/hazelcast/rest/maps/my-distributed-map/key
我正在尝试在 woocommerce 结帐页面的“下订单”按钮上添加此脚本:
$('#place_order').addClass('disabled');
Run Code Online (Sandbox Code Playgroud)
但如果我把它放在 footer.php 文件中,它就不起作用。
我找到了一个资源,建议我覆盖 woocommercecheckout.js文件并在文件夹内进行克隆/my-theme/woocommerce,但现在我不知道将自定义脚本放在哪里才能使其正常工作。
谢谢
我是 Spring 新手,作为起点,遵循教程 @ Spring IO 教程
我已经使用Web、JPA、H2和Lombok使用Eclipse与Maven从 spring 初始值设定项下载了项目。
以下是代码集:
PayrollApplication.java
package com.spring.payroll;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class PayrollApplication {
public static void main(String[] args) {
SpringApplication.run(PayrollApplication.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
员工.java
package com.spring.payroll;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.GeneratedValue;;
@Data
@Entity
// This is a domain object definition
public class Employee {
private @Id @GeneratedValue Long id;
private String name;
private String role; …Run Code Online (Sandbox Code Playgroud) 我有一个接口和2个实现该接口的具体类,
public interface ITemplate{}
public Template implements ITemoplate {}
public Template2 implements ITemplate {}
Run Code Online (Sandbox Code Playgroud)
我有一个接受Class对象并实例化它的方法.
public addTemplate(Class<ITemplate> template){
pipe.add(template.newInstance())
}
Run Code Online (Sandbox Code Playgroud)
问题是,当我调用该方法时,它会抛出编译时错误:
instance.addTemplate(Template.class)
Run Code Online (Sandbox Code Playgroud)
编译时错误:
addTemplate(java.package.ITemplate.class) cannot be applied to addTemplate(java.package.Template.class)
Run Code Online (Sandbox Code Playgroud)
我错过了什么,或者有解决方法吗?