The Java Random class

Hi, everyone
I have a question about the Random class
The following class can choose number randomly. But sometimes it chooses a number for more than once. How do I make it choose the numbers randomly but have no repetition. Thank you very much!
import java.util.*;
public class CodeTest
  public static void main(String[]args)
   System.out.println("random number");
   CodeTest x = new CodeTest();
   x.randomNum();
    public void randomNum()
        Random generator = new Random();
        for (int i = 0; i < 10; i++)
            int randomNumber = generator.nextInt(10);
            System.out.println (randomNumber);
}And what if I have 15 numbers and I just want to pick out ten of them randomly, again, no repetition.
Thank you very much!
Edited by: Terry001 on Apr 21, 2008 7:51 PM

Can you give me some codes to demonstrate how to shuffle the Array[],please? And if I want to store the possible numbers in ArrayList, is there any difference?
Thank you!
Edited by: Terry001 on Apr 21, 2008 8:36 PM

Similar Messages

  • I need the Java IDoc Class Library

    Hi,
    I'm desperately looking for the Java IDoc Class Library. What for? I'm doing a project for university and I have a test version running on my own computer (Mini WAS 6.20 with the FlightBooking example installed). The SAP Service Marketplace is for registered customers only. Since I only have a test environment (mentioned above) I can't register there and download it.
    Could anyone please send me this library by mail, to [email protected] Since I don't know how big this package is: my mail provider has a 15MB/per single mail limit. If biiger, please split.
    Yes, I'm asking for much. But I'm pretty desperate and I have to get going, since I'm running out of time.
    If there are other ways to get this library, please tell.
    Thanks
    Jonny

    Hi Johannes
    The SAP Java IDoc Class Library consists of two parts, the SAP Java Base IDoc Class Library and the SAP Java Connector IDoc Class Library. The SAP Java Base IDoc Class Library provides an API which helps navigating, reading, filling, and modifying IDocs. This base package is middleware independent. Creating, sending, and receiving IDocs is middleware dependent. To make use of the SAP Java Base IDoc Class Library you will need an additional middleware dependent add-on package implementing the defined interfaces like the SAP Java Connector IDoc Class Library.
    The SAP JCo can be downloaded from the   
    https://websmp101.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000463649
    of SAP JCo. The SAP JCo package includes the software as well as documentation, tutorial, and examples. The SAP Java IDoc Class Library can be downloaded from the same URL, and then follow the link to SAP Java IDoc Class Library. The SAP Java IDoc Class Library packages include the software as well as documentation.

  • Where are the Java API classes?

    Hello All,
    I understand that Oracle9i uses a Java API different than those older classes found in sdoapi.zip here on the OTN.
    Problem is, I don't know where to find them in my newly-installed 9iR2.
    Can anyone help me with this simple question or point me to appropriate documentation?
    Thanks!
    -- john

    I believe the new Java API classes are slated for 10i.

  • Java Connectivity - No classes appearing in the Java Beans Classes dropdown

    Hi,
    VERY NEW user to Crystal Reports.  I am trying to create a report using a java class as a datasource.  I have updated the setting in the CRConfig.xml file, and can get the Java Beans Connectivity screen to appear, but is shows none of my classes in the dropdown.  I found a knowlege base entry that indicated this problem was caused by the JavaBeansClassPath value in the CRConfig.xml file being invalid.  But I've verified the location and it is pathed directly to the classes.
    Not sure what I am missing, but any help is greatly appreciated.
    Thanks!

    Ted,
    Thanks for the reply.  I checked out each of your suggestions, but haven't had any luck thus far.  Here's what I found:
    1.  We created a simple method in an existing public class to return a ResultSet.  The method looks like this:
    public ResultSet GetAllMediaTypesRS()
          String strFuncName = "ScsXDMDatabase::GetAllMediaTypesRS : ";
          ScsDebug coutDebug = new ScsDebug();
          String strSqlStmt;
          String strMediaType;
          ScsStringList sslReturnList = new ScsStringList();
          // Create the SQL to get all the Displayable Media Types.
          strSqlStmt =
             "SELECT DISTINCT mt.Media_Type_Name "
                + "FROM dbo.Media_Type mt "
                + "WHERE mt.Media_Type_Rqst_Display_Ind = 1 "
                + "ORDER BY mt.Media_Type_Name";
          coutDebug.println(strFuncName + "SQL Statement:  " + strSqlStmt);
          // Run the Query
          Statement stmt = null;
          ResultSet SQLResult = null;
          try
             stmt = GetConnection().createStatement();
             SQLResult = stmt.executeQuery(strSqlStmt);
          } //End of Try
          catch (SQLException sqle)
             if (sqle.getErrorCode() != 0)
                coutDebug.println(
                   "Error in ExecuteQuery: "
                      + "Error code - "
                      + sqle.getErrorCode());
                coutDebug.println("Message - " + sqle.getMessage());
          return SQLResult;
    The signature, and the method look fine to us, but maybe we are missing something obvious.
    2. We do use JDK 1.5 to compile the classes, but my JavaDir setting in the CRConfig.xml file points to jre1.6.0_02.  I assume this is OK.
    3. We do see java.exe start up when opening the JavaBeans connection.
    4. No firewall issues as we are inside our corporate network.
    Any other thoughts or ideas?  I did see a knowledge base entry that indicated the cause of this particular problem is that the JavaBeansClassPath in CRConfig.xml is incorrect or invalid.  I've validated the path takes me right to the classes, so I believe that is OK.  Is there some way that we can see the actual path that is searched when the JavaBeans connection is opened?
    Thanks for your help.
    --john davies

  • Determining path to the Java SE classes

    hallo,
    i need a clean and cross platform way to find the .jar containing the standard JRE classes, like java.lang, java.awt etc. to look up which classes are in a specific package (e.g. list all classes in "java.lang").
    at least on mac os x, i have the problem getting the path to that .jar, which here is
    /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Classes/classes.jari tried to get this from System.getProperty( ) but without success ... the "java.home" property points to /System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Home ; "java.class.path" lists only the custom class path of my application but not the jre's classpath . "java.library.path" is wrong, "java.ext.dirs" is wrong ;--(
    of course, i don't want to do new File( new File( new File( System.getProperty( "java.home" )).getParentFile(), "Classes" ), "classes.jar" ) since it will fail on linux or windows. so what to do ? what's the mechanism for javac to find the classes if write "import java.awt.*;" ?
    thanks a lot! ciao, -sciss-

    i poked around in the properties and found ...
    sun.boot.class.pathwhich contains the path i'm looking for . is this a "robust" property which is available in all VMs and will be supported in a future java version ; so can i rely on this ?
    thanks , -sciss-

  • Where should i add the java packages class path in the ORACLEJDeveloper 10g

    Hello friends,
    I have created a BPEL Program using java embedding activity.
    In it i have added some java code.
    I want to attach path of some java class packages.
    So can any one tell me solution for this.
    Thanks and regards.
    Ram Krishna Tripathi
    [email protected]

    Hello friends,
    I have made a Bpel program in oracle process manager 10.1.2 . using java
    embedding activity.
    (i) I have put the java class files in BPEL-INF /classes folder and
    SYSTEM/classes folder but still compiler is giving error that classes
    couldnot be found.
    I have set the class path in Project -> properties
    So please tell me what could be solution for this problem..
    (ii) Can the import package statements can be written in BPEL program in the
    java embedding activity ?
    Thanks and regards
    Ram Krishna Tripathi
    [email protected]

  • Replacing the java.* Classes

    I want to change the code to say, java.lang.Class for debugging/monitoring. I know the java.exe has a -Xbootclasspath/p:path option for us to prepend the new core api classes to the classpath and the source code for the core api classes are available in the jdk. But the problem is it seems that the javac.exe does not accept a class named java.*. I can use byte code instrumentation tools like Javassist/BCEL to inject code to existing system classes. But is it possible to modify the source code directly and recompile them without having to use byte code instrumenation?

    alec_lee_yl wrote:
    I want to change the code to say, java.lang.Class for debugging/monitoring. I know the java.exe has a -Xbootclasspath/p:path option for us to prepend the new core api classes to the classpath and the source code for the core api classes are available in the jdk. But the problem is it seems that the javac.exe does not accept a class named java.*. Huh? I just compiled java.lang.String using javac.

  • Where to put the java bean classes

    Hi,
    I am very new to the web service developer pack. I have written a java bean but don't know which directory to place it. Can anyone please tell mi???
    Thanks

    put in
    WEB-INF/classes
    if is a jar file
    put in
    WEB-INF/lib
    regards

  • Class Not found Exception for invoking BPEL process through the Java code

    Hi.
    The JDeveloper IDE raise the Exception From the invoking the BPEL process through the java code .Class Not Found Exception (Locator,ID.......).What is process of importing these classes from API.

    In your code (.bpel file) import the library using the bpelx:exec tag. For example the adding the following entry in your .bpel file imports the com.oracle.bpel.client.util library.
    <bpelx:exec import="com.oracle.bpel.client.util.*"/>

  • Tool to create Java Object classes using the Database Tables

    Hi,
    Is their any tools or utility available to create the Java Object Classes using the Database Tables as input.
    Lets Say I am having the Employee, Employee_Salary tables in the Database.The utility has to create the Java Object classes with the relation.
    Please Help...
    Thx..

    Hm, for generating regular Java classes I wouldn't know one from memory. But I suggest you start searching in for example the Eclipse marketspace for a third party plugin that can do it. If all fail, you could always use Hibernate Tools from the Jboss Tools Eclipse plugin set to generate Hibernate/JPA entities and then strip the annotations from them to turn them into regular POJO classes.
    How many tables are we talking about anyway? It might be less effort to just create the classes with properties and then use an IDE to generate getters and setters for them.

  • Can not map .xsql to the java class name

    I am using IBMWebAS V2.0 with HTTP server V1.3.3, but I having problem mapping .xsql to the java servlet class oracle.xml.xsql.XSQLservlet. class path is properly defined in the bootstap.properties file but where can I need to put the codes for proper servlet passing with proper extention.

    I am using IBMWebAS V2.0 with HTTP server V1.3.3, but I having problem mapping .xsql to the java servlet class oracle.xml.xsql.XSQLservlet. class path is properly defined in the bootstap.properties file but where can I need to put the codes for proper servlet passing with proper extention.

  • Java.lang.Class- getFields() results in JVM crash when called through JNI

    From a C++ application, I use Invocation APIs to create a JVM and call some Java methods using JNI
    I get a crash in jvm.dll with EXCEPTION_ACCESS_VIOLATION
    when I try to call "getFields" method of java.lang.Class in order to get the Fields of the java class
    This method call, should return a java/lang/reflect/Fields[] on success
    I am able to get the method ID of this method by using pEnv->GetMethodID(..)
    However, when I call this method using CallObjectMethod(..), HotSpt JVM crashes with access violation with the dump given below.
    Any clues on how to debug and find the problem?
    Or has anyone tried getting the fields of a Java class from C++ by calling reflection APIs uing JNI?
    Thanks in advance!
    Sample code
    jclass testerClass = pEnv->FindClass("com/test/Tester");
    jmethodID cid = pEnv->GetMethodID(testerClass,"<init>","()V");
    if(NULL == cid)
    pEnv->ExceptionDescribe();
    jobject testerObject = pEnv->NewObjectV(testerClass, mid);
    jmethodID mid = pEnv->GetMethodID(testerClass, "getClass",
                             "()Ljava/lang/Class;");
    jobject clsObj = (jobject)pEnv->CallObjectMethod(testerObject, mid);
    pEnv->ExceptionDescribe();
    jclass      jCls = pEnv->GetObjectClass(clsObj);
    jmethodID midGetFields = pEnv->GetMethodID(jCls, "getFields",
                                            "()[Ljava/lang/reflect/Field;");
    jobjectArray jobjArray = (jobjectArray)pEnv->CallObjectMethod(testerObject, midGetFields);
    pEnv->ExceptionDescribe();
    Crash dump
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x809E69F
    Function=JVM_FindSignal+0x11505
    Library=D:\Java\j2re1.4.2_03\bin\client\jvm.dll
    Current Java thread:
         at java.lang.Class.privateGetDeclaredFields(Unknown Source)
         at java.lang.Class.privateGetPublicFields(Unknown Source)
         at java.lang.Class.getFields(Unknown Source)
    Dynamic libraries:
    0x00400000 - 0x00419000      E:\SC\SC12.1\SCApplications\SNMP\Bin\JNITester.exe
    0x77F50000 - 0x77FF7000      C:\WINDOWS\System32\ntdll.dll
    0x77E60000 - 0x77F46000      C:\WINDOWS\system32\kernel32.dll
    0x10000000 - 0x10023000      E:\SC\SC12.1\SCApplications\SNMP\Bin\JniUtils.dll
    0x00320000 - 0x00332000      E:\SnmpIpmNativeTestDriver\MTFStubHelper.dll
    0x00340000 - 0x0035B000      E:\SnmpIpmNativeTestDriver\MTFXMLFileAPI.dll
    0x12000000 - 0x122B1000      e:\sc\sc12.1\bin\xerces-c_2_2_0D.dll
    0x77DD0000 - 0x77E5D000      C:\WINDOWS\system32\ADVAPI32.dll
    0x78000000 - 0x78086000      C:\WINDOWS\system32\RPCRT4.dll
    0x10200000 - 0x1026C000      e:\sc\sc12.1\bin\MSVCRTD.dll
    0x102A0000 - 0x102B7000      e:\sc\sc12.1\bin\MSVCIRTD.dll
    0x5F800000 - 0x5F8E9000      e:\sc\sc12.1\bin\MFC42uD.DLL
    0x77C70000 - 0x77CB0000      C:\WINDOWS\system32\GDI32.dll
    0x77D40000 - 0x77DCC000      C:\WINDOWS\system32\USER32.dll
    0x5F700000 - 0x5F746000      e:\sc\sc12.1\bin\MFCD42uD.DLL
    0x5F500000 - 0x5F5C6000      e:\sc\sc12.1\bin\MFCO42uD.DLL
    0x10480000 - 0x104FE000      e:\sc\sc12.1\bin\MSVCP60D.dll
    0x15020000 - 0x15042000      e:\sc\sc12.1\bin\SCTraceLib.dll
    0x6D510000 - 0x6D58D000      C:\WINDOWS\System32\dbghelp.dll
    0x77C10000 - 0x77C63000      C:\WINDOWS\system32\msvcrt.dll
    0x77C00000 - 0x77C07000      C:\WINDOWS\system32\VERSION.dll
    0x00360000 - 0x0037D000      e:\sc\sc12.1\bin\SCFileManager.dll
    0x76BF0000 - 0x76BFB000      C:\WINDOWS\System32\PSAPI.DLL
    0x00420000 - 0x00580000      e:\sc\sc12.1\bin\BctCoreCL.dll
    0x5D920000 - 0x5D929000      C:\WINDOWS\System32\RPCNS4.dll
    0x71B20000 - 0x71B31000      C:\WINDOWS\system32\MPR.dll
    0x71C20000 - 0x71C6E000      C:\WINDOWS\System32\NETAPI32.dll
    0x71AB0000 - 0x71AC5000      C:\WINDOWS\System32\WS2_32.dll
    0x71AA0000 - 0x71AA8000      C:\WINDOWS\System32\WS2HELP.dll
    0x15000000 - 0x15012000      e:\sc\sc12.1\bin\CTEventLog.dll
    0x773D0000 - 0x77BC2000      C:\WINDOWS\system32\SHELL32.dll
    0x70A70000 - 0x70AD4000      C:\WINDOWS\system32\SHLWAPI.dll
    0x771B0000 - 0x772D1000      C:\WINDOWS\system32\ole32.dll
    0x77120000 - 0x771AB000      C:\WINDOWS\system32\OLEAUT32.dll
    0x1F7A0000 - 0x1F7D6000      C:\WINDOWS\System32\ODBC32.dll
    0x77340000 - 0x773CB000      C:\WINDOWS\system32\COMCTL32.dll
    0x763B0000 - 0x763F5000      C:\WINDOWS\system32\comdlg32.dll
    0x08000000 - 0x08138000      D:\Java\j2re1.4.2_03\bin\client\jvm.dll
    0x76B40000 - 0x76B6C000      C:\WINDOWS\System32\WINMM.dll
    0x5FD00000 - 0x5FD0D000      C:\WINDOWS\System32\MFC42LOC.DLL
    0x71950000 - 0x71A34000      C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.10.0_x-ww_f7fb5805\comctl32.dll
    0x1F840000 - 0x1F857000      C:\WINDOWS\System32\odbcint.dll
    0x5DAC0000 - 0x5DAC7000      C:\WINDOWS\System32\rdpsnd.dll
    0x00FE0000 - 0x00FE7000      D:\Java\j2re1.4.2_03\bin\hpi.dll
    0x01000000 - 0x0100E000      D:\Java\j2re1.4.2_03\bin\verify.dll
    0x01010000 - 0x01029000      D:\Java\j2re1.4.2_03\bin\java.dll
    0x01030000 - 0x0103D000      D:\Java\j2re1.4.2_03\bin\zip.dll
    0x76C90000 - 0x76CB2000      C:\WINDOWS\system32\imagehlp.dll
    Heap at VM Abort:
    Heap
    def new generation total 576K, used 132K [0x15050000, 0x150f0000, 0x15530000)
    eden space 512K, 25% used [0x15050000, 0x15071250, 0x150d0000)
    from space 64K, 0% used [0x150d0000, 0x150d0000, 0x150e0000)
    to space 64K, 0% used [0x150e0000, 0x150e0000, 0x150f0000)
    tenured generation total 1408K, used 0K [0x15530000, 0x15690000, 0x19050000)
    the space 1408K, 0% used [0x15530000, 0x15530000, 0x15530200, 0x15690000)
    compacting perm gen total 4096K, used 964K [0x19050000, 0x19450000, 0x1d050000)
    the space 4096K, 23% used [0x19050000, 0x191410e0, 0x19141200, 0x19450000)
    Local Time = Wed Aug 25 21:06:44 2004
    Elapsed Time = 0
    # HotSpot Virtual Machine Error : EXCEPTION_ACCESS_VIOLATION
    # Error ID : 4F530E43505002EF
    # Please report this error at
    # http://java.sun.com/cgi-bin/bugreport.cgi
    # Java VM: Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode)

    You are right, I tried getting the java.lang.Class reference for the com.test.Tester by calling getClass() on com.test.Tester
    And using this jclass reference for java.lang.Class, I tried getting the method ID of getFields and eventually the Field[]
    Thanks for the help
    I have some more questions.
    Assumption - Using JNI, I got the fields array of com.test.Tester and I am iterating through the fields
    1.Assuming that the Tester class had an Integer field say m_nIntVal, then once I get the jobject equivalent of this Field in C++.
    Now I need to get the type of the field (I call the method java.lang.reflect.getType() from JNI)
    This gives me a jclass reference to it's type i.e java.lang.Integer
    2.I need to get the name of this type i.e I want to get the name of the type in a string as "java.lang.Integer"
    For this, on the jclass reference of java.lang.Integer got in Step 1, I call getClass() from JNI (to get the java.lang.Class) and then getName()
    Now, for calling getClass(), I need a temporary object reference corresponding to the jclass of java.lang.Integer, The problem is that Integer does not have a default constructor, so my call to create the jobject fails.
    But, since I do not know that I am constructing an Integer (remember that is what I am trying to find out - getType), I cant pass any values to constructor
    Now, how do I go about creating a jobject of Integer, without knowing that I am constructing that, as this does not have a default constructor without parameters
    Also, I tried using AllocObject to get the jobject and then tried to get the method ID of getClass(). Even this failed
    3. If the com.test.Tester class had a primitive "int" field, say m_nPrimitiveInt
    for which java provides a Class representation, I am able to get the jclass reference to the type of m_nPrimitiveInt
    Now, how do I get the name of the type as "int" in a string?
    Forllowing a similar procedure like in Step 2 fails when I try to pass the jclass reference to the type of m_nPrimitiveInt to the GetMethodID
    with the error FATAL ERROR in native method: JNI received a class argument that is not a class
    Can you tell me what is the way out?
    Thanks in advance,
    Also, can I mail you with some doubts that I have? If its ok, please contact me at [email protected]

  • Intermittent problem in Coldfusion 9, BlazeDS with Java Service class and CFCProxy

    If that title doesn't scare you, you might be able to help.
    I believe there is a bug in Coldfusion 9's version of CFCProxy.
    Tech Stack:
    Flex Application
    BlazeDS (stock with CF9)
    Java Service class (java-amf BlazeDS endpoint)
    Coldfusion business tier, invoked by the Java Service class using CFCProxy
    Tomcat 6 on Java 1.6
    Linux or Windows servers, both exhibit same behavior
    SQL Server database
    Problem:
    When Flex calls a Java service method through BlazeDS that invokes a Coldfusion CFC through CFCProxy, and the method called in the Coldfusion CFC includes a large query (10 fields, 1000+ records returned), we intermittently (1 out of ~5 times) receive the following exception:
    java.lang.NullPointerException
        at coldfusion.runtime.NeoPageContext.popBody(NeoPageContext.java:1925)
        at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:57)
        at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
        at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
        at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
        at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
        at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491)
        at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:437)
        at coldfusion.cfc.CFCProxyFilter.invoke(CFCProxyFilter.java:56)
        at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:381)
        at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:2 8)
        at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
        at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
        at coldfusion.cfc.CFCProxy.doInvoke(CFCProxy.java:281)
        at coldfusion.cfc.CFCProxy.invoke(CFCProxy.java:193)
        at com.lampo.mapping.service.MapToolWebService.makeCfcProxyCall(MapToolWebService.java:1326)
        at com.lampo.mapping.service.MapToolWebService.getTerritoryList(MapToolWebService.java:609)
        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:597)
        at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:418)
        at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183)
        at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1400)
        at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:1005)
        at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:103)
        at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158)
        at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44)
        at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67)
        at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:166)
        at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:291)
        at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:353)
        at coldfusion.flex.ColdfusionMessageBrokerServlet.service(ColdfusionMessageBrokerServlet.jav a:114)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at coldfusion.filter.FlashRequestControlFilter.doFilter(FlashRequestControlFilter.java:71)
        at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.j ava:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:769)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:698)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:891)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
        at java.lang.Thread.run(Thread.java:662)
    Attempts to diagnose:
    These things remove the problem:
    CF8 works perfectly with the identical code, never fails.
    Calling the same Coldfusion CFC method with the large query (10 fields, 1000+ records returned) from another CFC 100+ times never fails.
    Using a Coldfusion service class (a "my-cfamf" BlazeDS endpoint) never fails. However, we need to use a Java service class because we are using ~40 Java value objects (VOs) that correspond to ~40 auto-generated Actionscript VOs. BlazeDS won't correctly deserialize the Actionscript VOs into the Java VOs with a Coldfusion service class.
    If I replace the large query with a Sleep(5000) instead, it never fails.
    These things don't remove the problem:
    Using the latest Microsoft JDBC driver doesn't help.
    Even if the Coldfusion method returns an empty resultset (i.e., just calls the query and doesn't do any other work or return anything), the call still fails intermittently.
    If the Coldfusion CFC with the method in question is instantiated and stored in SERVER scope as a singleton across multiple requests with CFCProxy, doesn't help.
    Different large (1000+ record queries) all fail in the same way.
    Caching the query doesn't help
    Changes in the datasource configuration doesn't help
    Using the older version of BlazeDS doesn't help
    With all of these tests, I believe it comes down to a problem in the combination between CFCProxy and large queries. There may be more to it, but that is what we've narrowed it down to.
    Any insight would be very welcome.

    Hi Frank
    The page is ADF bound, I've added the page source and the adfc-config source below :
    Page
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1">
          <af:form id="f1">
            <af:commandButton text="commandButton 1" id="cb1"
                              actionListener="#{test.testws}"/>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>adfc-config
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
      <view id="view1">
        <page>/view1.jspx</page>
      </view>
      <managed-bean id="__4">
        <managed-bean-name id="__3">test</managed-bean-name>
        <managed-bean-class id="__2">ch.mit.test.test</managed-bean-class>
        <managed-bean-scope id="__1">request</managed-bean-scope>
      </managed-bean>
    </adfc-config>It seems to be the same sort of problem as in Re: Error in ADF Web Service Connection
    Regards
    Paul

  • Use java mapping class on PI 7.0

    Hi experts,
    I have a problem with a java mapping class on PI 7.0, maybe somebody could help me.
    I have a java mapping that call a webservice using AXIS library. If I run on my PC the java mapping is working. I load on Imported Archive the Java mapping class and AXIS librarys. My Java mapping class is compilated by jdk 1.4.2.09, like others java mappings that i have on PI 7.0 system, but when I execute the interface, its returns an error:
    Incompatible class versions (linkage error)
    This error is caused by AXIS Libraries, I use AXIS 1.4 version, and I think that this version is using jdk 1.5 because I read it on some foros. Could somebody confirm it? If it is true, could somebody tell me if there are some AXIS version that use jdk 1.4 or maybe How could I solved it? Thanks.
    Regards,
    Gemma

    Incompatible class versions (linkage error)
    this is usually when the jdk version of XI server and the library version you used to develop the mapping are incompatible. Make sure you use the same version as of the server

  • Java SE classes in a JAR fail preverification... and so they should?

    Hi Folks,
    I'm trying to add a util JAR to my MIDlet suite, so chucked the JAR file in with it but during preverification, the following comes up...
    Error preverifying class com.foo.Bar
        java/lang/NoClassDefFoundError: java/lang/Comparable
    Build failedI'm assuming this is becuase the Java ME won't have the Java SE class java.lang.Comparable available to it and so fails. Is this the case?
    Prob a silly question, but does this mean I can't use ANY J2SE classes (that arn't in the ME API) on the device? For example, java.util.Map? It might not be so bad as I can possibly re-work the JAR project in question to lightwieght version but I guess I just want to know.
    Anyway, thanks for any help,
    Toby

    ... does this mean I can't use
    ANY J2SE classes (that arn't in the ME API) on the
    device?That is very true. The html-documentation is pretty useful - it can give you a full list of all the APIs available under J2ME. Look under the docs/api subdirectory of your ToolKit installation directory for index.html.
    In particular, you'll have to work around file access and networking in J2ME if you have said functionality in your J2SE app. Look at the Connector class under javax.microedition.io for networking and RecordStore class under javax.microedition.rms for 'file' io.
    BTW - one way to get around missing classes (although it is not sanctioned by Sun license agreement) is to simply pull the class out of the J2SE API and include it in your jar.
    Ricardo

Maybe you are looking for