Rik Sweeney

Ranch Hand
+ Follow
since Sep 04, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Rik Sweeney

Thanks for the suggestion, I'll give it a try!

Richard
15 years ago
Hi,

I have a JComboBox whose values change dynamically. This all works OK except that the size of the box doesn't change. If I resize the browser window then the applet refreshes itself and the box resizes itself too.

This problem only appears to happen in the applet so was wondering if anyone can suggest how to make the box resize itself automatically. Here is the code that I'm using:



Thanks

Richard>
15 years ago
Hi,

I'm using Apache's Xerces 2.9 in my web application. When I try and run it, I get the following error:

SEVERE: Servlet.service() for servlet LoginServlet threw exception
java.lang.VerifyError: (class: org/apache/xerces/jaxp/DocumentBuilderImpl, method: parse signature: (Lorg/xml/sax/InputSource Lorg/w3c/dom/Document Incompatible object argument for function call
at org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.newDocumentBuilder(Unknown Source)
at org.netbeans.modules.schema2beans.GraphManager.createXmlDocument(GraphManager.java:414)
at org.netbeans.modules.schema2beans.GraphManager.createXmlDocument(GraphManager.java:384)
at org.netbeans.modules.schema2beans.GraphManager.createXmlDocument(GraphManager.java:331)
at org.netbeans.modules.schema2beans.GraphManager.createRootElementNode(GraphManager.java:115)
at org.netbeans.modules.web.monitor.data.MonitorData.<init>(MonitorData.java:53)
at org.netbeans.modules.web.monitor.data.MonitorData.<init>(MonitorData.java:46)
at org.netbeans.modules.web.monitor.server.MonitorFilter.setupDataRecord(MonitorFilter.java:459)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:306)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:619)

If I use Sun's internal implementation then it works fine, but I can't rely on this forever. Does anyone know how to fix this?

Thanks

Richard
Hi,

I was wondering if it's possible to change the mail.smtp.host after you've constructed the MimeMessage. The reason I ask this is because I need to support a failover SMTP server. At the moment I'm creating a new MimeMessage and copying everything from the old message into the new one:

Is there a better way of doing this or do I have to construct a new MimeMessage?

Thanks

Richard
18 years ago

Originally posted by Ernest Friedman-Hill:
With few exceptions, wait() should always be called in a loop: "while(x) wait()" rather than "if (x) wait()". The reason is that a Thread may be notified, but then before wait() returns, some other thread's wait() also returns and invalidates the condition. The "if(x) wait()" assumes that when wait() returns, x has become false, but it ain't necessarily so. The "while" version will not make this mistake.



OK,

so changing the code to



Appears to have solved the problem, but please feel free to shout me down if this still isn't right!

Richard
Hi,

I have some code to pull an object out of a pool. The pool is just a vector and it lives in a singleton. I've synchronized both the obtain and release methods. Here is the code:



In my main class I created 500 Threads which all try and get an object, wait a bit and then release it. Since there are only 50 in the pool, I would expect to see the following:



The problem is though that I get the "Obtaining Object" printed out 50 times and then "Couldn't get Object, waiting" another 450 times.

I don't get why this happens as surely only one Thread can access the getObject at any one time.

Does anyone have any suggestions?

Thanks

Richard
Hi,

I'm using a Lotus Notes API to connect to a server. This worked up until the point where the IP address was changed and now the lookup resolves back to the original IP address, even if I use the new IP address instead of the host name! I get the following exception

NotesException: Could not open Notes session: org.omg.CORBA.COMM_FAILURE: java.net.ConnectException: Connection timed out: connect Host: xxx.xx.xxx.xx Port: 63148 vmcid: 0x0 minor code: 1 completed: No

Basically I was wondering if CORBA might be caching the lookups and how I can clear it.

Thanks

Richard
18 years ago

Originally posted by Adeel Ansari:
Check out JSP Faqs: File Upload


Thanks! That's perfect!
18 years ago
Hi,

I'm using the MulitpartParser to handling uploading. This all works OK except if the content exceeds my maximum. If this situation occurs I don't seem to be able to recover any of the other posted information, which means that the user has to enter everything again.

Is there a way I can recover the other information in the Request? Is there another multipart class that can do this for me?

Thanks

Richard
18 years ago
Thanks for the suggestion. I had a quick look in the constructor and changed it to



This solved the problem!
19 years ago
Hi,

I'm adding nodes to my JTree, but it is not being updated. If I add a node to the root, then the tree updates OK, but then if I add another, nothing happens. If I then add a node to the child of the node, then the tree updates OK and will show the node number as if all the other nodes have been added.

Anyway, here's the code



Does anyone know what I'm doing wrong?

Thanks

Richard
19 years ago
Hi,

Is it possible to repopulate a Form from a database? Basically I have an EmployeeForm and I want to use the same EmployeeEdit.jsp file, so what I have done is pass over the Employee ID I want to edit to my Action. The EmployeeFactory will then retrieve the user and populate the form. My JSP is not populated though. Here is the code



Is this the correct way to populate a form?

Thanks

Richard
19 years ago

Originally posted by karthi keyan:
Store the remote reference in HttpSession or serialize it into a file or in a database ...The storage logic should enable the retrieval of the specific stateful sess bean at a later point of time ... Later retrieve the remote reference from the storage location and invoke.



Thanks, I'll give it a try
Hi,

I was just wondering how I retrieve a Stateful Session Bean. I thought I could retrieve it using

ShoppingRemote cart = cartHome.create(userName);

However, when I do this I've lost the contents of my bean.

Can anyone help?

Thanks

Richard
Hi,

I've deployed my EJB to the Sun Application Server but I don't know what I need to provide as my Context.INITIAL_CONTEXT_FACTORY and my Context.PROVIDER_URL. I've had a hunt around Google but haven't had any luck.

Can anyone suggest what I need to use? Currently I'm using

properties.put(Context.PROVIDER_URL, "iiop://localhost:4848");

and

properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");

Which times out with javax.naming.CommunicationException: Cannot connect to ORB

Thanks

Richard