java-7

Why can't I update Java from 1.6 to 1.7 on Coldfusion 9.0.2 on Mac OSX 10.8.5

久未见 提交于 2019-12-12 04:37:45
问题 I'm running OSX 10.8.5 and recently installed Coldfusion 9.0.2 and applied the hotfix so I'm running CF Version 9,0,2,282541 (which should be compatible with Java 1.7). My prod environment is running Java 1.7 so I'm trying to replicate that on a dev machine. The Java Version currently being used by CF is 1.6.0_65 . My dev box has Java running in multiple locations as follows: System/Library/Java/JavaVirtualMachines/1.6.0.jdk Library/Java/JavaVirtualMachines/jdk1.7.0_65.jdk When I run java

OkHttp with SNI: Connection reset on Java 7

徘徊边缘 提交于 2019-12-12 02:52:45
问题 The following snippet works perfectly as long as only one tls certificate is enabled on the nginx server. OkHttpClient client = new OkHttpClient(); Request request = new Request.Builder() .url("ENDPOINT").build(); Response response = client.newCall(request).execute(); System.out.println(response.body().string()); Activating a site with a different certificate causes nginx to enable SNI. That apparently breaks both on Oracle Java 7 as well as OpenJDK 7. Exception in thread "main" java.net

Dynamically scale SVG image to the frame/window size

坚强是说给别人听的谎言 提交于 2019-12-12 02:46:05
问题 I am using SVGSalamander. My code loads a svg image and sets it as background of a JDesktopPane . File f = new File("awesome_tiger.svg"); SVGUniverse svgUniverse = new SVGUniverse(); try { SVGDiagram diagram = svgUniverse.getDiagram(svgUniverse.loadSVG(f.toURL())); try { diagram.render(g); } catch(Exception ex) {System.out.println(ex);}} catch (Exception ex2) {System.out.println(ex2);} How can I achieve, that the image fills the window/frame completely and resizes with it? Seems SVGSalamander

Setup Connection pooling in jsp/servlets application based on MVC?

江枫思渺然 提交于 2019-12-12 02:25:00
问题 I want to use Connection pooling in my java web application with MySQL and JDBC, I found a very resource to learn at Apache Tomcat 6.0 (6.0.35) - JNDI Datasource HOW-TO, But this example uses JSTL code to explain how to retrieve connection from pool. I want to work similarly but with a MVC architecture from scratch consisting of Beans, DAOs, Servlets and JSPs. I got everything I want from a very good DAO tutorial by BalusC but I am confused in the last part of tutorial saying How about

one java code behave differ on 2 differ pc

空扰寡人 提交于 2019-12-11 19:26:55
问题 I have simple JAXB unmarshalling code. package com.example; import java.io.StringReader; import javax.xml.bind.JAXBContext; import javax.xml.bind.Unmarshaller; import javax.xml.transform.stream.StreamSource; public class Main { public static void main(String[] args) { try { StringBuilder xml = new StringBuilder(); xml.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>") .append("<item><pubDate>Thu, 12 May 2016 08:44:05 +0000</pubDate></item>"); JAXBContext jaxbContext = JAXBContext

What are the reasons behind “handshake_failure at remote address” Java netty error?

流过昼夜 提交于 2019-12-11 14:27:08
问题 I'm mostly creating this page to troubleshoot this issue, but also because Google returns 0 results for this quoted error in title. A backend client of my legacy Tomcat7 webapp recently updated their SSL certificate to TLS1.2 and now my production systems can't connect. This code base is 5 years old and MASSIVE. I cannot simply upgrade to JDK 1.8 without major surgery. In my Mac OSX Intellij IDE I use 1.7.0_u141 and it works fine , it can connect to the client and data is returned! BUT Using

HtmlUnit Google Login

和自甴很熟 提交于 2019-12-11 13:56:50
问题 I want to automated the google login and accept oauth to get the authentication code. I get a NullPointerExeption by nextButton.click(), I can't find the "next" Button. WebClient webClient = new WebClient(); //BrowserVersion.FIREFOX_38 HtmlPage page = webClient.getPage("https://accounts.google.com/o/oauth2/auth?"); HtmlTextInput email = (HtmlTextInput)page.getElementById("Email"); email.setValueAttribute(emailAddress); HtmlSubmitInput nextButton = (HtmlSubmitInput)page.getElementById("next");

java.lang.ClassNotFoundException: org.springframework.web.util.ExpressionEvaluationUtils

社会主义新天地 提交于 2019-12-11 13:19:00
问题 I just upgraded a Spring MVC application, version 3.2 to a 4.0.2 and my view tags are not working anymore. The error: java.lang.ClassNotFoundException: org.springframework.web.util.ExpressionEvaluationUtils org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547) org.springframework.web.servlet.tags.MessageTag.resolveMessage(MessageTag.java:215) org.springframework.web.servlet.tags

When Does The JDK Compile Version Matter?

独自空忆成欢 提交于 2019-12-11 13:13:57
问题 I have two Java artifacts being built. One needs to be built in 1.6, because PowerMock isn't compatible w/ 1.7 and we are using it in a lot of unit tests. Refactoring PowerMock out right now isn't an option as it will take too much time. However, I want to use this artifact in a Java application built in 1.7 and run the whole thing in 1.7. I think that it should be Ok since it is just building some class files, which I doubt changed much if any probably as far back as 1.2 or earlier. Anyway,

Cordova: ant error code 1 when building android hello world app

拟墨画扇 提交于 2019-12-11 13:05:57
问题 Clean install of Cordova on an Ubuntu 12.04, then installed Android ADT bundle and added the platform-tools and tools to the path. Then created the hello app from toturial at apache Cordova. but it refuses to build. See the error I'm getting: aus@devhost:/opt/android_app/hello$ cordova build Running command: /opt/android_app/hello/platforms/android/cordova/build Buildfile: /opt/android_app/hello/platforms/android/build.xml -set-mode-check: -set-debug-files: -check-env: [checkenv] Android SDK