java-6

TLSv1.2 on Jboss 5.1.0 GA using Java 6 and BouncyCastle

大憨熊 提交于 2020-02-02 15:00:30
问题 I'm facing a problem with a Jboss server and the https connector, running on Java 6. I want to make my server using only TLSv1.2 and using the cipher suites "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" for decoding the certificate. I know that Java 6 does not support TLSv1.2, but I added the Bouncy Castle JCE and JSSE provider to the JDK (https://www.bouncycastle.org/latest_releases.html) : Added the JARs files ( bcprov-jdk15on-159.jar and bctls-jdk15on

“No operations defined in spec” Error while using RestEasy FrameWork with Swagger

流过昼夜 提交于 2020-02-01 08:54:12
问题 I have implemented REST apis using RESTEASY framework I am trying to implement swagger api documentation through web.xml i am able to get index.html but error is thrown that can't read from file. am I making mistake in making URL? my web.xml is as follows: <servlet> <servlet-name>swagger-servlet</servlet-name> <servlet-class>com.wordnik.swagger.jersey.config.JerseyJaxrsConfig</servlet-class> <init-param> <param-name>api.version</param-name> <param-value>1.1.0</param-value> </init-param> <init

How to allow the classloader to load classes from a changed jar?

可紊 提交于 2020-01-30 11:35:27
问题 We have a server side Java6 app running on quite a few linux servers. Occasionally, someone will accidentally upgrade the jar file while the application is running. When that happens, the next attempt to load a class that hasn't been used yet (often the ShutdownHandler code) fails with a ClassNotFoundException. I would like to tell the classloader that it is ok to read the changed jar file to get the classes it needs. I don't mind if this results in the classloader re-reading already loaded

UnsupportedOperationException on ByteBuffer.asCharArray().array()

独自空忆成欢 提交于 2020-01-24 10:40:30
问题 Could someone be so kind to explain why on the following line I have UnsupportedOperationException? System.out.println(ByteBuffer.wrap(new byte[] {'t', 'e', 's', 't', '\n'}).asCharBuffer().array()); 回答1: The asCharBuffer doesn't wrap a char[] so you cannot obtain its array() It appears what you are trying to do is. System.out.println(Arrays.toString("test\n".toCharArray())); 回答2: Did you read the Javadoc for CharBuffer.array()? Not all CharBuffer s are backed by a char[] . ByteBuffer

Rounding Half Up with Decimal Format in Android

故事扮演 提交于 2020-01-23 01:26:08
问题 I want to set the Rounding Mode to HALF_UP on my DecimalFormat, but eclipse is telling me that setRoundingMode() is not available on the DecimalFormat class. My project properties (and the overall Eclipse properties) are using the 1.6 compiler. The developer.android.com site says that I can use either Java 5 or 6 so I'm not sure what the problem is. import java.math.RoundingMode; import java.text.DecimalFormat; completedValueFormatter = NumberFormat.getNumberInstance(); DecimalFormat

Managed Mbeans from ManagementFactory in JDK1.6 - NotCompliantMBeanException:

谁说胖子不能爱 提交于 2020-01-13 16:24:31
问题 I was using ManagementFactory to get ManagedMbeans in JDK1.5 and JBOSS 4.X. Now wanted to move my same code to JDK 1.6. The Mbean part breaks throwing the exception Caused by: javax.management.NotCompliantMBeanException: Class does not expose a management interface: java.lang.Object Caused by: java.lang.Exception: Unable to register platform (JVM) MBeans with JBoss MBeanServer 回答1: Here's 2 approaches: Make JBossAS use the platform MBeanServer. Create your own proxies that implement the

How can I use TLS 1.2 in Java 6 with an Apache HttpClient?

a 夏天 提交于 2020-01-05 15:38:12
问题 I'm working on a Java 6 project using Apache HttpClient 3.5 and Spring Web Services 2.1.0. My Spring WebServicesTemplate is sending WebServices requests using an apache HttpClient. However, the service that I am contacting has phased out TLS 1.0 in favor of TLS 1.2. Java 6 does not support TLS 1.2. I was led to bouncycastle, which should give me TLS 1.2 support. How can I integrate bouncycastle with Spring or my HttpClient, so that I can send requests that support TLS 1.2? I have found a

Problem parsing unicode escape in a Java 6 String literal…?

落爺英雄遲暮 提交于 2020-01-03 07:25:09
问题 Why does this compile in java 6 (Sun 1.6.0_16): System.out.println("\u000B"); ... but not this: System.out.println("\u000A"); On this program: public class Test { public static void main(String argv[]) { System.out.println("\u000A"); } } I get a Test.java:3: unclosed string literal System.out.println("\u000A"); What's going on here? 回答1: The problem is that the Unicode replacement is done very early in compilation. Unicode escapes aren't just valid in strings and character literals (as other

cannot connect subclipse to VisualSVN on Windows 7

旧时模样 提交于 2020-01-02 23:21:50
问题 svn: connection refused by the server svn: OPTIONS request failed on '/svn/myrepo/MyProject/trunk' svn: connection refused by the server Java 32 bit 1.6.20 Windows 7 64 bit Eclipse 3.5.2 32 bit VisualSVN 2.1.3 Installed subclipse in Eclipse 3.5.2. Created repository myrepo and Project Structure MyProject. Tried to open repository location https://desktop-PC/svn/myrepo/MyProject/trunk from subclipse and got error popup Error validating location org.tigris.subversion.javahl.ClientException: svn

Dynamic Function Creation in Java

徘徊边缘 提交于 2020-01-02 05:33:19
问题 So I'm trying to figure out if there is some method to dynamically create/assign a method to a class in Java. If it were C, I would just do it as follows using pointers: public class Foo { void bar(void *ptr) {....} }; int main() { Foo f = new Foo(); f.bar({"my function" ...}) } However, Java of course has no pointers, so is there any way to get a similar functionality out of a Java application? 回答1: In Java, you would normally declare an interface with a method to be called. For example, if