Paul Policarp

Greenhorn
+ Follow
since May 07, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Paul Policarp

So I tried Apache MINA SSHD and everything, once again, worked like a charm until I tried binding an IPv6 address. It's the same problem. I'm beginning to think that there aren't any implementations out there that don't use NIO. Does anyone have any other helpful recommendations aside from J2SSH, Maverick or Apache MINA? Also non-GPL...
NIO is not required, it's just the implementation that the commercial API has chosen.

I could use pretty much anything that supports a working SFTP server that can be integrated into existing code. So APIs would do (no GPL, though). The problem is that I've had my share of problems with both paid and free solutions so I would really like some recommendations.
Grab a chair, this might take a while...

Alright, so. My requirement for my company's project was SFTP support for an application. It needed to support both a Server and a Client. After a lot of hassle with (the buggy and unfinished) SSHTools I finally convinced my managers that we needed to purchase a commercial solution. The chosen product was Maverick, SSHTools' commercial successor. It all worked fine and dandy until we needed to support IPv6 (which Maverick claimed it supported "as long as the JRE supported it") and the JRE allegedly does support it.

HOWEVER.

NIO channels do NOT support IPv6 server sockets on Windows (which is our required platform) and this is a long-standing bug in Java. It's doubtful that the people developing Maverick will agree to help us with a workaround and thus we're looking for an alternate solution.

Java 1.7 fixes this, but there is no official release and we can't wait for it. I don't know if a workaround can be done on our side, so my main question is if anyone has any recommendations for a free or paid SFTP API for Java. Keeping in mind all of the above.

Thanks.

~Paul
Thanks, I didn't know all these things. Import node worked like a charm once I got the hang of it.
13 years ago
This is how I amended the code:



And then inserted your code. This is my output:

*****#document
++++++snapshot

And then I get a NullPointerException on

configNode.appendChild(inlineDoc.getDocumentElement());
13 years ago
Ok, but my XML looks like this:

<?xml version=1.0...>
<snapshot>
<node> value<node>
.
.
.
</snapshot>

I need everything BUT "<?xml version=1.0...>" as a DOM. Can I remove it with removeChild? Does it have a parent node?
13 years ago
Hi.

I'm using the w3 DOM API for XML manipulation and need to add a subtree (constructed by using "parse()" on a ByteArrayInputStream derived from a string) to another DOM.

I get a org.w3c.dom.DOMException: WRONG_DOCUMENT_ERR: A node is used in a different document than the one that created it.

I think this is because the DOM created with parse() also contains the <?xml version...etc> tag. How can I remove it?

Here's the code sample:

13 years ago
"It doesn't work" is literally all I have. There are no exceptions thrown, no relevant log information, just code working under Eclipse and not working when run from within a Jar.

I can't even post code because I don't have access to the API's source and I'm calling a method that's directly inside it.

This is my code:

SftpServer sftpServer = new SftpServer(port);

sftpServer.startup();

And that's it.

It seemed like a general issue, though and I thought more people bumped into it at one point or another.
13 years ago
I wish someone told my manager that a few months ago. -_-
13 years ago
There's no error. The server clearly doesn't start (the startup() method is boolean and I ran a check on this) but no exception is thrown natively.

EDIT: To rephrase...the server appears to have started unless I throw an exception myself on the startup() method. But if I try to connect with a client, I can't. Running from Eclipse I can connect with no problem.

And a bit of additional info: I have no differences between my lib directory, referenced libraries and the jars I include to my own at build.

EDIT 2: The Jar is being signed, if this matters in any way.
13 years ago
Solutions tried:

Forcing the same compliancy level from the build file.
Deleting every other JRE from Eclipse and using only the one I need and run the compiled code with the exact same copy.
Not compiling at build, but rather use the classes generated by Eclipse for inclusion in the JAR.
Catching a Throwable on the failing method.

No difference. Eclipse runs it like a charm, the Jar file, however, fails. I have this problem with two different SSH server implementations.
13 years ago
Just the jre system library and a few jars that are unpacked and repacked into the main JAR at build.

I only see this problem when trying to start an SFTP server from the JAR. Could this be a security issue of some sort?
13 years ago
Exactly what the title says. It's a startServer method from an SSH API. The jre and jdk used for running and compiling are the same in both Eclipse and my system: 1.5.0.14. Does anyone know why Eclipse might be more lenient?
13 years ago
Just in case anyone's interested, this is my cipher (and this is my gun).



Notable changes include the usage of SecretKeySpec in cipher.init and the keysize of 16 bytes (128 bits). It's working now.
13 years ago