Having problems mapping Java to ActionScript objects

I am building a service that returns  a custom object tree to AS3 client over RPC call. Consider a couple of java classes, the TestObject  contains a list of TestInnerObject classes:
public class TestObject
    public int id = 123;
    public String title = "Test object title";
    public List <String> stringList = new ArrayList<String>();
    public List <TestInnerObject> objectList = new ArrayList<TestInnerObject>();
    public TestObject()
        stringList.add("First string in the list");
        stringList.add("Second string in the list");
        objectList.add(new TestInnerObject(456));
        objectList.add(new TestInnerObject(789));
public class TestInnerObject
    public int id = 0;
    public String title = "Test inner object title";
    public List <String> stringList = new ArrayList<String>();
    public TestInnerObject(int id)
        this.id = id;
To work with them on the client a have a couple of the counterpart AS3 classes:
[Bindable]
[RemoteClass(alias="test.TestObject")]
public class TestObject
     public var id:int;
     public var title:String;
     public var stringList:ArrayCollection;
     public var objectList:ArrayCollection;
     public function TestObject()
[Bindable]
[RemoteClass(alias="test.TestInnerObject")]
public class TestInnerObject
     public var id:int;
     public var title:String;
     public var stringList:ArrayCollection;
     public function TestInnerObject()
My understanding is that such a setup should return result deserialized into objects of TestObject.as and TestInnerObject.as types but I am getting plain AS3 objects that have all the fields but I can not cast them to the required types. This is hardly the optimal way to work with response.
Could somone clarify what should be fixed?
Thanks

Adrian,
Thanks for the feedback. I added Serializable interface to java classes and confirmed that the package is correct. I am still having the same problem though. Here is the result handler code. May be I am doing something wrong here? When I access result objects as Objects I can get the fields and transfer them to the proper classes (commented lines) but it's hardly efficient. As soon as I try to cast the result I am getting an error.
private function onResult(result:AcknowledgeMessage):void
           //result.body contains the actual data
            trace("RPC Ok");
            trace(result.body);
            trace(result.body.id);
            trace(result.body.title);
            trace("");
            var testObject:TestObject = result.body as TestObject;
            //var testObject:TestObject = new TestObject();
            //testObject.id = result.body.id;
            //testObject.title = result.body.title;
            //testObject.stringList = result.body.stringList;
            //testObject.objectList = result.body.objectList;
            trace(testObject);
            trace("TestObject id: " + testObject.id);
            trace("TestObject title: " + testObject.title);
            trace("TestObject stringList: " + testObject.stringList);
            for each (var inner:TestInnerObject in testObject.objectList)
                trace("Inner id: " + inner.id + " Inner tittle: " + inner.title);

