How to convert an address from IPv4 to IPv6
Is this possible? How can you convert an ipv4 to an ipv6 address? a few example from here: 0.0.0.0 -> :: 127.0.0.1 -> ::1 I'm searching a solution in Java. Thanks, ...
Is this possible? How can you convert an ipv4 to an ipv6 address? a few example from here: 0.0.0.0 -> :: 127.0.0.1 -> ::1 I'm searching a solution in Java. Thanks, ...
Is it possible in Java to access private field str via reflection? For example to get value of this field. class Test { private String str; public void setStr(String value) { str = value; } } ...
These days I have an interview for the position: Software Testing Engineer. Any ideas what questions might pop to the interview? Any tips? ...
For automated functional testing purposes, I would like to run a servlet container from my test driver without actually issuing HTTP requests over the network. The main goal is to test fairly elaborate conditions of servlet filtering, forwarding, and includes. I would like a system that embeds the servlet container in a way that: does...
One of our clients is using some Novel security software that sometimes locks some .class files that our software creates. This causes some nasty problems for them when this occurs and I am trying to research a workaround that we could add to our error handling to address this problem when it comes up. I am wondering are there any call...
I have a bunch of very simple functions. Each function has one input and one output. OutputType function func(InputType); The types of input/output are defined in xsd schema and generated into java classes with JAXB/XJC. Now I want to expose those functions as WSDL Web service running on Geronimo. I just took a look at Axis/WSDL2J...
We have a native app that we can access via JNI->DLL or by invoking an EXE with command line parameters. Which would be the best approach? We will be invoking this method about 100 times a day. Performance isn't super important. This native app was developed by a group outside of our company so we are not too familiar with the code (...
I'm trying to implement the following operation in Java and am not sure how: /* * write data (Data is defined in my package) * to a file only if it does not exist, return success */ boolean writeData(File f, Data d) { FileOutputStream fos = null; try { fos = atomicCreateFile(f); if (fos != null) {...
Hi, My code looks like this, this is Server code (Runnable) public void run() { while (true) { try { System.out.println("Waiting for client..."); this.socket = serverSocket.accept(); System.out.println("Client accepted"); while (true) { readCommand(); ...
It is possible to for Desktop.open(File f) to reference a file located within a JAR? I tried using ClassLoader.getResource(String s), converting it to a URI, then creating a File from it. But this results in IllegalArgumentException: URI is not hierarchical. URL url = ClassLoader.getSystemClassLoader().getResource(...); System.out.prin...
Currently, I have a JList listen to list selection listener. private void jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) { // When the user release the mouse button and completes the selection, // getValueIsAdjusting() becomes false if (evt.getValueIsAdjusting()) { /* In certain situat...
I'm a full time Java developer of around 4 years, professionally. I'm a GWT fanatic. I love Java. Here's the problem: In my free time I often fall victim to the verbosity of my favorite tools for doing "heavy" development. I also often fall into the trap of obsessively engineering my software. I'll end up with the most beautiful un...
I am working on some software that has to create dummy entries in various databases (Oracle, DB2, SQLServer) temporarily. Every column in the the row is filled with random data. The code uses java.sql.DataBaseMetaData class in java to get the COLUMN_SIZE attribute to figure out how large of a random string to store in the VARCHAR2 and ...
JNA seems a fair bit easier to use to call native code compared to JNI. In what cases would you use JNI over JNA? ...
I'm getting some errors when I try to deploy a web service generated using CXF's wsdl2java to generate the Java code from a WSDL file. I've managed to trace the error down to a NullPointerException being thrown by Apache Neethi when I tries to normalize a PolicyReference. The policy reference is defined in an external XML file (a lot o...
Hi, I need to validate XML against XSD and so what are free XML Validator available out there that could be useful for my task. Thanks. ...
Hi, I have student.xml file and am parsing this file using SAX Parser and now I need to store data into MySQL Database and so what approach is recommended. Code: package sax; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.xml.sax.Attributes; import org.xml.sax.SAXExceptio...
I'm looking for applications that have "rich" maven pom(s) and can show lot of maven capabilities(plugins). These applications are needed as showcase examples - how fast and how many this can be done with maven and appropriate set of plugins. There are no constraint to technology or application type - it must be opensorce and easy to bu...
What's the best way to create a bean for a HashMap<Class,String>? Specifically, do I need to explicitly create a Class bean for the key or is the class name enough? ...
Hi, I would like to get an opinion what language is better to use with LifeRay. I would like to build some app that I would like to integrate with LifeRay. What language do you suggest would I learn first? Java? - A friend suggested that Java and LifeRay goes well. Django? - I recently new this and seen the overview I find this pretty...