Alexandr Shvedov

Greenhorn
+ Follow
since Jul 12, 2006
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 Alexandr Shvedov

Yes is not a problem. We can put libs in some other dir so JBoss will not find them and we can use custom loader.
The system works with the following way - when request comes to the server I can read request type from that. Then I analyze jar file manifest in some defined dir and get information about what class implements request processing algorithm for that type of request. Then I can just load this class with class.forName() of URLClassLoader. But what if that request processing class which was loaded by (myClassLoader extends URLClassLoader)needs another jars? How can I know that? How can I know what classes to load from that jars?
16 years ago
ok, when the request comes I use custom loader to load specific request class. If that class needs another libs they are loaded with JBoss's loader. If I place them in other place JBoss will not find them. How will I know that the class that I loaded needs another class? How can I load that another class with the same custom loader?
16 years ago
I need to do the dynamic loading of features for my JBoss web-app without recompiling or redeploying application. The features is a classes with executeLogic() methods which extends Basic Classes of my web-app. The idea is to allow other developer to add features to my server using small features.jar lib for that(which contains basic classes). The features.lib is in WEB-INF\lib of web-app. What I've done is create 'features' dir in jboss deploy dir and put all these feature classes there.
When request arrives I look up at this dir, get jar-files URLS and put them in URLClassLoader. The problem is that the feature classes is loaded with my classloader (which extends URLClassLoader) and basic classes (super classes for feature classes) loaded with org.jboss.mx.loading.UnifiedClassLoader3. That is why I can not cast FeatureClass to BasicFeatureClass. What can I do?
16 years ago
Hello! I understand the basics of Java Web Services, but have some questions about JaxWS and JBoss.
1) We're doing application with WS. One developer provide me WS interface and said I have to use Axis to use it. As I understand Axis is just implementation of SOAP. But JavaSE6 has already had SOAP support as JAX-WS. Can I use 'wsimport' and standart packages without axis to work with his web services? Will my code work without any additional libs on JBoss after deployment?

2) I was trying to use new YahooMailAPI (WS API) to access mail. They provide working sample with Axis2. A try to generate stubs with 'wsimport' produce an error. Yahoo said, that I required to use Axis. Why? Isn't JavaSE6 libs enought to consume WebServices?

3) If I deploy my app, which uses Axis(Axis2) stubs on JBoss will it work without any additional (Axis) libs there?

Thanks.
16 years ago
Hello everybody?
I am currently adding functionality to JDBC driver to conform JDBC4.0 (java6) standard. There is a new interface in Java6 - java.sql.Wrapper.
Can anybody answer me, why do we need this interface and (optionaly how to implement it?
Hello, Henry!
It seems to me, that deadlock is possible in my program and thank you for your sample. Couldn't we just use notifyAll() to solve the problem?
The deadlock happens when notification is send to 'wrong' thread. If we can move all kind of threads (i.e. notifyAll()) to 'ready-to-run' state then even if some of thema go to 'wait' then the others can solve the 'deadlock'.
There some states in which a thread can be in. They are - running(hold the CPU), ready(ready to start running) and various other states.
When a thread becames 'ready' it can be moved to running state only by thread scheduler. You can not guaranty that it happens in a sec, in a day or somewhere in the future, because it is up to scheduler to decide.
You also think that notify() can just send notification to 'wrong' thread. We have two kind of threads here: producers && consumers. If object can notify 'wrong' thread it means that there must be at least 2 different kind of threads in waiting pool, but it seems to me that it is impossible, because the thread here can go in waiting pool only if object is locked be the thread and while() condition matches. We have 2 opposite while() conditions here, when one true and thread going to waiting pool it means another condition is false and thread should be noticeable. Am I right?
[ February 05, 2007: Message edited by: Dmitry Popov ]
Hello! Well, the developer in company I have been tested in said that it must be deadlock. When I asked he tried to produce deadlock scenario, but he failed. Then he tried to tell me that notify() must be called out of syncronized code, but I said that he is wrong and show him javadoc. Then he just 'found' the deadlock scenario and said that it is certanly deadlock, then he told me bye

If you think that it is deadlock can you produce reasonable deadlock scenario? (please)
Hello everybody?
I wrote a test program for my employer. But developers there said that it is wrong and cause a deadlock. Please, comment if it is so or not?
The task is that there is N producers and M consumers. One generates integers and another print it to console. My code is below:

==Producer.java==

==Consumer.java==

==Storeable.java==


==Main.java==
Hello!
We need to start cmd.exe window from our swing application. There is no problems with that. We us next code



The problem is that user must see what happened in console when working with swing application. How can I do so that cmd window stay on top of the swing application? Another words it shouldn't be hidden by main app window when user clicks on it. It seems to me that I should set some window attributes. How can I do that? Or maybe there is a way to forward outputStream from working program to JTextArea, while this program is working?
Thank you.
17 years ago
I've solved this problem. I just write this at the end of my handler

)
17 years ago
Hello!
I have JTextPane component in my application, which is wraped in JScrollPane. It was function good, until I added MouseWheelListener to JTextPane (I use it to change font size when CTRL is pressed). After that it is impossible to scroll text with mouse wheel.
How can I return default behaviour of the component and save my listener?
17 years ago
Hello!
I have some problems with the way to deploy my Java application. One is to lanch my J2SE application with .exe file. I overcame this problem by creating .exe file which lanches javaw in different process. Another problem is how to install my application on user's PC. The install process should be easy to the user and must not puzzles him with questions like "Do you have JVM 1.5 or greater on your PC?" So the rulles of installations are:
1. There must be single file (installation package)
2. Check if there is JVM 1.5 or greater on user's PC then proceed to application install, else install JVM first
3. JVM installation should proceed without any technical questions to the user (except JVM directory may be )

So the questions are: How to build installation package with free tools and how to build in JVM installation to this package?
Thank you.
17 years ago
Hello!
I am writing an application where there is a Java Server and C client (have to connect to server). I am not very good at CORBA. Can you recommend me some sample code or articles to read?
As far as I understand to use CORBA you need ORB. J2SE has already had ORB, and what about C, where can I get ORB for it?
Thank you!
17 years ago