JAXB Unmarshal.Listener coding
Processing large XML file using JAXB Unmarshall(EventReader) into mapped classes with StAX Iterator AP, but program processes entire XML file instead of stopping at end of XML element. Do I need and how does one set up an Unmarshall Listener?
thanks, william
Processing large XML file using JAXB Unmarshall(EventReader) into mapped classes with StAX Iterator AP, but program processes entire XML file instead of stopping at end of XML element. Do I need and how does one set up an Unmarshall Listener?
thanks, william
Similar Messages
-
Jaxb unmarshal/marshal with accentuate characters
Is it an option to set to manage accentuate characters with unmarshal/marshal methods in jaxb interface.
We are getting the content of your xml document but the accentuate character appear coded and after we marshal an updated content with normal accentuate character we are no more able to parse the document again.We are using utf-8 encoding.
Here is the xml document header :
<?xml version="1.0" encoding="UTF-8"?>
<classification schema-version="alpha 1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:/DOCUME~1/micwic/Bureau/ofs_xml_repository/xmlSchema/classification.xsd">
Here is a part of our document content :
<classification-entry-title>
<classification-entry-main-title language="fr">autres infections intestinales bactériennes</classification-entry-main-title>
<classification-entry-main-title language="en">Other bacterial intestinal infections</classification-entry-main-title>
<classification-entry-main-title language="de">Sonstige bakterielle Darminfektionen</classification-entry-main-title>
</classification-entry-title>
<classification-entry-external-reference>
<classification-entry-external-reference-system>CIM 10 Access database</classification-entry-external-reference-system>
<classification-entry-external-reference-key>26</classification-entry-external-reference-key>
<classification-data-entry-external-reference-import-date>2006-10-19</classification-data-entry-external-reference-import-date>
</classification-entry-external-reference>
</classification-entry>
<classification-entry>
<classification-entry-identification>8</classification-entry-identification>
<classification-entry-code>A05</classification-entry-code>
<classification-entry-code-fullPath>(A00-B99).(A00-A09).A05</classification-entry-code-fullPath>
<classification-entry-category-code>Code level 1</classification-entry-category-code>
<classification-entry-status>enable</classification-entry-status>
<classification-entry-title>
<classification-entry-main-title language="fr">autres intoxications bactériennes d'origine alimentaire</classification-entry-main-title>
<classification-entry-main-title language="en">Other bacterial foodborne intoxications</classification-entry-main-title>
<classification-entry-main-title language="de">Sonstige bakteriell bedingte Lebensmittelvergiftungen</classification-entry-main-title>
</classification-entry-title>
Thanks for help -
Jaxb unmarshal error due to iso-8859-15 character set
I am currently attempting to use JAXB to handle XML unmarshaling. Is there a way to set the encoding used to unMarshall a message to iso-8859-15 as the messages coming in do not have an xml header with encoding specified?
I don't understand. If the XML messages coming in don't specify their own encoding, then their encoding must be UTF-8 or UTF-16. There's no possibility that their encoding can be ISO-8859-15. So why would you want to use ISO-8859-15 to decode them?
-
JAXB unmarshaling: defaultValue not treated correctly
Hi,
Our XML schema defines an int element with default:
<xs:element name="reconnect-interval" type="xs:integer" default="3600" />
Running JAXB compiler (xjc) on that schema results in an object-tree which
fails to return the pre-set default value when 'reconnect-interval' is not set, as it should.
Looking at the JAXB-generated class which contains this element shows the following:
@XmlElement(name = "reconnect-interval", defaultValue = "3600")
protected BigInteger reconnectInterval;
which I take to mean that the defaultValue was indeed detected by the compiler.
Unmarshaling code is traight forward:
JAXBContext jc = JAXBContext.newInstance( <pkg name> );
Unmarshaller u = jc.createUnmarshaller();;
MyRootElem root = u.unmarshal( new FileInputStream( <xml data file>) );
BigInteger reconnect_interval = root,getReconnectInterval();
// reconnect_interval is null
This is somewhat similr to
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6325871
only that bug is marked solved..
OS: Win XP
Ver: JAXB 2.0 (build 2.0-b26-ea3)
Pls help me figure it out.
Thanks,
Gilad -
Toplink-JAXB Unmarshal problem :SAXPlatform createPlatformDefaultSequence
Hi All,
I'm trying to import some classes (generated by JAXB out of an XSD) into Toplink-Relational project and unmarshal the XML contents. But I get the following exception.
07/01/22 13:13:18 javax.xml.bind.JAXBException: Provider oracle.toplink.ox.jaxb.JAXBContextFactory could not be instantiated: Exception [TOPLINK-7147] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.ValidationException
Exception [TOPLINK-7147] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.ValidationException
Exception Description: Platform SAXPlatform cannot create platform default sequence - it doesn't override createPlatformDefaultSequence method
at oracle.toplink.exceptions.ValidationException.createPlatformDefaultSequenceUndefined(ValidationException.java:1515)
at oracle.toplink.internal.databaseaccess.DatasourcePlatform.createPlatformDefaultSequence(DatasourcePlatform.java:540)
at oracle.toplink.internal.databaseaccess.DatasourcePlatform.getDefaultSequence(DatasourcePlatform.java:479)
at oracle.toplink.internal.sequencing.SequencingManager.getDefaultSequence(SequencingManager.java:917)
at oracle.toplink.internal.sequencing.SequencingManager.onConnectAllSequences(SequencingManager.java:713)
at oracle.toplink.internal.sequencing.SequencingManager.onConnect(SequencingManager.java:602)
at oracle.toplink.publicinterface.DatabaseSession.initializeSequencing(DatabaseSession.java:115)
at oracle.toplink.publicinterface.DatabaseSession.initializeDescriptors(DatabaseSession.java:341)
at oracle.toplink.publicinterface.DatabaseSession.initializeDescriptors(DatabaseSession.java:330)
at oracle.toplink.publicinterface.DatabaseSession.login(DatabaseSession.java:512)
at oracle.toplink.ox.XMLContext.buildSession(XMLContext.java:120)
at oracle.toplink.ox.XMLContext.<init>(XMLContext.java:73)
at oracle.toplink.ox.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:9)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:96)
at javax.xml.bind.ContextFinder.searchcontextPath(ContextFinder.java:229)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:149)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:281)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:238)
at oracle.epcis.services.queryservice.executor.ScheduledQueryExecutor.parseXML(ScheduledQueryExecutor.java:111)
at oracle.epcis.services.queryservice.EPCISServicePortTypeImpl.subscribe(EPCISServicePortTypeImpl.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at oracle.j2ee.ws.server.ImplInvocationHandler.invoke(ImplInvocationHandler.java:126)
at $Proxy1.subscribe(Unknown Source)
at oracle.epcis.services.queryservice.runtime.EPCISServiceBinding_Tie.invoke_subscribe(EPCISServiceBinding_Tie.java:450)
at oracle.epcis.services.queryservice.runtime.EPCISServiceBinding_Tie.processingHook(EPCISServiceBinding_Tie.java:952)
at oracle.j2ee.ws.server.StreamingHandler.handle(StreamingHandler.java:287)
at oracle.j2ee.ws.server.JAXRPCProcessor.doEndpointProcessing(JAXRPCProcessor.java:356)
at oracle.j2ee.ws.server.WebServiceProcessor.invokeEndpointImplementation(WebServiceProcessor.java:283)
at oracle.j2ee.ws.server.JAXRPCProcessor.doRequestProcessing(JAXRPCProcessor.java:272)
at oracle.j2ee.ws.server.WebServiceProcessor.processRequest(WebServiceProcessor.java:94)
at oracle.j2ee.ws.server.JAXRPCProcessor.doService(JAXRPCProcessor.java:128)
at oracle.j2ee.ws.server.WebServiceServlet.doPost(WebServiceServlet.java:170)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
07/01/22 13:13:18 --------------- linked to ------------------
Can anyone please let me know the solution for this..?
Thanks
RajasekaranAdding some more information for the same problem.....
I tried to add the sequence like this.. But It doesnt helps..
DatasourceLogin login = (DatasourceLogin)session.getDatasourceLogin();
TableSequence seq = new TableSequence();
seq.setName("OBJECT_EVENT_SEQ");
seq.setTableName("OBJECTEVENT");
seq.setNameFieldName("GUID");
seq.setCounterFieldName("GUID");
login.setDefaultSequence(seq);
Can any one please throw some light into this problem ASAP..?
Thanks
Rajasekaran -
JAXB unmarshal exception "unexpected root element"
I have a very simple xsd and just one xml file I am trying to unmarshal. I switched to jws-2.0 and am still getting the same exception I go when using jws-1.5. I would be very grateful for any assistance on this:
Here is my main program:
public static void main(String[] args) {
getCancelPenalty();
public static void getCancelPenalty() {
String jaxbContext = "generated";
String cancelPenaltyFilename = "CancelPenaltyOne.xml";
JAXBContext jc = null;
Unmarshaller u = null;
CancelPenalty cancelPenalty = null;
try {
jc = JAXBContext.newInstance(jaxbContext);
u = jc.createUnmarshaller();
cancelPenalty = (CancelPenalty) u.unmarshal(
new FileInputStream(cancelPenaltyFilename));
} catch (Exception e) {
e.printStackTrace();
System.exit(0);
int updateTUID = cancelPenalty.getUpdateTUID();
System.out.println("These values were retrieved from " +
"the Cancel Penalty object:");
System.out.println("UpdateTUID: "+ updateTUID);
Here is my xsd file:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="CancelPenalty">
<xsd:sequence>
<xsd:element name="UpdateTUID" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
Here is my xml file that i am trying to parse:
<?xml version="1.0" encoding="UTF-8"?>
<CancelPenalty>
<UpdateTUID>1</UpdateTUID>
</CancelPenalty>
And finally here is stack trace of exception:
javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"CancelPenalty"). Expected elements are (unknown)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:523)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:199)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:194)
at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportUnexpectedChildElement(Loader.java:71)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext$DefaultRootLoader.childElement(UnmarshallingContext.java:920)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:364)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:345)
at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:117)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:200)
at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:173)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:137)
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:184)
at populateDB.Populate.getCancelPenalty(Populate.java:28)
at populateDB.Populate.main(Populate.java:15)
Any ideas what is going awry?Solved:
My xsd file was incorrect (I guess):
instead of:
<xs:complexType name="CancelPenalty">
I needed to use:
<xsd:element name="CancelPenalty">
<xsd:complexType>
Not sure why the first construct is incorrect, but I found another example of an xsd file that used the second construct and it worked for me as well. -
Here is the schema file...
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:group name="body-elements">
<xs:choice>
<xs:element name="h1" type="main-element"/>
<xs:element name="p" type="main-element"/>
<xs:group ref="main-elements" />
</xs:choice>
</xs:group>
<xs:group name="main-elements">
<xs:choice>
<xs:element name="i" type="xs:string" />
<xs:element name="b" type="xs:string" />
</xs:choice>
</xs:group>
<xs:element name="body" type="body-element"/>
<xs:complexType name="body-element" mixed="true" >
<xs:sequence>
<xs:group ref="body-elements" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="title" use="required" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[a-zA-Z_.0-9]{1}[a-zA-Z0-9 ._]+" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="main-element" mixed="true">
<xs:sequence>
<xs:group ref="main-elements" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:schema>Here is the xml file I am unmarshaling...
<?xml version="1.0" ?>
<body title="TestFile" >
Here is a test of this thing!!!
<h1>Header1</h1>
Here is some <b>stuff</b> that we are testing!!!
<p>Basically, we have different <i>tags</i> mixed up about <b>this</b> document!!!
What kind of page will this sucker produce!!! It should work, but we won't know until
we have tested everything out!!!
</p>
</body>Here is the java code...
import javax.xml.bind.*;
import javax.xml.bind.util.*;
import java.io.*;
import test005.autodoc.*;
import java.util.*;
import java.net.*;
public class Test005
private String fileName;
private PrintWriter out = null;
public Test005( String fileName)
this.fileName = fileName;
public void run()
try
JAXBContext jc = JAXBContext.newInstance( "test005.autodoc" );
// create an Unmarshaller
Unmarshaller u = jc.createUnmarshaller();
u.setValidating( true );
Body body = (Body) u.unmarshal( new File( fileName ) );
process( body );
} catch( MarshalException me ) {
me.printStackTrace();
} catch( JAXBException je ) {
je.printStackTrace();
} catch( FileNotFoundException fnfex ){
fnfex.printStackTrace();
public void process( Body body ) throws FileNotFoundException
String title = body.getTitle();
title += ".html";
FileOutputStream fos = new FileOutputStream( title );
out = new PrintWriter( fos );
List list = body.getContent();
System.out.println( "process(List)" );
process( list );
public void process( List list )
Iterator it = list.iterator();
while( it.hasNext() )
Object temp = it.next();
System.out.println( "process(Object)" );
process( temp );
public void process( Object obj )
if( obj instanceof String )
process( (String)obj );
else if( obj instanceof MainElementsI )
process( (MainElementsI)obj );
else if( obj instanceof BodyElementsP )
process( (BodyElementsP)obj );
else if( obj instanceof MainElementsB )
process( (MainElementsB)obj );
else if( obj instanceof BodyElementsH1 )
process( (BodyElementsH1)obj );
public void process( MainElementsI i )
{System.out.println("I");
out.println( "<i>" + i.getValue() + "</i>" );
public void process( BodyElementsP p )
System.out.println("P");
public void process( MainElementsB b )
System.out.println("B");
public void process( BodyElementsH1 h1 )
System.out.println("H1");
public static void main( String[] args )
final Test005 app = new Test005("test005.xml");
app.run();
System.exit(0);
}Here is the output...
process(List)
process(Object)
Exception in thread "main" java.lang.StackOverflowError
I have no idea. I have read about many Stack overflow error when parsing the schema, but that all works. If there are errors in the xml file, they are even validated.
Please help, and thanks in advance!public void process( Object obj ) {
if( obj instanceof String )
process( (String)obj );There is no String version of process(). -
Query in Unmarshaling using JAXB
Hi,
I have some chinese characters in my xml. When i try to read those string from XML using JAXB Unmarshaling and print the same, it is getting changed to some unicode character.
Help me in this regard.
As the chinese characaters are getting changed after preview, if u can contact my thro mail, it will be better ([email protected] is my email id)
Regards
RavishankarPlease post the error message and the exception stack.
My guess is that the error is: your VO's SQL statement did not include the primary key attribute (say Empno).
Thanks.
Sung -
Parsing a single XML node by JAXB
Hi,
we are developing an application to communicate with an XML webservice. Basically there are a lot of diffferent xsd files, one group are object types while another are in and out formats for action requests.
My question here is if it would be possible to parse an incoming XML string, look through it and let JAXB unmarshal only a couple of nodes from the XML. I would do this to parse my XML to a business object (containing other BO's) and because I would have to check on status information that came with the XML before trying to parse anything by JAXB.
Any advice is greatly appreciated.
Regards,
StevenAbove suggestion does not work for me.
Am currently using this solution
feed = event.result as XML;
switch(feed.channel.item.length()) {
case 0 :
trace('No results found');
break;
case 1 :
items = new ArrayCollection(ArrayUtil.toArray(feed.channel.item));
break;
default :
items = convertXmlToArrayCollection(feed);
Help me with a util function or something. -
Hi,
I�m trying to configure and run the examples in the JAXB section of the Java Web Services Tutorial.
When I use the ant tool for compiling and configuring the first example it gives me the following error:
BUILD FAILED
file:C:/tutoriales/jwstutorial13/examples/jaxb/unmarshal-read/build.xml:23: taskdef class com.sun.tools.xjc.XJCTask cannot be found
I search for the jaxb-xjc.jar file (where it is the XJCTask.class file) and I have it in the directories:
C:\j2sdk1.4.1_01\jre\lib\endorsed
C:\jwsdp-1.3\jaxb\lib
I dont know what else to do for the Ant tool to find this class.
Thanks for your time.an example
<!-- Precompile stage. -->
<target name="precompile">
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
<classpath>
<fileset dir="${JAXB.home}" />
<fileset dir="${JAXP.home}" />
<fileset dir="${jwsdp-shared.home}" />
</classpath>
</taskdef>
<xjc target="${src}">
<schema dir="${resource}" includes="*.xsd">
</schema>
</xjc>
</target> -
JTextfield listening for changes from other class
Hi,
Assuming I have a Jtextfield in one of the class1 extend Jframe,
how do I update the jtextfield so that it could up make accessible by other class and continuously updated to reflect the input for value rom another class2.
In other words very much similar to the observable model view concept
class 1 may be look like
private void initComponents() {
jTextField1 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jTextField1.setEditable(false);
class 2 may be look similar to the following
public void out_1(){
setStop1("N");
for (int i=1;i<100;i++){
class_1.getJTextField1().setText(String.valueOf(i)); // System.out.println(i);
setOuti(i);
setStop1("N");HI,
I have attempted with the following coding , test 1 the source display generated using Netbeans GUI , t est2 the worker code ,and mybean the bean , so far nothing seems to work .
I have not try the threaded swing concept as I am not familar with the concurrency but i am not sure whether propertylistener will do the job or not
In summary , list of method employed are :
binding the jtextfield1 to a bean,
jtextfield add document listener ,
Coding objective
1. Test 1 defined jtexfield1 and jbutton
2 Jbutton added actionlistener , where upon click,
Execute Test 2 which will assign a series of integer to the bean , own setters & getters, Output is achieved via Test 1 jtextfield1 supposingly to display all the running number from 1 to 99 continuously until the test2 out_1 method finished the execution
Anyone could provide the assistance .
Thank
* Test_1.java
* Created on July 25, 2007, 9:23 PM
package sapcopa;
import java.beans.PropertyChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.Document;
import sapcopa.MyBean.*;
public class Test_1 extends javax.swing.JFrame {
/** Creates new form Test_1 */
// private Test_2 t2=new Test_2();
private String input_txt;
public Test_1() {
myBean1=new MyBean();
myBean1.addPropertyChangeListener(new java.beans.PropertyChangeListener(){
public void propertyChange(java.beans.PropertyChangeEvent evt) {
bean_chg(evt);
initComponents();
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
myBean1 = new sapcopa.MyBean();
jTextField1 = new javax.swing.JTextField();
jTextField1.getDocument().addDocumentListener(new MyDocumentListener());
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jTextField1.setEditable(false);
jTextField1.setText(myBean1.getRecord_Process());
jTextField1.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
txt1_chg(evt);
jButton1.setText("jButton1");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
But1(evt);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(19, 19, 19)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(32, 32, 32)
.addComponent(jButton1)))
.addContainerGap(131, Short.MAX_VALUE))
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(21, 21, 21)
.addComponent(jButton1)
.addContainerGap(216, Short.MAX_VALUE))
pack();
}// </editor-fold>//GEN-END:initComponents
private void txt1_chg(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_txt1_chg
// TODO add your handling code here:
//myBean1=new MyBean();
try {
jTextField1.setText(myBean1.getRecord_Process());
} catch (Exception e){
e.printStackTrace();
}//GEN-LAST:event_txt1_chg
private void bean_chg(java.beans.PropertyChangeEvent evt){
jTextField1.setText(myBean1.getRecord_Process());
private void But1(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_But1
//getJTextField1().getDocument().addDocumentListener(new MyDocumentListener());
Test_2 t2=new Test_2();
t2.out_1();
try{
System.out.println("Button 1 mybean->"+myBean1.getRecord_Process());
} catch (Exception e){
e.printStackTrace();
// TODO add your handling code here:
}//GEN-LAST:event_But1
* @param args the command line arguments
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Test_1().setVisible(true);
public javax.swing.JTextField getJTextField1() {
return jTextField1;
public void setJTextField1(javax.swing.JTextField jTextField1) {
this.jTextField1 = jTextField1;
class MyDocumentListener implements DocumentListener {
final String newline = "\n";
public void insertUpdate(DocumentEvent e) {
// updateLog(e, "inserted into");
String vstr=myBean1.getRecord_Process().toString();
jTextField1.setText(vstr);
public void removeUpdate(DocumentEvent e) {
//updateLog(e, "removed from");
String vstr=myBean1.getRecord_Process().toString();
jTextField1.setText(vstr);
public void changedUpdate(DocumentEvent e) {
//Plain text components don't fire these events.
String vstr=myBean1.getRecord_Process().toString();
jTextField1.setText(vstr);
public void updateLog(DocumentEvent e, String action) {
Document doc = (Document)e.getDocument();
int changeLength = e.getLength();
// jTextField1.setText(String.valueOf(changeLength));
String vstr=myBean1.getRecord_Process().toString();
jTextField1.setText(vstr);
public String getInput_txt() {
return input_txt;
public void setInput_txt(String input_txt) {
this.input_txt = input_txt;
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton1;
private javax.swing.JTextField jTextField1;
private sapcopa.MyBean myBean1;
// End of variables declaration//GEN-END:variables
* Test_2.java
* Created on July 25, 2007, 9:26 PM
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package sapcopa;
import sapcopa.MyBean.*;
public class Test_2 {
private Test_1 t1=new Test_1();
private int outi;
private String stop1;
MyBean mybean;
/** Creates a new instance of Test_2 */
public Test_2() {
public void out_1(){
setStop1("N");
mybean=new MyBean();
for (int i=1;i<100;i++){
mybean.setRecord_Process(String.valueOf(i));
setOuti(i);
setStop1("N");
setStop1("Y");
public int getOuti() {
return outi;
public void setOuti(int outi) {
this.outi = outi;
public String getStop1() {
return stop1;
public void setStop1(String stop1) {
this.stop1 = stop1;
* MyBean.java
* Created on July 24, 2007, 12:00 AM
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
package sapcopa;
import javax.swing.JTextField;
public class MyBean {
/** Creates a new instance of MyBean */
public MyBean() {
* Holds value of property record_Process.
private JTextField txt_rec_process;
private String record_Process;
* Utility field used by bound properties.
private java.beans.PropertyChangeSupport propertyChangeSupport = new java.beans.PropertyChangeSupport(this);
* Adds a PropertyChangeListener to the listener list.
* @param l The listener to add.
public void addPropertyChangeListener(java.beans.PropertyChangeListener l) {
propertyChangeSupport.addPropertyChangeListener(l);
* Removes a PropertyChangeListener from the listener list.
* @param l The listener to remove.
public void removePropertyChangeListener(java.beans.PropertyChangeListener l) {
propertyChangeSupport.removePropertyChangeListener(l);
* Getter for property record_Process.
* @return Value of property record_Process.
public String getRecord_Process() {
return this.record_Process;
* Setter for property record_Process.
* @param record_Process New value of property record_Process.
public void setRecord_Process(String record_Process) {
String oldRecord_Process = this.record_Process;
this.record_Process = record_Process;
propertyChangeSupport.firePropertyChange("record_Process", oldRecord_Process, record_Process);
* Holds value of property rec_Match.
private String rec_Match;
* Getter for property rec_Match.
* @return Value of property rec_Match.
public String getRec_Match() {
return this.rec_Match;
* Setter for property rec_Match.
* @param rec_Match New value of property rec_Match.
public void setRec_Match(String rec_Match) {
String oldRec_Match = this.rec_Match;
this.rec_Match = rec_Match;
propertyChangeSupport.firePropertyChange("rec_Match", oldRec_Match, rec_Match);
public JTextField getTxt_rec_process() {
return txt_rec_process;
public void setTxt_rec_process(JTextField txt_rec_process) {
JTextField oldTxt_rec_process=this.txt_rec_process;
this.txt_rec_process = txt_rec_process;
propertyChangeSupport.firePropertyChange("txt_rec_process", oldTxt_rec_process, txt_rec_process);
} -
JAXB, Compiling a schema problem
Hi,
I�m trying to test the examples from the JWSDP tutorial (section "Using JAXB") and I get the following error when executing:
C:\tutoriales\jwstutorial13\examples\jaxb\unmarshal-read>%JWSDP_HOME%\jaxb\bin\xjc.bat po.xsd -p primer.po
parsing a schema...
compiling a schema...
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.commons.launcher.ChildMain.run(ChildMain.java:269)
Caused by: java.lang.NullPointerException
at com.sun.tools.xjc.generator.SkeletonGenerator.generateStaticRuntime(SkeletonGenerator.java:233)
at com.sun.tools.xjc.generator.SkeletonGenerator.<init>(SkeletonGenerator.java:128)
at com.sun.tools.xjc.generator.SkeletonGenerator.generate(SkeletonGenerator.java:108)
at com.sun.tools.xjc.Driver.generateCode(Driver.java:366)
at com.sun.tools.xjc.Driver.run(Driver.java:215)
at com.sun.tools.xjc.Driver._main(Driver.java:80)
at com.sun.tools.xjc.Driver.access$000(Driver.java:46)
at com.sun.tools.xjc.Driver$1.run(Driver.java:60)
I suppose could be configuration issues or path issues but I can�t get over it.
Thankshttp://forum.java.sun.com/thread.jsp?forum=34&thread=484038&tstart=0&trange=15
-
Richfaces 4 and weblogic 10.0: error deploying
When i tried to deploy an example application,
I have this error:
Unable to set the activation state to true for the application 'TestJSF'.
weblogic.application.ModuleException:
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:975)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:361)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:182)
at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:359)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:196)
at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
javax.xml.bind.JAXBException: ClassCastException: attempting to cast jar:file:/C:/XXXXXXX/BEA_weblogic/modules/javax.xml.bind_2.0.jar!/javax/xml/bind/JAXBContext.class to zip:C:/XXXXXXX/BEA_weblogic/user_projects/domains/mare_domain/servers/AdminServer/tmp/_WL_user/TestJSF/96q78q/war/WEB-INF/lib/jaxb-api.jar!/javax/xml/bind/JAXBContext.class. Please make sure that you are specifying the proper ClassLoader.
at javax.xml.bind.ContextFinder.handleClassCastException(ContextFinder.java:96)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:214)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:372)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
at javax.xml.bind.JAXB$Cache.<init>(JAXB.java:87)
at javax.xml.bind.JAXB.getContext(JAXB.java:114)
at javax.xml.bind.JAXB.unmarshal(JAXB.java:143)
at org.richfaces.javascript.ClientServiceConfigParser.parse(ClientServiceConfigParser.java:60)
at org.richfaces.javascript.ClientServiceConfigParser.parseConfig(ClientServiceConfigParser.java:49)
at org.richfaces.application.ValidatorModule.createClientScriptService(ValidatorModule.java:68)
at org.richfaces.application.ValidatorModule.configure(ValidatorModule.java:62)
at org.richfaces.application.ServicesFactoryImpl.init(ServicesFactoryImpl.java:28)
at org.richfaces.application.InitializationListener.createFactory(InitializationListener.java:136)
at org.richfaces.application.InitializationListener.onStart(InitializationListener.java:110)
at org.richfaces.application.InitializationListener.processEvent(InitializationListener.java:152)
at javax.faces.event.SystemEvent.processListener(SystemEvent.java:106)
at com.sun.faces.application.ApplicationImpl.processListeners(ApplicationImpl.java:2129)
at com.sun.faces.application.ApplicationImpl.invokeListenersFor(ApplicationImpl.java:2105)
at com.sun.faces.application.ApplicationImpl.publishEvent(ApplicationImpl.java:300)
at com.sun.faces.config.ConfigManager.publishPostConfigEvent(ConfigManager.java:603)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:369)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:225)
at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:458)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.EventsManager.notifyContextCreatedEvent(EventsManager.java:168)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1744)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2909)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:973)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:361)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:182)
at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:359)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:51)
at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:196)
at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:30)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionApps(ConfiguredDeployments.java:233)
at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:169)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:123)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:173)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:89)
at weblogic.t3.srvr.SubsystemRequest.run(SubsystemRequest.java:64)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
Note that i have create and example application:
TestJSF:
lib
common-annotations.jar
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-logging.jar
guava-r08.jar
jaxb-api.jar
jhighlight-1.0.jar
jsf-api.jar
jsf-impl.jar
jstl.jar
richfaces-components-api-4.0.0.Final.jar
richfaces-components-ui-4.0.0.Final.jar
richfaces-core-api-4.0.0.Final.jar
richfaces-core-impl-4.0.0.Final.jar
standard.jar
NOTE: before adding richfaces4 jars, i had jsf-api and jsf-impl of jsf 2 anche into weblogic.xml i specify to prefere application lib so,
I tested a greeting application so it work fine !!
The step after, i added richeface4 jars, and the application server gave me that error.
Please !!
hellp me!!
aHello,
I have not seen this particular error before, but if you can re-build the EJB using Workshop 10.0 I bet it will fix your problem. The old Workshop is running an old version of appc which the 10.0 version of WLS is probably not expecting.
Kevin -
Failed to Connect to CCMCIP authentication server error
Hi All,
I am getting a strange error with a CM8 Cisco Unified client services framework client.
He is getting failed to connect to CCMIP authentication server.
The user is assoicated with a phone line.
He is in the CCM end users and standard CTI enabled group.
The phone is setup to be controlled via CTI.
I had one of the IT support guys use this users login to try and login using a different PC with the similar results.
This makes me wonder if the problem is with the users' profile on the Presence server somehow.
I will attach the problem report along with one of the error messages.
I have noted the problem with the voicemail server and will get the password fixed up soon.
Any help or ideas would be so appreciated.
Regards
AmandaHi All,
I am continuing to work on the problem.
I found something interesting in the core log file.
I will attach the new debug report.
If anyone has any ideas for how to fix this please let me know.
thanks
Amanda Lalli-Cafini
CredentialsType: PHONE_SERVICE, UserName:
Michael.O'[email protected]
, Remember: false
2012-03-01 13:43:22,595 DEBUG [ws-pool-thread-2] [CCMCIPProvider] [CCMCIPProviderImpl.fetchDeviceList(90)] - Attempting to connect to primary CCMCIP host: 10.2.2.11
2012-03-01 13:43:22,595 WARN [ws-pool-thread-2] [CCMCIPProvider] [CCMCIPClient.fetchDevices(241)] - Unknown certification level, setting it to SELF_SIGNED_CERTS. Unknown level value: null
2012-03-01 13:43:22,595 INFO [ws-pool-thread-2] [CCMCIPProvider] [CCMCIPClient.fetchDevices(244)] - Setting certification level to '1' (SELF_SIGNED_CERTS)
2012-03-01 13:43:22,972 ERROR [ws-pool-thread-2] [CCMCIPProvider] [CCMCIPClient.populate(323)] - JAXB unmarshal error! unexpected element (uri:"", local:"html"). Expected elements are <{}devices>
2012-03-01 13:43:22,973 ERROR [ws-pool-thread-2] [CCMCIPProvider] [CCMCIPProviderImpl.fetchDeviceList(112)] - No backup configured, giving up
2012-03-01 13:43:22,973 WARN [ws-pool-thread-2] [DeviceService] [DeviceServiceCoreImpl.populateCCMCIP(1563)] - Couldn't connect to any CCMCIP host. Sending async error.
2012-03-01 13:43:22,974 DEBUG [ws-pool-thread-2] [EventAdapter] [EventAdapterImpl.publish(140)] - publish method = onError class = com.cisco.uc.core.broker.phone.device.DeviceServiceCallback
2012-03-01 13:43:22,974 DEBUG [ws-pool-thread-2] [EventAdapter] [BaseClientProxy.publish(109)] - Adding callback to queue : onError priority message true
2012-03-01 13:43:22,974 WARN [ws-pool-thread-2] [DeviceService] [DeviceServiceCoreImpl.populateCCMCIP(1581)] - CCMCIP host is unreachable. Trying to use the last used softphone device.
2012-03-01 13:43:22,974 ERROR [ws-pool-thread-2] [DeviceService] [DeviceServiceCoreImpl.isSRSTConfigured(1672)] - Couldn't connect to any CCMCIP host and no softphone device is available.
2012-03-01 13:43:22,975 ERROR [ws-pool-thread-2] [DeviceService] [DeviceServiceCoreImpl.populateCCMCIP(1599)] - Couldn't connect to any CCMCIP host and no softphone device is available.
2012-03-01 13:43:22,975 ERROR [ws-pool-thread-2] [DeviceAdapter] [DeviceServiceImpl.initialize(435)] - Problem initializing on the Device service. Could not connect to CCMCIP
com.cisco.uc.core.common.exceptions.device.CCMCIPFailureCoreException: Could not connect to CCMCIP
CredentialsType: PHONE_SERVICE, UserName: Michael.O'[email protected]
, Remember: false
2012-03-01 13:43:22,595 DEBUG [ws-pool-thread-2] [CCMCIPProvider] [CCMCIPProviderImpl.fetchDeviceList(90)] - Attempting to connect to primary CCMCIP host: 10.2.2.11
2012-03-01 13:43:22,595 WARN [ws-pool-thread-2] [CCMCIPProvider] [CCMCIPClient.fetchDevices(241)] - Unknown certification level, setting it to SELF_SIGNED_CERTS. Unknown level value: null
2012-03-01 13:43:22,595 INFO [ws-pool-thread-2] [CCMCIPProvider] [CCMCIPClient.fetchDevices(244)] - Setting certification level to '1' (SELF_SIGNED_CERTS)
2012-03-01 13:43:22,972 ERROR [ws-pool-thread-2] [CCMCIPProvider] [CCMCIPClient.populate(323)] - JAXB unmarshal error! unexpected element (uri:"", local:"html"). Expected elements are <{}devices>
2012-03-01 13:43:22,973 ERROR [ws-pool-thread-2] [CCMCIPProvider] [CCMCIPProviderImpl.fetchDeviceList(112)] - No backup configured, giving up
2012-03-01 13:43:22,973 WARN [ws-pool-thread-2] [DeviceService] [DeviceServiceCoreImpl.populateCCMCIP(1563)] - Couldn't connect to any CCMCIP host. Sending async error.
2012-03-01 13:43:22,974 DEBUG [ws-pool-thread-2] [EventAdapter] [EventAdapterImpl.publish(140)] - publish method = onError class = com.cisco.uc.core.broker.phone.device.DeviceServiceCallback
2012-03-01 13:43:22,974 DEBUG [ws-pool-thread-2] [EventAdapter] [BaseClientProxy.publish(109)] - Adding callback to queue : onError priority message true
2012-03-01 13:43:22,974 WARN [ws-pool-thread-2] [DeviceService] [DeviceServiceCoreImpl.populateCCMCIP(1581)] - CCMCIP host is unreachable. Trying to use the last used softphone device.
2012-03-01 13:43:22,974 ERROR [ws-pool-thread-2] [DeviceService] [DeviceServiceCoreImpl.isSRSTConfigured(1672)] - Couldn't connect to any CCMCIP host and no softphone device is available.
2012-03-01 13:43:22,975 ERROR [ws-pool-thread-2] [DeviceService] [DeviceServiceCoreImpl.populateCCMCIP(1599)] - Couldn't connect to any CCMCIP host and no softphone device is available.
2012-03-01 13:43:22,975 ERROR [ws-pool-thread-2] [DeviceAdapter] [DeviceServiceImpl.initialize(435)] - Problem initializing on the Device service. Could not connect to CCMCIP
com.cisco.uc.core.common.exceptions.device.CCMCIPFailureCoreException: Could not connect to CCMCIP -
JAXB marshaling and unmarshaling
I used JAXB to generate nine classes (one is simply a type-safe enum) to correspond to my XML DTD. I then wrote the code to instantiate the root and some child elements which are all added to the root content. Then I am able to call validate() and marshal() on the root element and produce the desired XML. Great!
The trouble is that I'm having difficulty using these classes to unmarshal the XML that they validated and wrote. Has anyone else seen this? In some cases, the call to unmarshal() returns the root element with no content (e.g., "<myRoot/>"). In other cases, I get an InvalidContentException on a nested element that repeats (e.g., "Expected an end tag for a "fooList" element, but found a start tag for a "foo" element").
Has anyone else seen this? I've been through the bug parade and didn't catch this mentioned there.
Thanks!
MarkHere's the code for the problem I'm running into. Is anyone able to reproduce the problem and diagnose it? I must be doing something wrong because the Checkbook example works just fine for me. Please help!
The obvious trouble here is that Test4.java does not correctly unmarshal the XML that it writes to temp.xml. Where have I gone wrong?
Thanks,
Mark
-------- begin cut (xyz.dtd) --------
<!ELEMENT Id ( #PCDATA ) >
<!ELEMENT Name ( #PCDATA ) >
<!ELEMENT Amt ( #PCDATA ) >
<!ELEMENT Transaction ( Id, Name, Amt ) >
<!ELEMENT Transactions ( Transaction+ ) >
<!ATTLIST Transactions count NMTOKEN #IMPLIED >
--------- end cut (xyz.dtd) ---------
-------- begin cut (xyz.xjs) --------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xml-java-binding-schema version="1.0-ea">
<options package="xyz"/>
<element name="Transactions" type="class" root="true">
<attribute name="count" convert="int"/>
<content>
<element-ref name="Transaction"/>
</content>
</element>
<element name="Name" type="value"/>
<element name="Amt" type="value" convert="int"/>
<element name="Id" type="value" convert="int"/>
<element name="Transaction" type="class">
<content>
<element-ref name="Id"/>
<element-ref name="Name"/>
<element-ref name="Amt"/>
</content>
</element>
</xml-java-binding-schema>
--------- end cut (xyz.xjs) ---------
-------- begin cut (Test4.java) --------
import xyz.*;
import javax.xml.bind.*;
import javax.xml.marshal.*;
import java.io.*;
import java.util.Date;
import java.util.Random;
public class Test4 {
private static Random rand = new Random();
public static void main(String[] args) {
// need file to work with...
try {
File f = new File( "temp.xml" );
FileOutputStream fout =
new FileOutputStream( f );
// make some transactions
int TransCt = 1;
Transactions txns = new Transactions();
java.util.List transactions = txns.getTransaction();
for (int i=0; i < TransCt; i++) {
Transaction t = makeBogus();
transactions.add( t );
txns.setCount( TransCt );
txns.validate();
txns.marshal( fout );
fout.flush();
fout.close();
FileInputStream fin = new FileInputStream( f );
Transactions t = new Transactions();
t.unmarshal( fin );
t.validate();
t.marshal( System.out );
catch (Exception e) {
e.printStackTrace();
private static Transaction makeBogus() {
String[] names =
{ "Bob", "Larry", "Tom", "Ted", "Bill",
"Gail", "Louise", "Sam", "Erin", "Wilma" };
Transaction transaction = new Transaction();
// calculate transaction id...
int range = Integer.MAX_VALUE / 3 * 2;
int Id = rand.nextInt(range);
transaction.setId( Id );
// pick a name
transaction.setName( names[rand.nextInt(10)] );
transaction.setAmt( rand.nextInt( 100 ) );
return transaction;
--------- end cut (Test4.java) ---------
Maybe you are looking for
-
I am new to Java programming and I wrote my first program to say "Hello World!" ...what a surprise... anyway, when I try to compile it, my command promt does not recognize the 'javac' command. I bought a book on Java that came with the J2SE Developme
-
How to set a page item to either of two sources?
Hello Folks, I would like some advice with the following: On P1 there is a text field, say p1_text. The users enters a value into p1_text. This is validated. If the p1_text value validates OK, and the next button is pressed, there is a branch to page
-
Error upgrading repository to 11gR2
Have a 10.2.0.4 repository and trying to upgrade to 11gR2. Ran the cat_owb.sql script, and unlocked the OWBSYS and OWBSYS_AUDIT acounts Ran the reset_owbcc_home.sql script Started the repository admin tool, selected "Upgrade Repository...", then "Exp
-
ODI - IKM Oracle Multi Table Insert
Hi All, I am new to ODI, i tried to use "IKM Oracle Multi Table Insert", one interface generates query like insert all when 1=1 then into BI.EMP_TOTAL_SAL *(EMPNO, ENAME, JOB, MGR, HIREDATE, TOTAL_SAL, DEPTNO)* values *(C1_EMPNO, C2_ENAME, C3_JOB,
-
Comparison between PeopleSoft and Fusion
Hi , I need to prepare a document to show up the comparison between PeopleSoft and Fusion. For eg: Business Unit in PeopleSoft and what is the concept in Fusion that is similar to Business Unit. Can anyone help me with a document that will give m