Ashwin Raghavan

Ranch Hand
+ Follow
since Dec 26, 2012
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
7
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ashwin Raghavan

K. Tsang wrote:Instead of converting the class file to exe why not just create a batch (bat) file and say "java MyServer" and the windows service point to the batch file.



I tried that. but apparently you cannot point a serivce to a batch file..

Martin Vajsar wrote:
Another possibility would be to use Windows task scheduler - it might be nearly as good as a service without the need to create one. But obviously, some amount of setup will always be needed to run an application on a remote server


The thing is i want the program to run automatically when system reboot happens. so i thought making it into a service is the best way to where in we can just make start = auto.


Claude Moore wrote:

I don't know how sc create command works, but on the base of the error you posted, I would say that the problem is that the equivalent of onStart() method doesn't terminate (or, better: it doesn't return control to SO) in a reasonable quantum of time. I don't know even how Launch4J works, I can only suppose that it uses main() method as entry code. You should try to review your main method and verify if you can start a daemon thread there.


SC is to perform operations on windows services. I think what you are pointing is correct. There is not call back method which returns the control back. My socket server does have a main method. I can make the main method return some output. right now it sends void. Can you tell me the exit codes which is returned back when the service is created.
6 years ago
Hi

I created a simple socket server programme in java. My intention is to run this program as service on remote machines. This program will listen to all the requests coming into a designated port and then gives responses.
this is what i did
1) compiled and created a .class file.
2) used Launch4j to convert the .class to .exe.
3) used a batch file on to create a service. sc create <service name> binPath =<path of the .exe file>

Now here is problem. the service gets created. but when i try to start the service. it says that the program did not respond in timely fashion. and the service doesnt start. but in reality. it actually executes the .exe file. i confirmed it by checking the port number which it should listen and the port is occupied. i also confirmed by using a socket client program and send a message. the program responded perfectly.

so in summary. windows says that it could not start the service which it actually did. Now i think the problem is because windows is not able to comprehend the .exe file and hence although it is running it is not getting the desired exit code to make sure the service has started. what is the solution for this


1) can i have some other tool which can convert my .class to .exe
2) IS there any other way to do this. I do not want to use Java service Wrapper. my intention is to give my users, a small package. which will help them to run the socket server program as service with minimum effort. With JSW alot of config changes has to be made to convert a java app into a service.
3) Any other suggestions.


The whole objective is, i have a socket server program which I need to run it as a service on remote machines. After that i will pass some basic laundry commands from socket client residing on my server, to run on these machines and fetch the output.

6 years ago
Hi

I am new to spring. I am trying to create an application using Spring MVC, Now my question is. whether to deploy it in tomcat 7 or in Jboss 7..x. Now my application is going ot be plain and simple. It has some web pages in Jquery, which will take the input process them and then send the final request to another web service. I really do not need to anything with JMS, but do need to connect to mysql database.


Now i tried running a test app in jboss. it is a pain. i am not sure whcih version of MVC to choose. I had mvc 3.0.1, and it did not deploy on the jboss server. It had some classnotfoundExecption:org/jboss/virtual/VirtualFileVisitor error. After lot of search on net.i found that spring mvc 3.0.1 has this issue with jboss 7 and they have recomended to use spring 3.2.x. With 3.2.x i am getting a property souce error. so not very sure which version of MVC to choose.


summary
1) whether to go for Jboss 7 or tomcat 7
2) which version of mVC to choose to run without any errors.

Thanks in advance.
6 years ago
thanks for the reply


Really appreciate it
6 years ago
well what you are saying is true. but here the case is a bit different due to a lot of processes. to install the ssh server the client has to ask some other team to push the software into his node. once done then he has to proceed with the installation. and more often than not. app owners have no idea how the ssh thing works.

In my case. all i have to do is to give the client the my executable and all he has to do is to install. so i was thinking of such an alternative. is it possible to run a java program as a service which will have servlets listening to my requests? ok. it looks like i am trying to substitute SSH Tectia itself. but that actually is my aim. to connect to the server and do the stuff without having ssh in play. all by ysing java.

Is is possible.
6 years ago

Richard Tookey wrote:
An SSH server running on the remote server is an agent so I suspect that what the client wants is to restrict your access much more than SSH does.



Kind of yes and no. Thing is from his perspective. it becomes a tedious task to install ssh server on all his machines and then copy the keys on them. so wants to go for a better solution.

With your proposed solution you will need to have a Servlet container running on the remote computer and then you will need to be able to upload war files too it presumably using some secure agent such as SSH ! Ooops - SSH is not permitted so what to use to upload the war files?


Not exactly. yes. we need to have a serlet container running. i was thinking more on the lines of like, i will create all the serlets. package them into war. Now. i want to have an executable file. which i will give to the client. and all they need to do is to run the executable (batch or anything) and the war will get deployed onto their server... sounds crazy... but is it possible to do it this way.


