Manohar Karamballi

Ranch Hand
+ Follow
since Jul 17, 2001
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 Manohar Karamballi

We have pool of BackendInvoker instances which will be pooled. (Start size =2, incre =2 ; Max = 8). Potentially there can be 12 requests max at a time. And read thread polls for every 3 ms.

Please let me know if more information is required.
Also my assumption that same thread is going to start and stop timers is incorrect.
Looks like my problem is not understood properly. Here is the code snippet where I am having issue.

public class BackendInvoker
{
public synchronized void writeToSocket(request)
{
//Write to socket logic
timer.start();
//Other business

}

public sychronized Response readFromScoket()
{
timer.stop() //Well..Issue is which timer to stop
//read from socket
}

}

Note that write and read methods are executed by different threads. write is executed when client requests. Where as read is executed from a thread which contantly polls sokcet for response.

Can anybody suggest the best way to handle this?

Also let me know if I am not clear in describing about problem?

Thanks in advance.
Manohar
My app is multi threaded..

For instance timer1, timer2, timer 3 are started in that order and timer3 may be required to be stopped before 1&2.

And my stopping component (SocketListener) have no clue regarding which timer to stop.. (Or which key to use to get timer)..

I am thinking of using thread ID as key. (Again assuming, that same thread will try to start and stop timers)

Anything wrong in assuming so?

Regards,
Manohar
Ok..I will try to give more detailed requirement..

We need to mesure time elapsed in backend which we are querying..(through scokets..)

There is a component which writes to the socket (say SocketWriter) and there is a component which listens socket (Say SocketListener). We start timer just before writing to socket in SocketWriter and stops timer in SocketListener and time elapsed will be time difference..

However issue is this is multithreaded program and simultaneously you can n 'timers' running..So stack based approach is ruled out..Secondly to identify these timers by generating some key, issue is SocketListener has no idea what key to use.

Hope I am clear..Let me know if you need more details on requirements.

TIA,
Manohar
Just got an idea..Can I use current threadID as a key?? Any issues in doing so? Though my application is multithreaded, it appears to me that single thread is gonna start and stop timers.

Any suggestions?

Thanks,
Manohar
Preuss/James,

Thanks for your replies.

How do you decide which component starts/stops which timer?



I can answer one half of the question, i.e which component..I know from my requirements, which component can stop timer..Regarding "Which timer", this is the place where I am facing an issue. As my application is multithreaded, I cannot guarantee that I am going to stop intended timer.

use a stack of timers



As my application is multithreaded and need not be a symetrical one, I cannot use this approach.

I am interested in knowing any desing pattern address similar problem. I believe this is structural issue. I am planning to generate a unique key by some complex alogorithm.

Any better solutions?

TIA,
Manohar
All,

We have an interesting design problem. We have a requirement where a state of object is controlled from different components of an application. Typically created by some component and destructed by some component.
(We need to start timer in some component, stop timer in some other component , calculate time elapsed and discard that timer)

We thought of using look up tables for this. However, there won't be any primary key to identify the specific instance of timer. (Same timer need to be stopped as the one which is intended)

Is there any better solution for this? Also is there any design pattern that addresses similar problem?

TIA,
Manohar
All,

we are sending XML that consists of CDATA sections. Issue I am facing parser is generating nested CDATA sections for each newline feed it encountered within CDATA sections. FYR, I am attching CDATA input and CDATA as parsed by parser.

CDATA input
==============
<xmlData><![CDATA[<?xml version="1.0"?>
<form>
<type>UNKNOWN</type>
<code>1234</code>
</form>]]>
</xmlData>

CDATA as parsed by parser
===========================
<xmlData><![CDATA[<?xml version="1.0"?> ]]><![CDATA[
<form> ]]><![CDATA[
<type>UNKNOWN</type> ]]><![CDATA[
<code>1234</code> ]]><![CDATA[
</form>]]>
</xmlData>
18 years ago
With reference to the javaranch post that posted here,

I am also facing the same problem but i did not quite understand the way Sachin solved it.

Please let me know how to solve it.

Also please let me know in which jar file com.ibm.ejs package is present...

Thanks in advance.
Manohar
19 years ago
Hello all,

We are trying to set up a portal application in Weblogic server 6.1 , portal version 4.0, Documentum 4.0

We are getting following exception during deployment of some EJBs.


