- before you store the value in the database, remove all newlines.
- before you compare a value with a value from the db, remove all newlines.
Of course, you have to update your databse in case that you have some entries there already.
I am trying to code an application, like sync operation between two machines to transfer the files and folders through internet. Is it possible to use ftp or any other in java and write the application?
It's definitely possible. You can use FTP server on one machine and use a java program to synchronize a local folder with remote folder on FTP server. The FTP Server must be accessible from internet.
Other way is to write your own socket server implementation and use it for synchronization. Unlike the first implementation, this will allow you to initiate synchronization from either machine. With first it will be always from the machine on which java program is running.
Prasad P. Khandekar
Knowledge exists, man only discovers it.
I am writing the java application for encryption/compression which will be integerated in spring batch application to transfer large files.once it is done i will upload the source code here.
Then it's not working properly; but you have not given us enough information to help figure it out. There are plenty of working samples of sockets in Java to be found on the internet; maybe you should check your code against some of them.
- Wait for message
- Parse message into a list of strings. (3 in the above example)
- Put messages into expected output item (path, message1, messate2)
The above is a bit generalized. It could be less generalized or more so.
The important parts however are that
1. There is ONE message regardless of the data items (because presumably the data items are really part of one collection.)
2. The message defines the length (specifically the length of three strings and the total string count.)
3. The message is part of the communications API, it is not part of the rest of the application. The rest of the application does not know and does not care that the 'message' exists.
4. The rest of the application uses the communications API. It does know and does not care that TCP is being used.
public static Context getInitialContext () throws JMSException,NamingException,RemoteException
Properties prop = new Properties();
Context context = new InitialContext(prop);
Then i converted to DLL file to send message from C# to jboss,
everything are goo,so i can send message from c# windows application to jboss server
but if i use the same DLL file inside web application i got the following error:
javax.naming.NoInitialContextException: Cannot instantiate class: org.jnp.interfaces.NamingContextFactory [Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
Root exception is java.lang.ClassNotFoundException: org.jnp.interfaces.NamingContextFactory
That is the problem, the JVM cannot find the class org.jnp.interfaces.NamingContextFactory. Presumably it means that your Java libraries are not loaded or are not in the correct place. Check your environment variables to see that the jave library is included in PATH.
the code running very well in visual studio2012 windows Application but not working never in WCF or asp.net web
I seriously doubt that you have Java code running with WCF and ASP. Although the latter is just possible it isn't something that someone is going to succeed at without knowing what a class path exception is.
Much less running in VS.
Member 1118494 wrote:
i checked all libraries i found that every thing is correct
What you POSTED tells you EXACTLY what the problem is. You are missing a class.
So there is absolutely no doubt at all that you are MISSING something in your class path.
From that the following possibilities exist
- Your code is wrong. It is using something it shouldn't be.
- The libraries you are using in your class path are incomplete. You need another library.
- The libraries your class path are wrong, you are using the wrong versions or it is otherwise corrupt or even the path is ill-formed.
- You are not looking at the correct class path.
How can it be? You have already discovered that it does not run in these environments, so it cannot possibly be correct. Go back and investigate why it cannot find the missing class; that is the base problem and until you resolve that you will not make progress.
Thanks Mr.Richard for your reply,,
FYI, i wrote correct code in Eclipse and i test it to send Messages to Local jboss 4.2.3 server,
then i used (fat jar) application to create ONE JAR file to my project then I used IKVM to convert JAR to DLL file, Finally i create visual C# windows application then i add a reference to my DLL and i used in C# application, while testing my C# application it is working 100%
but only if i add a reference to my DLL in asp.net or WCF i got an error.
and also i would like to inform u that i used the same code as WEB SERVICE in eclipse and i test the application to send the message to local jbosse 4.2.3 (127.0.0.1) i found that every thing it is working well and if i changed the IP address to send the Messages to Remote jboss (192.168.115.20)
i got an error (Destination Queue not bound)
so my goal to do the last tow cases are to send messages to REMOTE Server ether By Web Service OR DLL
my problem how to configure jboss & JNDI code to send the message to REMOTE Jboss server
or how can i solve the last tow cases?
Your answers are appropriated.
Sorry, i know how can i use IKVM and i used already
My question is how to configure Jboss 4.2.3 and JNDI configuration to connect to Remote server.
thx Note: IKVM used to convert JAR to DLL like the follwoing command:
c:\ikvm>ikvmc -target:library c:\myjar.jar