PankajKumar Mishra

Greenhorn
+ Follow
since Nov 09, 2010
Merit badge: grant badges
For More
New Delhi
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by PankajKumar Mishra

Matthew Brown wrote:String and ArrayList don't have anything in common, so if you really want to have a map that can contain both (and I'd personally be looking for a different solution), just use Map<String, Object>. You're not gaining anything with wildcards.

The reason what you've got doesn't compile is that Map<String, ?> means "a map of some unknown but specific type". That's why you can't add anything to it - because the compiler doesn't know whether it's safe or not. It could be a Map<String, Integer>, for example.




Thanks Matthew for your valuable suggestion, all though the concept you are suggesting I have already implemented, If I am doing so then there is no need of using Generic with this Map.
because ultimately I have to type case for my specific Data type.

Thanks once again. But I would like to know your solution when you find it.

Thanks in advance...
12 years ago
I am using ConcurrentHashMap for storing list of values to be fetched from XML file.

Ex.

ConcurrentHashMap<String, String> paramMap = new ConcurrentHashMap<String, String>();

In new Case I needs to add ArrayList and String in paramMap

i.e. I want something Like ---

ConcurrentHashMap<String, ?> paramMap = new ConcurrentHashMap<String, ?>(); /// Generating Compiler Error

ConcurrentHashMap<String, ?> paramMap = new ConcurrentHashMap();/// Ok

paramMap("key","Value"); //Compiler error not allowed

paramMap("key",arrayList); //Compiler error not allowed

Capable of accepting any type., and implicit conversion to respective data type. i.e. either in String or ArrayList


Please help me If something is possible like that...
12 years ago

Peter Johnson wrote:1) Exactly how are you starting JBoss AS?

2) Have you changed any of the ports, especially the JNDI port (1099 by default)?

3) Is JBoss AS is running in the same box as the client?

4) Have you using any OS tools (such as netstat) to verify that the ports are actually open?

5) Which OS are you using? I suspect Linux, but knowing which distro and version would help.

6) If you are running Linux, do you by any chance have SELinux enabled?




1) I am starting Jboss over Cent O.S. 5.5 release, using run.sh -b 192.168.1.71.

2) I have tried to change default port 1099. and also tested with no change to default port.

3) What exactly Box stands for .. is it same O.S./Machine, or Same Application Container.
3.a) I am running both client and server on same OS/Machine.

4) I have tested it. But I think it was open by default as per JBOSS default configuration.

5). Yes it Linux - Cent O.S. 5.5 release

6). No my Operating System is not enabled to SELinux.

Dear Peter Johnson,
The above description are as per you request. Sir, Although my organization have switched to different EJB version.
I am also able to run EJB 3. and resolved above thing only in IDE.

I am in extream need your suggestions and Eager to know what above questions have relation to my app.
13 years ago
My Code for Client Program



Executed from $JBOSS_HOME/client $java -classpath '.:./*' TestClient
-----------------------------------------------------------------------------
OK0
OK1

javax.naming.CommunicationException: Could not obtain connection to any of these urls: 10.168.1.71:3837 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server /10.168.1.71:3837 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server /10.168.1.71:3837 [Root exception is java.net.ConnectException: Connection refused]]]
------------------------------------------------------------------------------
If jboss is executed without binding address
------------------------------------------------------------------------------
javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost/127.0.0.1:1099 [Root exception is java.net.ConnectException: Connection refused]]]

-----------------------------------------------------------------------------------
Not able to get Right help from jboss community... Please help in solving the above problem
13 years ago


Dear friendz, I am using Tomcat Apache server 6.x on Netbeans 6.1 plate-form.
I have created a Struts based application. That usage user authentication to use its home page.
That authentication usage database connection and db con use (oracle.jdbc.OracleDriver thin client driver).
Generates following error at the time tomcat stopping.
Help me in resolving following problem.

Way to register is --> Class.foreName("oracle.jdbc.OracleDriver"); and place is Context Listener Servlet during load of application server.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Dec 21, 2011 6:39:50 PM org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8086
Dec 21, 2011 6:39:53 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
Dec 21, 2011 6:39:56 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/MyStrutsOne] registered the JDBC driver [oracle.jdbc.driver.OracleDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Dec 21, 2011 6:39:59 PM org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8086
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Thanks in advance, Please help me!
Many thanks Sam Mercs and Tim Holloway for yours great I ideas,

I am not some on have good hand over the Architecture design.
My TestThreadPoolExecutor is class which is using java.util.concurrency.* api and handling A Thread responsible for database connectivity.

I am so good to Programming with Java Technology and The proposed system was given to me 3rd day of my joining the 1st organization as S/W Eng on Java. It was test to my ability as self learner!
I have posted this post after founding myself helpless..

All though the above architecture with bit Modification and using Socket Programing had solved by my Senior.
I am happy that I got answered. I will learn yours recommended Technologies ORM (hibernate or even Spring DBUtils).
-------------------------------------------
I request for yours suggestions of learning technologies as I am in Telecom organization, which handles CRBT(Caller Ring Back Tone), Voice Mail, Voice SMS and cards like Dialogic and Songoma.
-------------------------------------------
This is an small org and I have to learn a lot by self. I am very happy and I am sure that I will learn a lot from here

Thanking you all in advanced!
13 years ago

Hello guys this Pankaj Kumar Mishra , Right now I am working on a model asked by my Project Manager. This Model have following description with its problem and requirement.

1- Problem - There a is an client server application, in which Client is sending request to server and server responding it back to client.
The server is using Tomcat Appache web Server and DBCP for connection pooling. It was not working well as The DBCP usually has lots of connection instance free but request are unprocessed!
2- Requirement Description of New System:
There should be a system which accept the coming HTTP requests ,parameters and type of activity required by request.
a). A front controller System receive requests and its parameter. Enqueue Them into a queue
b). there should be 10 thread having independent db connection - responsible for dequeue information from queue by checking them and process the request
b) Finally processed request send back to Front controller so, that information can be send to the client side.

3- Solution to the System: and My Architecture- 4- Classes as per Description
a) Servlet as Front Controller --------------------------RequestReciever.java
b) A Queue class based on Fundamental DataStrutcture -------------------------RequestQueue.java ==with==RequestObject capsule to insert into Queue --RequestObject.java
c) A Sole class to Handle database connectivity , datafetch and update ---- ----------------------CoreConnector
c.i)A ChachedRow Class to hold records and even after connection ends --CRSHolder.java
d) Thread Class Which activate the Connectivity and Process the busyness Logic. -------------------------- ProcessRequestFromQueue.java
e) A ThreadPooler responsible for creating ThreadPool and handle the above Thread --------------------------TestThreadPoolExecutor
f) A listener to load database driver -------------------------- LoadWebResources.java
g) a Global class having all - public static object objects of ThreadPooler, ThreadClass, Queue and database connector Classes --------------------------globalx.java
The system is using [oracle [Client Driver] ,
This is system is working OK. But not good for what it is designed. As it is for concurrent and high load request handler. It is also making lots of request process unattained at user end.

Please give yours valuable suggestions and If it is wrong then what should be for else.
13 years ago