Similar Messages

  • Our school is having problems with Java.

    Our school is having problems with Java.  We cannot open our gradebooks which require jnlp or java to open.  They worked until January 31 and then quit.  I uploaded the Java from oracle but it doesn't open anything it just keeps running.  Any ideas?

    See  Java for OS X 2012-006: How to re-enable the Apple-provided Java SE 6 applet plug-in and Web Start functionality. That might be what you need, not Java 7.

  • I am still having problems accessing java script sites.  Anyone else having this problem?

    I am still having problems accessing java script sites.  Anyone else having this problem?

    Javascript can be left on, but Java (which is something very different) should generally be turned off.
    Apple barred Java from running on Macs, leaving companies that rely on Java plug-ins out in the cold.
    Apple blocked Java 7 Update 11 by adding it to the banned list in XProtect.
    This was the second time in two weeks that Apple has blocked Oracle's code from running on Macs. This time Java is blocked through Apple's XProtect anti-malware feature.
    Java has come under fire as the means by which hackers have been able to gain control of computers. In April 2012 more than 600,000 Macs were reported to have been infected with a Flashback Trojan horse that was being installed on people's computers with the help of Java exploits. Then in August Macs were again at risk due to a flaw in Java, this time around, there was good news for Mac users: Thanks to changes Apple has made, most of us were safe from the threat.
    Unwilling to leave its customers open to potential threats Apple decided it's safer to block Java entirely.
    Macs running OS X Snow Leopard and beyond are affected.
    UPDATE for those running Lion or Mountain Lion:
    Oracle on Friday February 1 released a new version reportedly addressing vulnerabilities seen with the last build.
    Apple disabled Java 7 through the OS X XProtect anti-malware system, requiring users to have at least version "1.7.0_10-b19" installed on their Macs. The release dated February 1 carries the designation "1.7.0_13-b20," meeting Apple's requirements.
    Oracle "strongly recommends" applying the CPU fixes as soon as possible, saying that the latest Critical Patch Update contains 50 new security fixes across all Jave SE products.
    Update foror Snow Leopard users:
    Apple have issued update 12 for Java for OS 10.6:
    http://support.apple.com/kb/DL1573
    Note:  On systems that have not already installed Java for Mac OS X 10.6 update 9 or later, this update will configure web browsers to not automatically run Java applets. Java applets may be re-enabled by clicking the region labeled "Inactive plug-in" on a web page. If no applets have been run for an extended period of time, the Java web plug-in will deactivate.

  • Having problems with java and website

    Can anyone help with a problem I am having using a Java Chat application on a website?
    I have tried to use Java Chat and the applet, when clicking the "private message" link, takes a long time to open up, and locks up my computer when it is doing so.
    I did download the latest version of Java to my computer and this problem exists using both the Netscape and Internet Explorer latest browsers.
    I am using Windows XP on a Dell Computer with a DSL connection.
    The website is http://www.gay.com/chat
    I did get an error message one time that saved a file to my desktop.
    Can anyone advise me what is going on?
    Any help would be greatly appreciated.
    I have contacted technical support at http://www.gay.com to no avail.
    Please write me back directly to [email protected]
    Here is the code which I am not sure has anything to do with the problem or not:
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x6D07014F
    Function=Java_sun_awt_windows_WColor_getDefaultColor+0x28D4
    Library=C:\Program Files\Java\j2re1.4.1_02\bin\awt.dll
    Current Java thread:
         at sun.awt.windows.WToolkit.eventLoop(Native Method)
         at sun.awt.windows.WToolkit.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Dynamic libraries:
    0x00400000 - 0x00419000      C:\Program Files\Internet Explorer\IEXPLORE.EXE
    0x77F50000 - 0x77FF7000      C:\WINDOWS\System32\ntdll.dll
    0x77E60000 - 0x77F46000      C:\WINDOWS\system32\kernel32.dll
    0x77C10000 - 0x77C63000      C:\WINDOWS\system32\msvcrt.dll
    0x77D40000 - 0x77DC6000      C:\WINDOWS\system32\USER32.dll
    0x77C70000 - 0x77CB0000      C:\WINDOWS\system32\GDI32.dll
    0x77DD0000 - 0x77E5D000      C:\WINDOWS\system32\ADVAPI32.dll
    0x78000000 - 0x7807F000      C:\WINDOWS\system32\RPCRT4.dll
    0x70A70000 - 0x70AD4000      C:\WINDOWS\system32\SHLWAPI.dll
    0x71700000 - 0x71849000      C:\WINDOWS\System32\SHDOCVW.dll
    0x71950000 - 0x71A34000      C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.10.0_x-ww_f7fb5805\comctl32.dll
    0x773D0000 - 0x77BC2000      C:\WINDOWS\system32\SHELL32.dll
    0x77340000 - 0x773CB000      C:\WINDOWS\system32\comctl32.dll
    0x771B0000 - 0x772D1000      C:\WINDOWS\system32\ole32.dll
    0x5AD70000 - 0x5ADA4000      C:\WINDOWS\System32\uxtheme.dll
    0x75F80000 - 0x7607C000      C:\WINDOWS\System32\BROWSEUI.dll
    0x72430000 - 0x72442000      C:\WINDOWS\System32\browselc.dll
    0x75F40000 - 0x75F5F000      C:\WINDOWS\system32\appHelp.dll
    0x76FD0000 - 0x77048000      C:\WINDOWS\System32\CLBCATQ.DLL
    0x77120000 - 0x771AB000      C:\WINDOWS\system32\OLEAUT32.dll
    0x77050000 - 0x77115000      C:\WINDOWS\System32\COMRes.dll
    0x77C00000 - 0x77C07000      C:\WINDOWS\system32\VERSION.dll
    0x76200000 - 0x76298000      C:\WINDOWS\system32\WININET.dll
    0x762C0000 - 0x76348000      C:\WINDOWS\system32\CRYPT32.dll
    0x762A0000 - 0x762AF000      C:\WINDOWS\system32\MSASN1.dll
    0x76F90000 - 0x76FA0000      C:\WINDOWS\System32\Secur32.dll
    0x76620000 - 0x7666E000      C:\WINDOWS\System32\cscui.dll
    0x76600000 - 0x7661B000      C:\WINDOWS\System32\CSCDLL.dll
    0x76670000 - 0x76757000      C:\WINDOWS\System32\SETUPAPI.dll
    0x10000000 - 0x1001C000      C:\Program Files\Norton SystemWorks\Norton AntiVirus\NavShExt.dll
    0x01470000 - 0x0148A000      C:\WINDOWS\System32\ccTrust.dll
    0x55900000 - 0x55961000      C:\WINDOWS\System32\MSVCP60.dll
    0x76B20000 - 0x76B35000      C:\WINDOWS\System32\ATL.DLL
    0x014D0000 - 0x016D1000      C:\WINDOWS\System32\msi.dll
    0x016E0000 - 0x01704000      C:\Program Files\Microsoft Money\System\mnyviewer.dll
    0x763B0000 - 0x763F5000      C:\WINDOWS\system32\comdlg32.dll
    0x1A400000 - 0x1A47A000      C:\WINDOWS\system32\urlmon.dll
    0x76170000 - 0x761F8000      C:\WINDOWS\System32\shdoclc.dll
    0x74770000 - 0x747FF000      C:\WINDOWS\System32\mlang.dll
    0x71AD0000 - 0x71AD8000      C:\WINDOWS\System32\wsock32.dll
    0x71AB0000 - 0x71AC5000      C:\WINDOWS\System32\WS2_32.dll
    0x71AA0000 - 0x71AA8000      C:\WINDOWS\System32\WS2HELP.dll
    0x71A50000 - 0x71A8B000      C:\WINDOWS\system32\mswsock.dll
    0x71A90000 - 0x71A98000      C:\WINDOWS\System32\wshtcpip.dll
    0x76EE0000 - 0x76F17000      C:\WINDOWS\System32\RASAPI32.DLL
    0x76E90000 - 0x76EA1000      C:\WINDOWS\System32\rasman.dll
    0x71C20000 - 0x71C6E000      C:\WINDOWS\System32\NETAPI32.dll
    0x76EB0000 - 0x76EDB000      C:\WINDOWS\System32\TAPI32.dll
    0x76E80000 - 0x76E8D000      C:\WINDOWS\System32\rtutils.dll
    0x76B40000 - 0x76B6C000      C:\WINDOWS\System32\WINMM.dll
    0x5CD70000 - 0x5CD77000      C:\WINDOWS\System32\serwvdrv.dll
    0x5B0A0000 - 0x5B0A7000      C:\WINDOWS\System32\umdmxfrm.dll
    0x75E90000 - 0x75F37000      C:\WINDOWS\System32\SXS.DLL
    0x76F20000 - 0x76F45000      C:\WINDOWS\System32\DNSAPI.dll
    0x76D60000 - 0x76D77000      C:\WINDOWS\System32\iphlpapi.dll
    0x76FB0000 - 0x76FB7000      C:\WINDOWS\System32\winrnr.dll
    0x76F60000 - 0x76F8C000      C:\WINDOWS\system32\WLDAP32.dll
    0x722B0000 - 0x722B5000      C:\WINDOWS\System32\sensapi.dll
    0x75A70000 - 0x75B15000      C:\WINDOWS\system32\USERENV.dll
    0x0FFD0000 - 0x0FFF3000      C:\WINDOWS\System32\rsaenh.dll
    0x76FC0000 - 0x76FC5000      C:\WINDOWS\System32\rasadhlp.dll
    0x63580000 - 0x6382C000      C:\WINDOWS\System32\mshtml.dll
    0x746F0000 - 0x74716000      C:\WINDOWS\System32\msimtf.dll
    0x74720000 - 0x74764000      C:\WINDOWS\System32\MSCTF.dll
    0x76390000 - 0x763AC000      C:\WINDOWS\System32\IMM32.DLL
    0x32520000 - 0x32532000      C:\Program Files\Microsoft Office\Office10\msohev.dll
    0x02430000 - 0x0244B000      C:\Program Files\Common Files\Symantec Shared\Script Blocking\scrauth.dll
    0x02560000 - 0x0257E000      C:\Program Files\Common Files\Symantec Shared\Script Blocking\ScrBlock.dll
    0x76C30000 - 0x76C5B000      C:\WINDOWS\System32\wintrust.dll
    0x76C90000 - 0x76CB2000      C:\WINDOWS\system32\IMAGEHLP.dll
    0x73D50000 - 0x73D60000      C:\WINDOWS\System32\cryptnet.dll
    0x6B700000 - 0x6B790000      c:\windows\system32\jscript.dll
    0x746C0000 - 0x746E7000      C:\WINDOWS\System32\MSLS31.DLL
    0x73300000 - 0x73375000      c:\windows\system32\vbscript.dll
    0x03380000 - 0x03509000      C:\WINDOWS\System32\macromed\flash\Flash.ocx
    0x72D20000 - 0x72D29000      C:\WINDOWS\System32\wdmaud.drv
    0x72D10000 - 0x72D18000      C:\WINDOWS\System32\msacm32.drv
    0x77BE0000 - 0x77BF4000      C:\WINDOWS\System32\MSACM32.dll
    0x77BD0000 - 0x77BD7000      C:\WINDOWS\System32\midimap.dll
    0x65000000 - 0x65009000      C:\WINDOWS\System32\ddrawex.dll
    0x51000000 - 0x51047000      C:\WINDOWS\System32\DDRAW.dll
    0x73BC0000 - 0x73BC6000      C:\WINDOWS\System32\DCIMAN32.dll
    0x6BDD0000 - 0x6BE03000      C:\WINDOWS\System32\dxtrans.dll
    0x6BE10000 - 0x6BE65000      C:\WINDOWS\System32\dxtmsft.dll
    0x74CB0000 - 0x74D1F000      C:\WINDOWS\System32\mshtmled.dll
    0x05230000 - 0x05237000      C:\Program Files\Microsoft Money\System\urlmapps.dll
    0x71B20000 - 0x71B31000      C:\WINDOWS\system32\MPR.dll
    0x75F60000 - 0x75F66000      C:\WINDOWS\System32\drprov.dll
    0x71C10000 - 0x71C1D000      C:\WINDOWS\System32\ntlanman.dll
    0x71CD0000 - 0x71CE6000      C:\WINDOWS\System32\NETUI0.dll
    0x71C90000 - 0x71CCC000      C:\WINDOWS\System32\NETUI1.dll
    0x71C80000 - 0x71C86000      C:\WINDOWS\System32\NETRAP.dll
    0x71BF0000 - 0x71C01000      C:\WINDOWS\System32\SAMLIB.dll
    0x75F70000 - 0x75F79000      C:\WINDOWS\System32\davclnt.dll
    0x75970000 - 0x75A61000      C:\WINDOWS\System32\MSGINA.dll
    0x76360000 - 0x7636F000      C:\WINDOWS\System32\WINSTA.dll
    0x1F7B0000 - 0x1F7E1000      C:\WINDOWS\System32\ODBC32.dll
    0x1F850000 - 0x1F866000      C:\WINDOWS\System32\odbcint.dll
    0x767F0000 - 0x76814000      C:\WINDOWS\System32\schannel.dll
    0x0FFA0000 - 0x0FFC1000      C:\WINDOWS\System32\dssenh.dll
    0x66E50000 - 0x66E8B000      C:\WINDOWS\System32\iepeers.dll
    0x73000000 - 0x73023000      C:\WINDOWS\System32\WINSPOOL.DRV
    0x71D40000 - 0x71D5B000      C:\WINDOWS\System32\actxprxy.dll
    0x6CC60000 - 0x6CC6B000      C:\WINDOWS\System32\dispex.dll
    0x6D820000 - 0x6D82F000      C:\Program Files\Java\j2re1.4.1_02\bin\npjpi141_02.dll
    0x6D780000 - 0x6D796000      C:\Program Files\Java\j2re1.4.1_02\bin\jpiexp32.dll
    0x6D7C0000 - 0x6D7D4000      C:\Program Files\Java\j2re1.4.1_02\bin\jpishare.dll
    0x6D340000 - 0x6D46A000      C:\PROGRA~1\Java\J2RE14~1.1_0\bin\client\jvm.dll
    0x6D1E0000 - 0x6D1E7000      C:\PROGRA~1\Java\J2RE14~1.1_0\bin\hpi.dll
    0x6D310000 - 0x6D31E000      C:\PROGRA~1\Java\J2RE14~1.1_0\bin\verify.dll
    0x6D220000 - 0x6D239000      C:\PROGRA~1\Java\J2RE14~1.1_0\bin\java.dll
    0x6D330000 - 0x6D33D000      C:\PROGRA~1\Java\J2RE14~1.1_0\bin\zip.dll
    0x6D000000 - 0x6D105000      C:\Program Files\Java\j2re1.4.1_02\bin\awt.dll
    0x6D190000 - 0x6D1E0000      C:\Program Files\Java\j2re1.4.1_02\bin\fontmanager.dll
    0x5C000000 - 0x5C0C8000      C:\WINDOWS\System32\D3DIM700.DLL
    0x6D720000 - 0x6D731000      C:\Program Files\Java\j2re1.4.1_02\bin\jpicom32.dll
    0x6D2E0000 - 0x6D2EE000      C:\Program Files\Java\j2re1.4.1_02\bin\net.dll
    0x6D140000 - 0x6D162000      C:\Program Files\Java\j2re1.4.1_02\bin\dcpr.dll
    0x67F00000 - 0x67F07000      C:\Program Files\America Online 8.0\idleproc.dll
    0x05420000 - 0x05427000      C:\Program Files\Yahoo!\Messenger\idle.dll
    0x1FCF0000 - 0x1FFBE000      C:\WINDOWS\System32\wmploc.dll
    0x732E0000 - 0x732E5000      C:\WINDOWS\System32\RICHED32.DLL
    0x74E30000 - 0x74E9A000      C:\WINDOWS\System32\RICHED20.dll
    0x6D2B0000 - 0x6D2D1000      C:\Program Files\Java\j2re1.4.1_02\bin\jsound.dll
    0x6D290000 - 0x6D2AE000      C:\Program Files\Java\j2re1.4.1_02\bin\jpeg.dll
    0x6D510000 - 0x6D58D000      C:\WINDOWS\system32\DBGHELP.dll
    0x76BF0000 - 0x76BFB000      C:\WINDOWS\System32\PSAPI.DLL
    Local Time = Sun Apr 20 21:23:14 2003
    Elapsed Time = 30584
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.1_02-b06 mixed mode)

    Having closely scrutinised your code for many hours, I am at a loss with this one. The one thing that is suspicious is the exclamation mark after Yahoo in the 8th line from the bottom.
    Get rid of it and give it a try.

  • Problems with Java and Business Objects

    <p>Hello everybody,<br /><br />I&#39;m new in BusinessObjects/Crystal Report. Now, I have some problems with Business Objects for Java (Business Objects XI Release 2 Developer).</p><p> </p><p>1)  I create a report in the report designer. This report has a parameterfield. Before I run this report within a jsp web application I want fill the parameterfield with some values from the database. I found the following code snippet for this problem in your forum. But it don&#39;t works right, because it occurs a simple input field instead of a combo box with my database values. Where is my mistake? I need the combo box! (In debug mode I saw that the parameterfield was filled with my data!)</p><p><%@page import="com.crystaldecisions.report.web.viewer.CrystalReportViewer,com.crystaldecisions.sdk.occa.report.application.ReportClientDocument,<br />com.crystaldecisions.sdk.occa.report.application.OpenReportOptions,<br />com.crystaldecisions.sdk.occa.report.lib.ReportSDKExceptionBase,<br />java.io.IOException,<br />java.sql.Connection,<br />java.sql.DriverManager,<br />java.sql.ResultSet,<br />java.sql.SQLException,<br />java.sql.Statement,<br />java.util.Locale,<br />com.crystaldecisions.sdk.occa.report.application.DataDefController,<br />com.crystaldecisions.sdk.occa.report.data.FieldDisplayNameType,<br />com.crystaldecisions.sdk.occa.report.data.ParameterField,<br />com.crystaldecisions.sdk.occa.report.data.ParameterFieldDiscreteValue,<br />com.crystaldecisions.sdk.occa.report.data.Values,<br />com.crystaldecisions.sdk.occa.report.reportsource.IReportSource"%><%<br /><br />    try {<br /><br />        String reportName = "avoParameterfeld.rpt";<br />        ReportClientDocument clientDoc = (ReportClientDocument) session.getAttribute(reportName);<br /><br />        if (clientDoc == null) {<br />            // Report can be opened from the relative location specified in the CRConfig.xml, or the report location<br />            // tag can be removed to open the reports as Java resources or using an absolute path<br />            // (absolute path not recommended for Web applications).<br /><br />            clientDoc = new ReportClientDocument();<br />            clientDoc.setReportAppServer("inproc:jrc");<br />            // Open report<br />            clientDoc.open(reportName, OpenReportOptions._openAsReadOnly);<br /><br />             // Connection Info for fetching the resultSet<br />            String connectStr = "jdbc:oracle:thin:@it1srv19:1521:itoracle";<br />            String driverName = "oracle.jdbc.driver.OracleDriver";<br />            String userName = "user";        <br />            String password = "password";    <br /><br />            // TODO: Ensure this query is valid in your database. An exception will be thrown otherwise.<br />            String query = "SELECT DISTINCT AVONR FROM MBDEADM.AVO ORDER BY AVONR";<br />            ResultSet paramData = null;<br />           <br />            //we will now pass the resultset to the parameter to use as Default Values<br />            String parameterName = "AVONR2";<br />            int colIndex = 1; //this is the column in the ResultSet to use as the values<br />           <br />//            Load JDBC driver for the database that will be queried   <br />            Class.forName(driverName);<br /><br />            Connection connection = DriverManager.getConnection(connectStr, userName, password);<br />            Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE , ResultSet.CONCUR_READ_ONLY);<br />           <br />            paramData = statement.executeQuery(query);<br />           <br />            DataDefController dataDefController = clientDoc.getDataDefController();<br />           <br />            ParameterField origParamField = (ParameterField)dataDefController.getDataDefinition().getParameterFields().findField(parameterName, FieldDisplayNameType.fieldName, Locale.getDefault());<br />            ParameterField newParamField = (ParameterField)origParamField.clone(true);<br />           <br />            Values newVals = (Values)newParamField.getDefaultValues().clone(true);<br />            newVals.clear(); <br />            paramData.first();<br />            while(!paramData.isLast()){<br />                ParameterFieldDiscreteValue value = new ParameterFieldDiscreteValue();<br />                value.setValue(paramData.getObject(colIndex));<br />                newVals.add(value);<br />                paramData.next();<br />            }<br />            <br />            dataDefController.getParameterFieldController().modify(origParamField, newParamField);<br />            // Store the report document in session<br />            session.setAttribute(reportName, clientDoc);<br /><br />        }<br /><br />            // ****** BEGIN CONNECT CRYSTALREPORTPAGEVIEWER SNIPPET **************** <br />            {<br />                // Create the CrystalReportViewer object<br />                CrystalReportViewer crystalReportPageViewer = new CrystalReportViewer();<br /><br />                //    set the reportsource property of the viewer<br />                IReportSource reportSource = clientDoc.getReportSource();               <br />                crystalReportPageViewer.setReportSource(reportSource);<br /><br />                // set viewer attributes<br />                crystalReportPageViewer.setOwnPage(true);<br />                crystalReportPageViewer.setOwnForm(true);<br /><br />                // Apply the viewer preference attributes<br /><br />                // Process the report<br />                crystalReportPageViewer.processHttpRequest(request, response, application, null);<br /><br />            }<br />            // ****** END CONNECT CRYSTALREPORTPAGEVIEWER SNIPPET ****************       <br /><br />    } catch (ReportSDKExceptionBase e) {<br />        out.println(e);<br />    }<br />   <br />%><br /><br /><br /><br />2) In a other report I tried to update the data source used by the report at runtime. I used the method &#39;setDataSource(ResultSet rs, String oldTableAlias, String newTableAlias)&#39; of the &#39;DatabaseController&#39;. I got a message like this: &#39;At present in Java reporting Component does not implement&#39;. I use JRC and the docs (http://support.businessobjects.com/global/interactive/xi/om/JRC/default.html) show me this method. Is it not possible to change the data at runtime in JRC? (I tried it with the methods &#39;setDataSource(IXMLDataSet rs, String oldTableAlias, String newTableAlias)&#39;, &#39;setDataSource(Object newds)&#39;, &#39;setDataSource(IDataSet ds, String oldTableAlias, String newTableAlias)&#39;, too. But the result was the same!)<br /><br /><br /><br />3) I tried to use Business Objects in JSF framework (Ver MyFaces 1.1.3) with the same samples above. But in JSF nothing work! I got the following exception. What is my problem? Can you get me a tutorial for jsf/BusinessObjects?<br /><br />08:21:43,165 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception<br />javax.faces.FacesException: com.businessobjects.reports.sdk.JRCCommunicationAdapter<br />    at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:435)<br />    at org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl.dispatch(JspTilesViewHandlerImpl.java:233)<br />    at org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl.renderView(JspTilesViewHandlerImpl.java:219)<br />    at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)<br />    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)<br />    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)<br />    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br />    at de.itinformatik.mes.web.filter.SynchronizingFilter.doFilter(SynchronizingFilter.java:42)<br />    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)<br />    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br />    at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)<br />    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)<br />    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br />    at de.itinformatik.mes.web.ajax.aa.AAFilter.doFilter(AAFilter.java:54)<br />    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)<br />    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br />    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)<br />    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)<br />    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br />    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)<br />    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)<br />    at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)<br />    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)<br />    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)<br />    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)<br />    at
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)<br />    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)<br />    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)<br />    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)<br />    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)<br />    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)<br />    at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)<br />    at java.lang.Thread.run(Thread.java:595)<br />Caused by: java.lang.ClassCastException: com.businessobjects.reports.sdk.JRCCommunicationAdapter<br />    at com.crystaldecisions.sdk.occa.report.application.ReportClientDocumentState.saveContents(Unknown Source)<br />    at com.crystaldecisions.sdk.occa.report.application.ReportClientDocumentState.save(Unknown Source)<br />    at com.crystaldecisions.xml.serialization.XMLObjectSerializer.save(Unknown Source)<br />    at com.crystaldecisions.sdk.occa.report.application.ReportClientDocument.writeExternal(Unknown Source)<br />    at com.crystaldecisions.sdk.occa.report.application.AdvancedReportSource.writeExternal(Unknown Source)<br />    at com.crystaldecisions.sdk.occa.report.application.NonDCPAdvancedReportSource.writeExternal(Unknown Source)<br />    at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1304)<br />    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1282)<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)<br />    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)<br />    at java.util.Hashtable.writeObject(Hashtable.java:813)<br />    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br />    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />    at java.lang.reflect.Method.invoke(Method.java:585)<br />    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)<br />    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)<br />    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)<br />    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)<br />    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)<br />    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)<br />    at java.util.ArrayList.writeObject(ArrayList.java:569)<br />    at sun.reflect.GeneratedMethodAccessor669.invoke(Unknown Source)<br />    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />    at java.lang.reflect.Method.invoke(Method.java:585)<br />    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)<br />    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)<br />    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)<br />    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)<br />    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)<br />    at java.util.ArrayList.writeObject(ArrayList.java:569)<br />    at sun.reflect.GeneratedMethodAccessor669.invoke(Unknown Source)<br />    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />    at java.lang.reflect.Method.invoke(Method.java:585)<br />    at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)<br />    at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)<br />    at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)<br />    at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)<br />    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)<br />    at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:291)<br />    at org.apache.myfaces.application.jsp.JspStateManagerImpl.serializeView(JspStateManagerImpl.java:590)<br />    at org.apache.myfaces.application.jsp.JspStateManagerImpl.saveSerializedViewInServletSession(JspStateManagerImpl.java:493)<br />    at org.apache.myfaces.application.jsp.JspStateManagerImpl.saveSerializedView(JspStateManagerImpl.java:332)<br />    at org.apache.myfaces.taglib.core.ViewTag.doAfterBody(ViewTag.java:122)<br />    at org.apache.jsp.testCR_jsp._jspx_meth_f_view_0(org.apache.jsp.testCR_jsp:149)<br />    at org.apache.jsp.testCR_jsp._jspService(org.apache.jsp.testCR_jsp:83)<br />    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)<br />    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)<br />    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)<br />    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)<br />    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)<br />    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)<br />    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)<br />    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)<br />    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)<br />    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)<br />    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)<br />    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)<br />    at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)<br />    ... 32 more<br /><br /><br />Thanks for your assistance <br /><br />Tosch</p>

    Which Business Objects are you referring to.
    MS .NET has a thing called Business Objects but they only work in .NET.

  • Having problem with java Timestamp

    Hey guys,
    I'm creating a Timestamp variable and then passing that variable to a method which is populating the Timestamp variable.
    When I get the value back its still null. Aren't all objects pass by reference? Am I missing something.
    Here is the code that I'm using
    Timestamp tStamp=null;
    boolean returnValue=someMethod(tStamp);
    I've checked the value of tStamp inside method and its getting populating but after the method call value of tStamp stays null.
    Please let me know what I'm doing wrong.
    Thanks

    sam2020 wrote:
    In other words if a Object is instantiated then its value would be retained after it is changed in the method. Err...kind of. A reference is something that can be pointed to any object of an agreeable type, and has little to do with any particular object. For instance, you could do this
    Object ts = new Object();
    ts = new Object();
    ts = new Object();
    ts = new Object();
    ts = new Object();
    ts = new Object();
    ts = new Object();At this point, ts has pointed to 8 completely separate objects, but you've only used one reference. Each time you reassign ts to a different Object, all references to the previously referenced objects have been lost and the Object will eventually be garbage collected.
    Similarly you can create an Object without ever having assigned it to a reference:
    new Object();
    new Object();
    new Object();
    new Object();
    new Object();
    new Object();
    new Object();
    new Object();This time, you've created 8 objects and have never even used a reference.
    Think of a reference as a plate of food.
    When you take a plate out of the cupboard, it's not linked to any specific food, even if there is a bunch of food in your fridge. This is similar to:
    Object plate; //or Object plate = null;You could bake a cake, but this has nothing to do with your plate...yet.
    Object cakePan = new Object(); //bake a cake...but it's not on your plate yet!Then you can transfer the cake to your plate
    Object plate = cakePan; //now plate is holding your new cake...but that doesn't make your plate a cake!Of course you could always scrape the rest of the cake into the garbage:
    Object plate = null;Or put something else on it instead:
    Object plate = fridge.takePizza();But the point is, your plate isn't tied down to what's on it. Just like a reference isn't tied (or even very much related) to what it points to. (Unless you use the final keyword).
    Can you tell I'm hungry?
    Edit:
    To tie this into your original question, when you call a method, you could pass the reference (plate) by value or by reference.
    So if you wanted to give your brother the rest of your cake, you could either:
    a) Pass him the plate (pass by reference). This would allow him to replace the contents of the place before he gives it back to you. Or,
    b) Move the cake to his plate (pass by value). This means he can change the cake (eat some, whatever), but he can't change what's on YOUR plate.
    Java always uses b).
    This analogy of course breaks down when you realize that with references, multiple references can reference the same object, but you can't put a single piece of cake on multiple plates.
    Edited by: endasil on 16-May-2008 4:36 PM

  • Updated to Snow Leopard, now having problems with Java??

    I've had my MacBookPro for five years, and I'm thrilled it's lasted so long with no bugs. However, since I updated from Tiger to Snow Leopard on my MBP, things have been running slow, hiccuping, etc. I've run the disc utility app a couple of times, and each time there is a long list of problems in the log under the categories "Applications/Utilities/AirPort Utility.app/Contents/Resources/Drives.icns", and
    "System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/management- agent.jar".
    This feels a lot like a virus. Can anyone advise? I'm real worried.
    Thanks,
    Nancy

    Nancy...  there aren't any Mac viruses.
    Your profile shows you are running v10.6.3. If that is the case, you need to update your system software to v10.6.7.
    Click your Apple menu (top left in your screen) then click Software Update.
    And check the startup disk in case it needs repairing.
    Launch Disk Utility. /Applications/Utilities. Select MacintoshHD in the panel on the left then select the First Aid tab.
    Click: Verify Disk  (not Verify Disk Permissions). if the startup disk needs repairing, follow the instructions for Using Disk Utility to verify or repair disks
    And how much free space there is on the startup disk... not enough and the drive will slow down. While you have the Disk Utility window open, at the bottom of the window see: Capacity and Available. Make sure you always have 15% free  disk space.
    Another way to keep an eye on free disk space, right or control click the MacintoshHD icon. Click Get Info. In the Get Info window you will see Capacity and Available.
    "Applications/Utilities/AirPort Utility.app/Contents/Resources/Drives.icns", and
    "System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/management- agent.jar".
    Those are just messages from verifying disk permissions. Nothing to worry about. I see the same ones.
    One key thing to remember with computers. Always backup your important files on a timely basis.

  • Having problems compiling *.java with import javax.servlet.jsp......

    I've been trying to do the tutorials in a book titled Apache Jakarta-Tomcat as part of my introduction to JSP. I'm new to Java but do know the basics. I have on my machine Java 1.3, Java 1.4, Java FrameWorks 2.1 and Jython 2.1 on Win2000 Pro. So enough about my configuration. I have never worked with packages also.
    I downloaded the files from the books site due to the fact I make a lot of typos when hand coding Java (I've become a pretty good debugger of my own code). But everytime I go to compile the *.java I get error messages. So below you will find HelloTag.java and beneath that the error messages that are thrown when I try and compile it. I tested other bits of *.java and have had no problem compiling them. Is there a JSP module I'm missing?
    Am I doing something wrong or am I missing something from my configuration.
    Marijan Madunic
    package chapter2;
    import javax.servlet.jsp.JspException;
    import javax.servlet.jsp.JspTagException;
    import javax.servlet.jsp.tagext.TagSupport;
    public class HelloTag extends TagSupport
    public void HelloTag() {
    // Method called when the closing hello tag is encountered
    public int doEndTag() throws JspException {
    try {
    // We use the pageContext to get a Writer
    // We then print the text string Hello
    pageContext.getOut().print("Hello");
    catch (Exception e) {
    throw new JspTagException(e.getMessage());
    // We want to return SKIP_BODY because this Tag does not support
    // a Tag Body
    return SKIP_BODY;
    public void release() {
    // Call the parent's release to release any resources
    // used by the parent tag.
    // This is just good practice for when you start creating
    // hierarchies of tags.
    super.release();
    D:\Java\JDK 1.3\bin>javac HelloTag.java
    HelloTag.java:3: cannot resolve symbol
    symbol : class JspException
    location: package jsp
    import javax.servlet.jsp.JspException;
    ^
    HelloTag.java:4: cannot resolve symbol
    symbol : class JspTagException
    location: package jsp
    import javax.servlet.jsp.JspTagException;
    ^
    HelloTag.java:5: cannot resolve symbol
    symbol : class TagSupport
    location: package tagext
    import javax.servlet.jsp.tagext.TagSupport;
    ^
    HelloTag.java:7: cannot resolve symbol
    symbol : class TagSupport
    location: class chapter2.HelloTag
    public class HelloTag extends TagSupport
    ^
    HelloTag.java:14: cannot resolve symbol
    symbol : class JspException
    location: class chapter2.HelloTag
    public int doEndTag() throws JspException {
    ^
    HelloTag.java:20: cannot resolve symbol
    symbol : variable pageContext
    location: class chapter2.HelloTag
    pageContext.getOut().print("Hello");
    ^
    HelloTag.java:24: cannot resolve symbol
    symbol : class JspTagException
    location: class chapter2.HelloTag
    throw new JspTagException(e.getMessage());
    ^
    HelloTag.java:28: cannot resolve symbol
    symbol : variable SKIP_BODY
    location: class chapter2.HelloTag
    return SKIP_BODY;
    ^
    HelloTag.java:37: cannot resolve symbol
    symbol : variable super
    location: class chapter2.HelloTag
    super.release();
    ^
    9 errors

    Well, it looks like you've not got the servlet development kit JAR on your classpath. I think it'll probably be called servlet.jar on your system. Add that to the classpath if it's not already there.
    Incidentally, you've bumped into one of the areas Java's slightly lenient - declaring a method that looks like a constructor:
    public HelloTag() { }
    public void HelloTag() { }The first is a constructor, the second is a normal method. I'm assuming you intended to have the former instead of the latter.
    Anyway, hope this helps.

  • Having problems with java

    This is mainly a problem with either the JRE or the JVM (not sure which... for some reason have both on my computer). I use Mozilla Firefox as my main browser but this same thing happens when using Netscape 7.2. Also, my OS is Windows ME. Now onto the problem: Whenever I try to load a game applet or some other java applet I usually get an error in one of these three files: JPINSCP.DLL, MSVCRT.DLL, or KERNEL32.DLL. This happens no matter the time of day and no matter what I do. I've tried uninstalling and reinstalling the V5 version of JRE to see if that would help but it hasn't. Any help with this would be appreciated.

    What error???

  • I am having problems with java

    Hi
    I am using a banking website for online management. I use Safari. Java is required for this applet to run.
    When I login, the message comes Timeout! And the applet shut offs.
    I am attaching the message that comes when I want to login.
    Any solution?
    Regards
    Ruumi

    Hello,
    If Java worked before March then it's probably been disabled my those lovely people at Microsoft who are so helpful and really want Java to be an integral part of our lives.
    Your problem may have been caused by the silent removal of the MSJVM from your machine, which can disable the Sun JVM without warning.
    To test this theory, type "jview" into a command window (Start -> Run, "cmd")
    this will tell you if you still have the MSJVM (which is probably a "no")
    Then type "java -version". (which tells you the installed version of the Sun JVM)
    If the Sun JVM is installed and the MSJVM is not, then create an empty text file called msjava.txt, then rename it to msjava.dll and put it in the System32 folder of the windows directory (probably C:\WINDOWS\SYSTEM32)
    This will fool your computer into thinking the MSJVM is still installed. Then all the JVM calls will be passed to the Sun JVM and Java should work again.
    If this doesn't work, you may need to install a different major version of the Sun JVM from http://java.sun.com/products/archive/index.html.
    Hope this helps.
    Alastair.

  • Still having problems compiling java code

    I still dont know what is wrong, it works just fine in JCreator but, when I try to use the command prompt it still gives me the same error message. Also I have made sure that the code is in the same directory with the command.

    Thanks for the advice Kitty, that was the command I
    was using javac <FileName.java>. I did, however,
    update my classpath and the path variables like you
    mentioned, but I am still recieving the same error
    message. I just cannot figure out where the error in
    the code is. =(Okay... apparently you need a little help...
    So to help you clarify thing a bit...
    Let's start here...
    This error below...
    C:\myfolder\test>javac VariableDemo.java
    'javac' is not recognized as an internal or external command,
    operable program or batch file.... is what you get if the OS does not know the path to javac.exe...
    if you type path at the command prompt you will see what your "System" path is, which would include an entry that would point to you sdk, something like "C:\YourJavaSDKFolder\bin";C:\someotherprogramfolder;
    This path has nothing to do with the classpath. Your system uses this path to find executables to run you programs ( although many are locations are actually in your registry an therefore no path entry is needed... i.e. MS Word )...
    This error...
    C:\myfolder\test>javac VariableDemo.java
    error: cannot read: VariableDemo.java
    1 errormeans that your compiler was not able to locate your *.java file. I was able to replicate because VariableDemo.java does not exist on my machine, so javac.exe naturally could not find the *.java file...
    javac.exe does not check the "System" path to find class files, so even though you saved you file in your "bin" folder of the SDK, javac would not know it there...
    the way that javac.exe is able to find you class files is either by the default "." as stated before which is your current working directory
    ( noted by your command prompt ... C:\myfolder\test> )
    or if you had specified your classpath either as an argument...
    C:\>javac -classpath c:\myfolder\test VariableDemo.javaor by setting the "classpath" environment variable either temporarily in you command prompt by typing
    set classpath=c:\myfolder\testor setting as you "System" environment variable by ( assuming Win XP though it similar for NT and 2000 ) via System Properties|Advance Tab|Environment Variable... Read your OS documentation for details involving setting your Environment Variable...
    as for why JCreator or what ever IDE you are using is able to do it, is because, part of what it does is temporarily pass the classpath information to the compiler automatically... so that you won't need to do it... and which is why IDE are generally not recommended to beginners to learn Java... It does to much stuff you... hence you classpath issue...
    anyway, check out the links provided for you for further and more detail information on setting the "classpath" on other Java basic...
    - MaxxDmg...
    - ' He who never sleeps... '

  • Having problem with Java Communication API

    I am using this code to list the port that i have but it does not return any thing. when i compile and run nothing is printed out. i think either its not going in while loop but if i remove while loop it returns NULL. so i think its not recognizing any PORTS. i want to detect a modem port as i want to make a voice mail software. I am jsut starting by listing, opening and listening to the ports. Please help me ASAP. Thank you.
    import javax.comm.*;
    import java.util.*;
    public class PortLister {
    public static void main(String[] args) {
    Enumeration e = CommPortIdentifier.getPortIdentifiers();
    while (e.hasMoreElements()) {
    System.out.println((CommPortIdentifier) e.nextElement());
    }

    Go back where you downloaded the API and read the FAQ. I think it's the question number 2.

  • Hei having problems updating  java for mac os x 10.6.8

    ive got tould that the new java does not suport 10.6. or earlyer models

    If you have OSX 10.6.8 as y say then yo have the latest vesrions since up to and including 10.6.8, APple supplied Java as part of the OSX as was stated in the link I provided in my response to your other post.
    How do I know if I have Java installed on my Mac?
    Mac OS X 10.6 and below: Apple's Java comes pre-installed with your Mac OS.
    Mac OS X 10.7 (Lion) and above: Java is not pre-installed with Mac OS X versions 10.7 and above. To get the latest Java 7 from Oracle, you will need Mac OS X 10.7.3 and above.
    If you have Java 7, you will see a Java icon under System Preferences.
    Java versions 6 and below are listed in the Java Preferences.app located in the Applications > Utilities folder on your Mac.

  • Still having problem with java regex

    Hi
    I have the following data in a text file:
    InstallDate:
    Location:
    Name: ps1
    PortName: IP_192.45.10.200
    ServerName:
    ShareName:
    I want to print out the string after the word "Name: " in this case it would be "ps1"
    I ve tried it as follow but it does not seem to work:
    Pattern p =Pattern.compile("Name :(\\w*)");
    String line = null;
    try
    BufferedReader in = new BufferedReader(new FileReader("c:\\printerinfo.txt"));
    while((line = in.readLine()) != null)
    Matcher m = p.matcher(line);
    boolean matchFound = m.find();
    if(matchFound )
    String printName = m.group(1);
    System.out.println( printName );
    else
    System.out.println("line" + line);
    catch (Exception e)
    System.out.println(e);
    Does anyone have a suggestion on how I can get this to work?
    thanks

    Your line has a type: Pattern p =Pattern.compile("Name: (\\w*)");The space should be after ":", not before it.
    This should pick up both Name: ps1 and PortName: something, since you Matcher.find() will find anthing that matches.
    To match only from the beginning of the line, use:Pattern p =Pattern.compile("^Name: (\\w*)");

  • Problem mapping JDO to an existing DB schema

    I'm having problems mapping a legacy database to JDO. Suppose I have a class
    public class Test {
    public int pk;
    public String fieldA;
    public String fieldB;
    public String fieldC;
    An existing legacy table TEST looks like
    TEST
    |============|
    | PK | ... |
    |============|
    | 1 | ... |
    |============|
    The fields values are stored in a separate table
    TEST_FIELDS
    |==========================|
    | PK | FIELD_ID | VALUE |
    |==========================|
    | 1 | 1 | fred |
    | 1 | 2 | accounts |
    | 1 | 3 | jim |
    | 2 | 1 | wilma |
    | 2 | 2 | research |
    | 2 | 3 | alice |
    |==========================
    So the value for fieldA of an object with key i in the TEST table
    would be found in the TEST_FIELDS table with key (i, 1), fieldB with
    key (i,2) and fieldC with (i,3) and so on. I'm not sure how I would express
    such a mapping in the JDO metadata file, or indeed whether this is
    even possible. Any suggestions?

    This mapping is not possible in the current incarnation of
    Kodo.

Maybe you are looking for