Thomas Poffet

Greenhorn
+ Follow
since Mar 28, 2008
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 Thomas Poffet

I am trying to get different information changing every 10 seconds on a line.
The information should be provided by a backing bean, but this is the next step.
Currently I am stuck with the first step, trying to assign text to outputText using javascript.

Following is my approach:
starting with:
<BODY onload="init()"
Having outputText:
><h:form id="Broadcast" >
<h:outputText id="broadcastMessage" value="Text" />
</h:form>
Having some javascript:
var broadcast = document.getElementById('Broadcast:broadcastMessage');
init();
function init() {
broadcast="New";
}

The result when doing this: The value of :outputText is never changing from "Text" to "New" ... am I taking the wrong apporach

To be mentioned:
...using Firefox 5.0
...it does not make much sense just changing from 'Text' to 'New', a will add some functionality where different information is being rotated



12 years ago
JSF
I need to add a length to a string which I am sending via socket connection to an external system. The format is: first 4 bytes having the length followed by data.
Should look like: 0x00, 0x00, 0x00, 0xA1, < data stream with the length of 161 characters (0xA1) >.
Doing things like: int i= 161; StringBuffer sb = new StingBuffer(); sb.insert((char)i) works up to 127. Char should be unsigned, but not supported with Java.
Any idea? Thanks.
Folowing is the exception class and the method in the SessionBean where the Exception takes place...
....does it have something to do with the remote stuff???

package com.xyz.dhaulagiri;

/**
* DhaulagiriException is the project internal exception class.
*/
public class DhaulagiriException extends Exception {


/**
* Constructor.
* @param psReason is the reason of the exception.
*/
public DhaulagiriException(String psReason) {
super(psReason);
}

}

....
....
/**
* Get Reference Table contents.
* @param psTable Table.
* @param phSelectionCriteria Selection criteria.
* @return Vector A list of transaction entries
*/
public Vector getRefTableContents(String psTable, Hashtable phSelCriteria) throws DhaulagiriException {
try {
Vector vResult = WebserviceSupport.transform(phSelCriteria,psTable,EzeizaConf.StrElmValWSClientServiceForSanxiadaba,cnf.getServices()); // that's where the error happens
return vResult;
}
catch (EzeizaException e) { // the EzeizaException is transformed to a DhaulagiriException
LOG.error("Error in library");
throw new DhaulagiriException(e.getMessage());
}

}
....
....
15 years ago
An exception cannot be caught when it happens in a session bean..... What does that mean exactly?
I am getting an exception in a session bean and want to catch it in the method which calls the session bean. I don't understand why it is not caught by the specific catch block for that message.

eg.

try {
// connection to session bean
LOG.debug(&quot;getting data selection start&quot;);
Context initial = new InitialContext();
Object objref = initial.lookup(EJB_WSCLIENT);
WSClientSeHomIf home = (WSClientSeHomIf) PortableRemoteObject.narrow(objref,WSClientSeHomIf.class);
WSClientSeRemIf ws = (WSClientSeRemIf)home.create();
Vector&amp;lt;Hashtable&amp;gt;&amp;lt;String,String&amp;gt;&amp;gt; vResult = ws.getRefTableContents(strPage,phSelectionCriteria); // that's where the exception occurs
LOG.debug(&amp;quot;getting data selection end&amp;quot;);
return vResult;
}
catch (RemoteException e) {
LOG.error(&amp;quot;Remote exception&amp;quot;);
throw new DhaulagiriException(e.getMessage());
}
catch (DhaulagiriException e) { // that's the exception which actually happens and should be caught
LOG.error(&amp;quot;Exception in Dhaulagiri&amp;quot;);
throw e;
}

catch (CreateException e) {
LOG.error(&amp;quot;Create exception&amp;quot;);
throw new DhaulagiriException(e.getMessage());
}
catch (NamingException e) {
LOG.error(&amp;quot;Naming exception&amp;quot;);
throw new DhaulagiriException(e.getMessage());
}
catch (Exception e) { // that's the catch block which is caught
LOG.error(&amp;quot;Exception is:&amp;quot; + e.getClass()); // and the exception class is DhaulagiriException
String sError = StrErrUnhandled + e.getMessage();
// LOG.error(sError,e);
throw new DhaulagiriException(sError);
}


Why is DhaulagiriException not caught, even though it is a DhaulagiriException when displaying e.getClass() ?
15 years ago
I'm using Socket from the java.net package to communicate on TCP/IP port 2036. The client (which has a problem) runs on WindowsServer 2003 and the server on an IBM AIX system. Don't know about the gateways.
Cheers
Thomas
On certain circumstances the client does not notice that the socket is unavailable. Unfortunately I cannot reproduce the situation. But it happened last time when a gateway was down.
The server tries to send the message, but cannot. It stops the communication service. The client does not notice and keeps listening on the port. Latter does not realize that there is no connection and therefore never tries to reconnect.
Does anybody know how to handle that situation?
Thanks
Thomas
I am using BMP EJBs.
When two DB transactions take place at the same time, eg. a deletion and an update, then it can happen that the object which should be updated is deleted and the one which should be deleted remains unchanged.
Does anybody has an idea, what could be the problem?
Yes it has both and it works when I use h:outputText instead of h:inputText
16 years ago
JSF
Hi,
I have a selection list and detail inputText elements which should be populated according to the selection.
But unfortunately I cannot manage to populate an inputText field upon selection.
The backing bean is working fine, because if I change from inputText to outputText it works.
What am I doing wrong? Are inputText fields not rerenderable?

Following are some code extracts:

<rich:panel header="test immediate FLC update" >
...
<h:selectOneListbox
valueChangeListener="#{seaFltHandling.doPopulateDetails}"
onchange="submit()"
immediate="true"
value="#{seaFltHandling.selectedItem}" >
<f:selectItems value="#{seaFltHandling.selection}" />
<a4j:support event="onchange" reRender="rep" />
</h:selectOneListbox>
...
<h:inputText maxlength="3" size="2" value="#{seaFltHandling.flcArr}"
rendered="true"
styleClass="normalbold" id="rep" />
...
16 years ago
JSF