####<Jan 11, 2005 3:16:08 PM GMT-05:00> <Warning> <EJB> <LEO> <portalServer> <main> <system> <> <010063> <The EJB: DocumentManager had an <initial-beans-in-free-pool> setting in its weblogic-ejb-jar.xml. An error occurred while creating these initial bean instances. The error was:
nulljava.lang.NoSuchMethodError
at com.bea.p13n.content.document.internal.SPIFastDocumentManagerImpl.ejbCreate(SPIFastDocumentManagerImpl.java:375)
at com.bea.p13n.content.document.internal.SPIFastDocumentManagerImpl_lw366m_Impl.ejbCreate(SPIFastDocumentManagerImpl_lw366m_Impl.java:117)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.ejb20.pool.StatelessSessionPool.createBean(StatelessSessionPool.java:159)
at weblogic.ejb20.pool.Pool.createInitialBeans(Pool.java:198)
at weblogic.ejb20.pool.Pool.onAfterDeploy(Pool.java:177)
at weblogic.ejb20.deployer.Deployer.runAfterDeploymentListeners(Deployer.java:1391)
at weblogic.ejb20.deployer.Deployer.deploy(Deployer.java:1062)
at weblogic.j2ee.EJBComponent.deploy(EJBComponent.java:31)
at weblogic.j2ee.Application.addComponent(Application.java:170)
at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:360)
at weblogic.management.mbeans.custom.DeploymentTarget.addDeployments(DeploymentTarget.java:285)
at weblogic.management.mbeans.custom.DeploymentTarget.updateServerDeployments(DeploymentTarget.java:239)
at weblogic.management.mbeans.custom.DeploymentTarget.updateDeployments(DeploymentTarget.java:199)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:621)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:360)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1557)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1525)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy41.updateDeployments(Unknown Source)
at weblogic.management.configuration.ServerMBean_CachingStub.updateDeployments(ServerMBean_CachingStub.java:2977)
at weblogic.management.mbeans.custom.ApplicationManager.startConfigManager(ApplicationManager.java:372)
at weblogic.management.mbeans.custom.ApplicationManager.start(ApplicationManager.java:160)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:621)
at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:360)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1557)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1525)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy59.start(Unknown Source)
at weblogic.management.configuration.ApplicationManagerMBean_CachingStub.start(ApplicationManagerMBean_CachingStub.java:480)
at weblogic.management.Admin.startApplicationManager(Admin.java:1234)
at weblogic.management.Admin.finish(Admin.java:644)
at weblogic.t3.srvr.T3Srvr.start(T3Srvr.java:524)
at weblogic.t3.srvr.T3Srvr.run(T3Srvr.java:207)
at weblogic.Server.main(Server.java:35)

Any ideas/help in solving this is greatly appreciated.

Please help us out.

Regards,
Manohar
19 years ago
Hello All,

My XML parser is reporting following error.

[ejbjar] Could not resolve ( publicId: -//Sun Microsystems, Inc.//DTD
Enterprise JavaBeans 1.1//EN, systemId:
http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd) to a local entity

My XML file DOCTYPE declaration is as follows.

<!DOCTYPE ejb-jar
PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans
1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>


I am behind the firewall.

Please let me know If you have ne clue why this happens.

Thanks in advance.

Manohar
I figured out solution..

Solution is
while importing instead of importing like import java.beans.* import like java.beans.Introspector...

This will help javadoc to find Introspector ....

This worked for me though it's crazy way of doing things

:-)
Manohar
I am facing coua problem with Javadoc usage.
In one of my classes I have @see tag as follows.

/**
*
* @see java.beans.Introspector
*/

When i try running ant script for javadoc am getting following warning,

[javadoc] javadoc: warning - Tag @see: Class or Package not found: java.beans.Introspector

My ant script for javadoc task containing following element.
<link href="http://java.sun.com/j2se/1.4/docs/api/" offline="true"<br /> packagelistLoc="${j2seDoc}"/>
where $j2sedoc is pointing to doc directory containing package-list file.

If everything is fine, I am expecting that my class not found problem for @see tag is resolved, But that's not happening.

Please suggest me where I am doing wrong.

Thanks ina advance,
Manohar
Hi All,

Here is one more javadoc repair problem..

In my project, many errors are because of mangled (Wrong) @link references. Like referring to non existent Or Renamed classes.

For ex: to refer a method in Imager.<method>

it's writeen as @link Imaging#<methodName>

Since Imaging class is not existing, javadoc task is throwing error.
So, to repair that I have to modify link as @link Imager#<methodName>

It is very tedious to repair that manually. Is there any tool/API/workaround to solve this problem? Or to automate atleast part of solution?

Your suggestions are appreciated.
Thanks in advance.
Manohar