or another way is to make this as a service. all cient needs to do is execute the batch file. once executed, a new service will be running on the remote machine which will have servlets listening to my requests.



Also, if you aim to get anything approaching the security of SSH you will need to use HTTPS with client and server side authentication.



Well thats true. but all the servers are inside a secured domain. meaning we all belong to the same secured domain which cannot be accessed from outside.
6 years ago
Use and <fx:script> tag inside the item renderer to declare the radio button group.


6 years ago
not sure if i understood you correct. currently your output is

superman
sober

and you want it to become
Soberman

is that correct?
6 years ago
Hi

I have to do some operations on a remote machine. we used to ssh to connect to the remote host and do the operations. but now the client does not want to use SSH to connect. He wants to have an agent running which will listen to all the commands we send from our hosts, and perform the required operations. Is there any way this can be achieved.

This is what i think can be done.

I have written a web service in java and have packaged them in war. now i want to install this war as a service on the remote host, so that the web service end points are active on the host. all i will do is to send some messages to these listener end points and then run commands on the host.

I am not sure if it is even possible. Can some one point me to any appropriate link, or books if any.


6 years ago
Hi

I have a main Dashboard.jsp. On this i have two frames. suppose they are frame A and Frame B. Now the contents of Frame A is a jsp called Menu.jsp There are some button inside Menu.jsp

My requirement is ithat.. Depending on the buttons I click on Menu.jsp (the one embedded in Frame A), A new page should load on the Frame B.

I did this on Onclick of the buttons. but it does not seem to work.

top.frames['FrameB'].location.href = NewPage.jsp';
Hi

I am having a weird issue with in my app.

I am using xml inside an advanceddatagrid. the data in the xml changes dynamically and is reflected on the ADG at real time.
Now i do this to expand all the children int eh data grid

myAdvancedDG.validateNow();
myAdvancedDG.expandchildrenof(mydataprovider, true);

now the problem is when ever the data changes a duplicate row is created on one of the rows in te bottom of my screen. if i remove validatenow() duplicate rows is not created but it does not expand the xml.

any ideas how to expand the xml without using validatenow().

any solution is welcomed.
6 years ago
My application was small. so i packaged both of them in a war file and deployed them. it worked well. Thanks for the solution. although i wanted to ask. If i pack my webservices into war and ejb into jar and them package both of them to ear. when i deploy it on the server would the war file get self extracted and be hosted on the server automatically??

right now my war gets extracted and wsdl file gets created automatically. which is what i want. would it be possible if package them seperately and put them in ear??
7 years ago
Hi

I have an Advanced data grid.
<mx:AdvancedDataGrid dataProvider="{new HierarchicalData(xml)}" >
<mx:columns>
<mx:AdvancedDataGridColumn dataField="@someField">
<mx:itemRenderer>
<fx:Component>
<mx:Label htmlText="{data.@someField}" />
</fx:Component>
<mx:itemRenderer>
</mx:AdvancedDataGridColumn>
</mx:columns>
</mx:AdvancedDataGrid>

Now i want to add colors to this column. Is it possible that i use another item renderer to do that. I tried adding item renderer to this column but it is erroring out. I do not want to use style functino as it the dataprovider is huge and it slows down the screen when i scrol up and down.
7 years ago
Hi

I have created a web serivce server side. I take the xml from the client and pass the children of the root node into a JMS queue, whihc is an destinatin for an MDB.

I have two questions

1) I have exported the project as war and deployed on jboss 7.1.1. Everythign works fine. The request from teh client is recived and is send on the JMS queue. but for some reason the message is not reaching to the OnMessage() part of the queue. Doesn;t MDB (EJB) work when it is deployed inside war file?

2) if at all EJB does not work inside a war file. how shall i proceed. Shall i create a war file consisting only of web.xml and the endpoint classes (interface and implementation class) and create a jar file which consists of the all the other files and the war file created above.

7 years ago
Hi

My requirement is to make a server side code for web services. I want to send asychronouse messages from server side to the clients.
This si waht happens I take a request from client and process teh request. There are 4 steps in processing. after each step i have to send some data (status) back to the client.

I have a few question regarding this
1) I read about a push message technique wherein the server can push messages to clients. I have to declare an a method in interface which returns Future.

Future sendAsync(String string1, AsyncHandler handler)

How do i implement this code in my class. I searched in net of the implementation couldn;t find one. Can please have an example code or a link which has the code.

2) Can i use JMS topics for communication. If yes. how can i make the client subscribe the topic on my server.


Although i am writing only the server side code, Have i only to give my wsdl file to the team creating the server side code.

I am using tomcat 7.0 and will deploy the application on unix.

Any help is appreciated.

7 years ago