Mehul Mistry

Ranch Hand
+ Follow
since Feb 10, 2006
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
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mehul Mistry

Hi

I have been writing some microservices  in Spring boot. We have an existing application running in an OSGI container and I need to some few of its components/bundles in spring boot. I know we cannot access the components running in an OSGI container directly however my main question is, can I take those bundle jars and add it to my Spring Boot dependency? Will Spring Boot be able to load the bundles as a regular jars and can I access the api's in it?

I tried referring these bundles already in my pom.xml of Spring Boot application, but no luck. Was wondering is this even possible?

Thanks
Mehul
3 years ago
I tried mentioning ip too the URL. But still getting connection reused. Tried below URLs

"service:jmx:rmi:///jndi/rmi://:127.0.0.1.9999/jmxrmi"
"service:jmx:rmi:///jndi/rmi://:localhost:9999/jmxrmi"

Thanks
Mehul
6 years ago
Yes... 127.0.0.2 is starnge and I am not specifying it anywhere. The URL that I use to connect is as below...

JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://:9999/jmxrmi");
JMXConnector jmxc = JMXConnectorFactory.connect(url, null);

This is what is giving the exception.

Thanks
Mehul

6 years ago
Hello Hello

I am using MxBeans for a small uitiliy in my application and also have a small client program of my own which will connect to the jmx port of my applicaition and invoke the operation on the MxBean. This all was working fine. However I am facing one small issue now and need some help to fix it. (I am not a very n/w and RMI person).

With same client which was working all this time, I am now facing connection refused exception. I really don't understand why it is behaving like this now. Below is the exception excerpt....

------------------------------------------------------------------------------------------------------------------------
Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.2; nested exception is:
java.net.ConnectException: Connection refused]
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:338)
at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:248)
at com.example.Client.main(Client.java:59)
Caused by: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.2; nested exception is:
java.net.ConnectException: Connection refused]
at com.sun.jndi.rmi.registry.RegistryContext.lookup(RegistryContext.java:101)
at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at javax.management.remote.rmi.RMIConnector.findRMIServerJNDI(RMIConnector.java:1886)
at javax.management.remote.rmi.RMIConnector.findRMIServer(RMIConnector.java:1856)
at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:257)
... 2 more
Caused by: java.rmi.ConnectException: Connection refused to host: 127.0.0.2; nested exception is:
java.net.ConnectException: Connection refused
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:601)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.j

--------------------------------------------------------------------------------------------------------------------

I am running the program on a linux m/c running OPEN Suse linux.

Need help, where do I need to find the problem.

Thanks
Mehul

6 years ago
Thanks Kemal..! Will check these..!

6 years ago
Hi All

This question may have been asked before but somehow I could not get it in search.

I am looking for a good book on Java2D. A book which is in category of the book "Swing 2nd Edition" by Matthew Robinson, Pavel Vorobiev. Any suggestion please?


Thank You
Meuhl
6 years ago
Hello All,

I am using POI 3.7 for excel and want to add custom data format to the cell style. The custom type that I am trying to set is date format (dd/mm/yyyy) which is not available in built-in format. There doesn't seem to be any API that can allow setting and retrieving custom date format. All I can do is HSSFDataFormat.getBuiltinFormat(). Is there anyway we can achieve this?

The reason for setting it as cell style is my client want it to be as the data format in the excel. So in the generated .xls file, if he does a right click on the cell containing date, and opens "Format Cells" it should show him as date.

Any help on this will be appreciated. I have been trying this for quite a few days.

Thanks,
Mehul
Hi All
I got this one (after wasting lot of time on my silliness). In my JBOSS datasource file, I had mentioned connection string starting with "jdbc:sqlserver:". Where as at one the places in my application the connection string was for a different driver settings, starting with "jdbc:microsoft:sqlserver:...".

Because this mis-match, JBOSS had booted up with correct driver, but my application was using a different one and I ended with problems.

Thanks all.

Regards
Mehul
Hello All
I have a problem while accessing Microsoft SQL server 2005. I get this error messages while accessing the database,"The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 1 (""): Data type 0x38 is unknown."

There is already a post in this form specify this problem, but somehow I was not able to post a reply over there and hence re-posting the problem (Please excuse)(the post is http://www.coderanch.com/t/305181/JDBC/java/SQL-Server-Microsoft-JDBC-driver#1383889)

The solutions mentioned above post was to change

jdbc:sqlserver://<DB_SERVER>:<PORT>;SelectMethod=cursor;DatabaseName=<DB_NAME>

to

jdbc:sqlserver://<DB_SERVER>:<PORT>;SelectMethod=direct;DatabaseName=<DB_NAME>


I did the above change but still run into with same error. My database is deployed on MS SQL server 2005. I am using sqljdbc.jar file for my driver.

Can someone please help? Do I need a different jar or any other configuration?

Thanks
Mehul



Hi,
I never used NDC before so was not aware of it.In my initial investigations I could not reach there.Anyway, saw the manual, and traced the location where some text is pushed in NDC. Thank you.

Thanks,
Mehul
Hi,
I working with one of the application developed in java and using log4j for logging. It has also been configured for chainsaw tool of Apache. When examining logs for through chainsaw, I noticed that there is a column called as NDC (nested diagnostic contexts). This is printing some text while at some events (Which I am not able to figure out, what kind of event). Also I noticed that when some text is printed in NDC the category for log is "Transactions".
I want to know under what condition this log will be printed and how and from where log4j picks up the string for NDC and prints it on the logs.

Can someone please help put some light on this.

Regards,
Mehul
[ August 08, 2008: Message edited by: Mehul Mistry ]
I want to debug the application which I am launching through JNLP like how we run an application in Debug mode in an IDE.
The reason for this is, that the application is running perfect when I am launching it through my IDE (I am using IntelliJ 6), but when I deploy and run through JNLP, some very few minor things are not working. I tried inspecting the logs but didn't find any clue about what went wrong.
Hence the reason I want to try out and debug in JNLP with IntelliJ. I tried few things I was able get, but nothing seems to be working.

Any inputs, will be very helpful.

Thanks,
Mehul Mistry
11 years ago
Hello all,
I wanted to know how do we debug an application in JNLP.I am searching around the net, but I am not successful in doing it.


Thanks,
Mehul Mistry
11 years ago
Hi all,
I solved this trick. I created a singleton class, which will register the object of my custom TableModel, I used to create the table.Also in this class I kept one method changeColor() which fires fireTableDataChanged(). My timer thread would be using this class at particular events and calls the changeColor() method.
As this is done, my table is repainted and in my TableCellRenderer I implemented the logic to change the color of the rows which I wanted. Again, which color to change and at a particular time was maintained at common place.

Thanks.
11 years ago
Hi all,
I need to do tricky stuff but totally lost on how and where to start. I have a JTable in my application to which I'll be adding some rows dynamically based on some events. I have used my own table model class (which extends DefaultTableModel) and also implemented a TableCellRenderer to construct the table.
Now I need to change the background colors of some rows based on some caluclated time events. To be more clear about this, once the rows are added, after sometime I need to change the color of few rows, based on some countdown timer.The color will keep on changing, as the countdown timer nears to a deadline time.
What I am planning to do is, have a seperate class to run a thread for countdown time. I'll also try to get the Jtable and the table model objects to that class. But once a certain time occurs, how do I change the colour of one particular row, and that too outside of the class contructing the table. I don't know how do I get hold of the rows I need to change the color.
Any inputs and advice will be very very helpful.

Thanks,
Mehul
11 years ago