Complex application

Hi
I am trying to build an application. The idea is:
1. connect a mobile to a router
2. Let the mobile search and display the devices that attached to the router (getting the device name and IP address)
3. The user clicks on one of the devices to make a connection with it
I tried to use HttpConnection to access the router and get the DHCP Table but it returns error because the got username and password. My router is Netgear DG834G.
I know this sounds a bit complex but any help will be appreciated.
regards

In my test workspace I created Project1 and Project1 projects.
In Project1, I created a package of BC4J components named package1
I chose "Deploy Business Components..." on Project1 and selected a Simple Archive. Upon deployment, this created me two JAR files Project1CSCommon.jar and Project1CSMT.jar.
I created a library for Project1CSMT.jar and added this library to my Project2 project's library list.
In Project2, I created another BC4J package of components named package2
I right-mouse "Import Business Components..." and I navigate to the Project1CSMT.jar and use the file dialog to "drill down" into the jar file just like a folder, and pick the package1.xml file. This results in importing package1 into Project2.
I chose "Deploy Business Components..." in Project2 and select an AppModule Session Bean (BMT).
I expand the Project2EJB.bcdeploy node in the navigator and right-mouse on the Project2EJB.deploy node to pick "Settings...".
I click on the "Profile Dependencies" tab, and check [x] Project1MiddleTier.deploy and [x] Project1Common.deploy to make those two deployment profiles a dependency of this one.
Then I right-mouse "Deploy" on the Project2EJB.bcdeploy node and it deploys my AppModule in Project2 as a remoteable application module. I go out to the file system and do:
% jar tvf Project2EJB.ear
   329 Thu Jun 20 18:31:10 CEST 2002 META-INF/application.xml
  1665 Thu Jun 20 18:31:10 CEST 2002 META-INF/data-sources.xml
   286 Thu Jun 20 18:31:10 CEST 2002 META-INF/orion-application.xml
  4361 Thu Jun 20 18:31:10 CEST 2002 Project1CSCommon.jar
13344 Thu Jun 20 18:31:10 CEST 2002 Project1CSMT.jar
25345 Thu Jun 20 18:31:10 CEST 2002 Project2EJB.jar
  9185 Thu Jun 20 18:31:10 CEST 2002 Project2EjbCommon.jarto verify that it includes my imported JAR files into the EAR file.

Similar Messages

  • HR_INFOTYPE_OPERATION-- Complex Application Error

    Hi:
    I am using the FM "HR_INFOTYPE_OPERATION" for uploading data from flat file to IT0008 infotype.It's giving some error "A complex application error has occurred".I have checked SAP note 710779 but it does not help very much because we are already in the release and the correction is already there.Anybody with any idea is highly appriciated.Award points confirmed.
    ~Sinchan

    try putting DIALOG_MODE = '2' and execute the program.. you cn check if the values get passed to the function module ocrrectly..
    ~Suresh

  • Most complex application

    What is the most complex application that users have developed using HTMLDB? Is it available for preview (read-only) on htmldb.oracle.com?
    I am having difficulty "selling" HTMLDB in our predominantly client-server/VB/.NET/ASP, etc shop. "This is a configurator, not a development environment, you cant develop really complex apps using this" "You dont even have access to the raw HTML to tweak it". "Our typical apps have loads of business logic in it, no way this toy can do it", "The (MS) tools we are currently using can do all of this stuff, why would I want to consider learning a new tool and switching", etc.
    Thanks

    to be derived from zero experience or knowledge of
    HTML DB.Right, these were the comments I received after a 1-hour demo of HTMLDB to a group of MS-based developers who had never seen HTMLDB before.
    I do not understand the comparison to a configurator,
    that one is confusing. HTMLDB is a "configurator". You guys call it a "declarative programming environment". If anyone has seen Siebel Tools, that is also a configurator. In other words, a tool/environment which generates code for you and provides hooks to override/customize the generated code. The code in this case is HTML.
    Their thought was that any point-n-click, wizard-based tool is for sissies. "Real men" use Visual Studio or the other MS offerings. HTMLDB was compared to MS Front Page or even MS Access to build simple data-manipulation forms.
    I guess I would ask what is the definition of a "really > complex app"?An app with a lot of complex business logic, complex navigation, validations, high degree of client interaction (Javascript/DHTML with the browser paradigm), etc.
    I also like the conclusion of "the MS tools...can do
    all of this stuff". Do what? Write all of your
    business logic for you automagically? Hardly. TheBy "all this stuff", they meant the application development environment that HTMLDB provides, the widgets, the branching, the validations, etc. That is not exactly ground-breaking, a number of development environments out there offer similar things.
    Needless to say, I didnt agree. IMHO, HTMLDB is not a revolution, its a natural evolution for Oracle as a database company to provide tools to build apps using that data. But I can see how it does not offer anything so compelling as to persuade a 10-year MSCE veteran to consider switching
    Thanks

  • Complex application dependencies

    I have a somewhat complex application dependency tree.
    I have four applications A, B, C, and D. Each application is deployed in its own EAR file. B depends on EJB's from application A. C also depends on A. D depends on A, B, and C. In addition, A depends on B and C. So it makes a diamond, with A at the top, B and C side-by-side on the middle level, and D at the bottom. Each application is deployed in its own EAR file.
    The parent attrib in server.xml doesn't handle this at all. First, you can only specify one parent for each application, and I have one app (D) that depends on three others. Also, the parent relationship only flows one direction. I have three apps that have bidirectional dependencies (A<->B, A<->C).
    Putting all the EJB's in a single EAR file would be very clunky. A couple of my apps already take serveral minutes to deploy, putting them all together would seriously dent development productivity.
    Has anyone else had complex dependencies like this? If so, how did you deal with them?
    Thanks,
    Lance

    On 19/7/09 16:04, Ralf Ebert wrote:
    > I have to agree, setting up a run configuration and dependencies for
    > SWTBot for a complex application is tedious.
    >
    > What do you think about reducing the runtime dependencies of SWTBot?
    > Something like a single plug-in "org.eclipse.swtbot.runtime" containing
    > all the classes required at runtime (maybe complemented by separate
    > finder plug-ins)?
    Could you elaborate more on what you mean by a plugin containing runtime
    classes and how you propose to split them ?
    Ketan
    http://studios.thoughtworks.com/twist | http://twitter.com/ketanpkr

  • Help in profiling a complex application needed

    Hi,
    I have a rather complex, general, problem here I would like to solve using
    dtrace so any hint, advise, similar experience etc would be more than
    welcome.
    Basically, my company has created a complex database system for acquisition
    and management of reference stock market data and the process has several
    phases (this is my understanding of it): acquire the data from
    e.g. Bloomberg in their native format, transforms it in some universal
    format and then use that format to load it into a database where it can be
    analysed, processed etc using more or less (in house developed) standard
    SQL with calendar extensions (e.g every Friday, last Monday in month etc
    etc). There are several processes (servers) involved: data server,
    scheduler, database server etc etc.
    Now, when we have installed the product at one of our customers (running
    E6500 with 24CPUs and 20GB of RAM, all that on Solaris 8 --I think), our
    product was given a two hours window every day to do a certain amount of
    work and to process several GBs of data (don't have the figures) and
    everything was fine, since we were able to finish that in 90 minutes. But
    now, as the amount of data within database grows (although still within
    preallocated 80 or 100GB size -- split into 2GB files to work around (ex)
    large file problem), for the same amount of work the product in question
    needs something like 180 minutes -- which is 1 hour too much.
    My task is to try to find out where the bottleneck is and to give some
    suggestions for speeding things up. The customer claims that the
    application is I/O bound and prstat -m more or less confirms that (almost
    no CPU latency, large amount of voluntary context switches etc etc).
    How do I confirm this using dtrace? I can't run dtrace on their production
    system since it's Solaris 8 but I have set up a Solaris 10 (s10_60)
    machine that has all the components installed and will try to run similar
    kind of work there.
    Where do I start? What shall I look for? The problem is also that there is
    a lot of programs involved, a lot of IPC (shared memory, semaphores, pipes,
    sockets) and in general when the system is busy, it is quite busy.
    I guess in ideal world, we would call Sun and ask them to figure the
    problem themselves, but it is not an ideal world and the golden age of .com
    is gone :-(
    Thanks and bye, Dragan

    Where do I start? What shall I look for? The problem
    is also that there is
    a lot of programs involved, a lot of IPC (shared
    memory, semaphores, pipes,
    sockets) and in general when the system is busy, it is
    quite busy.Well, this is definitely the hard part. DTrace makes it much easier to ask questions of the system, but you're asking "what questions do I ask?" There are lots of valid ways to go about this, but I often start by by looking at how the physical resources on the system are being used: CPU, I/O, networking and so on. For starters, squeeze all of the idle out of the system: as long as there is idle in the system, you're obviously not going as fast as you could. You want to start asking questions like "why am I doing I/O?" or "why am I coming off CPU?" If you could post some mpstat/vmstat/iostat data, perhaps we could provide some more concrete directions...
    - Bryan
    Bryan Cantrill, Solaris Kernel Development. http://blogs.sun.com/bmc

  • [JS CS5.5] Complex Application, want context that current script was called from

    I'm trying to create a slightly sophisticated application that is spread across several script files.  Some functions in these files call either other.  Here is what I want to emulate:
    A.jsx
    if(mainScript=="A.jsx"){
    doA();
    function A(){}
    B.jsx
    #include A.jsx
    if(mainScript=="B.jsx"){
    doB();
    function B(){
    // some stuff
    A();
    //some more stuff
    C.jsx
    #include A.jsx
    #include B.jsx
    #include D.jsx
    main(){
    D();
    A();
    etc...
    Basically, I want a script to act differently depending on if it is the one being called or if it is being called from elsewhere. I thought I could do this pretty easily by using global variables and something like:
    if(mainScript==undefined){
    var mainScript=$.fileName;
    But global variables persist between script calls so this doesn't work. I'm a bit stuck.  Anyone know how to do this?  app.activeScript doesn't work because I am executing through the extendScript toolkit. 
    I'm vexed.

    You're definitely not wrong John, this will resolve the problem.  Sometimes, especially when doing development in a large project with lots of interlocking pieces it's convenient to be able to have some test code within each file that tests the functionality of that specific code.  Even moreso when you are new to a language, so when you think you find a better way to do something you can quicky try it out and see what happens without invoking your monolithic program.  It's not difficult to achieve this approach by splitting into two files, it just means that you have to keep twice as many file tabs open and remember which one to switch to  "Go" instead of doing it with the code you are working  on.  It seems like an extra step for no good reason.
    I do this in Java all the time, most of my complex classes have a main() method so they can be executed standalone to try out a quick snippet or test some corner cases.  Comprehensive unit testing would probably be better but the time investment is much greater plus I doubt something like that would be well supported with ExtendScript.
    Is there any different between a jsx and jsxinc file or is that just a common naming convention that you or a community of people use to differentiate files?

  • Examples of large, algorithmically complex applications

    Does anyone have an example of a large, algorithmically complex Java Application (something on the order of 250K-1M lines of code)? I'm doing a language study to see how well mature Java applications scale over the life of long projects.
    If anyone knows of any examples or could point me to someone who can, it would be appreciated.
    Thanks.

    Two ideas come to mind:
    1) OpenCyc: http://www.opencyc.com/ A java based platform derived from an attempt to breed intelligence into machines.
    2) ANY examples of neural net software you can find that are java based.
    http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=java+neural+net

  • Complex application OC4J deployment

    I need an help to deploy a "local deploy" developed application in OC4J.
    I tried to deploy in OC4J a simple BC4J application, succesfully.
    Now, this is my situation:
    I have a lot of applications which have
    1) a common set of BC4J package. This package has a single table EO, VO, and an ApplicationModule. This BC4Js have a common frame in all applications.
    2) a set of BC4J used for single applications and used in other applications as imported in BC4J projects.
    Now, deployed in local mode, I did a .jar and imported this jar in other project.
    What I have to do to make all ApplicationModule remotable?
    Do I need to change manually .jpx file to change the import location of Business component?
    After all, is better to have a lot of EAR with common jar inside, or is better to build a single EAR?

    In my test workspace I created Project1 and Project1 projects.
    In Project1, I created a package of BC4J components named package1
    I chose "Deploy Business Components..." on Project1 and selected a Simple Archive. Upon deployment, this created me two JAR files Project1CSCommon.jar and Project1CSMT.jar.
    I created a library for Project1CSMT.jar and added this library to my Project2 project's library list.
    In Project2, I created another BC4J package of components named package2
    I right-mouse "Import Business Components..." and I navigate to the Project1CSMT.jar and use the file dialog to "drill down" into the jar file just like a folder, and pick the package1.xml file. This results in importing package1 into Project2.
    I chose "Deploy Business Components..." in Project2 and select an AppModule Session Bean (BMT).
    I expand the Project2EJB.bcdeploy node in the navigator and right-mouse on the Project2EJB.deploy node to pick "Settings...".
    I click on the "Profile Dependencies" tab, and check [x] Project1MiddleTier.deploy and [x] Project1Common.deploy to make those two deployment profiles a dependency of this one.
    Then I right-mouse "Deploy" on the Project2EJB.bcdeploy node and it deploys my AppModule in Project2 as a remoteable application module. I go out to the file system and do:
    % jar tvf Project2EJB.ear
       329 Thu Jun 20 18:31:10 CEST 2002 META-INF/application.xml
      1665 Thu Jun 20 18:31:10 CEST 2002 META-INF/data-sources.xml
       286 Thu Jun 20 18:31:10 CEST 2002 META-INF/orion-application.xml
      4361 Thu Jun 20 18:31:10 CEST 2002 Project1CSCommon.jar
    13344 Thu Jun 20 18:31:10 CEST 2002 Project1CSMT.jar
    25345 Thu Jun 20 18:31:10 CEST 2002 Project2EJB.jar
      9185 Thu Jun 20 18:31:10 CEST 2002 Project2EjbCommon.jarto verify that it includes my imported JAR files into the EAR file.

  • Complex Webdynpro application architecture on JAVA WAS

    Hello,
    I am planning to develop quite complex application with Webdynpro presentation layer. I'm not so sure in j2ee technologies but I have some experience but only from quite simple applications mostly which shows some issue in j2ee programming model. I want to run my application on Java stack of WAS and underlying DB. In my DB model there is cca. 40 tables. So I'm now looking for some choice of overal architecture. I'm thinking about that there will be on bussiness layer Stateless session bean(s) which will be wrap almost all functionality and I plan to access database from bussines methods (directly or probably through some other wrapper class through openSQL/jdbc).
    My question is if can anyone advice me if this architecture is good or not. I was thinking about object persistence too (mainly JDO) but in my count of tables seems it to me as really hard work, and with entity beans I haven't so much experiences. When to use JDO and when jdbc acces ?
    Secondly I want to ask this:
    I am used to program in java in jdbc to regular database (mysql, oracle) and there I am able to create my DB tables and so on through script generated from modeling tool. Is this can be in Java Dictionary ? or I have to click my tables in Java Dictionary Perspective. And how can I set foreign key constraints in Java Dictionary Perspective ? is it posible ? or I have to check reference integrity each time I use Insert, Update, Delete commands ?
    I know this is quite many question at once, but I will be glad if anyone can answer any of that.
    Best Regards,
    Miroslav Koskar

    Miroslav,
    Your application seems to reach "critical mass" of business objects involved. If you can -- go ahead with CAF.
    Any other approach will work too -- be it either Entity EJB with session facade or JDO (directly / indirectly exposed). But...
    You'll will have to create plain JavaBeans for DTO in case of EJB... Even with JDO you'll have to track CUD operations in CRUD differently hence repeating work that CAF team already did. Next you'll have to create JavaBean models for your objects (thought, not a rocket science till time of model upgrades). Next you'll have to tweak this model to use types from data dictionary... And, again, this is provided with CAF out of the box...
    Your second question is actually minor one -- using DDIC is possible with either approach and referntial integrity will be preserved with either technology.
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • Complex webdynproJava applications with out using Models.

    Hi Experts,
    I want some sample complex webdynpro JAVA applications with out using Models.
    Thank you,
    Usha.G

    HI
    chec this link
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d
    hope you can get some complex application you need
    and check this thread
    how to create one complex project in web dynpro

  • Powerbuilder application crashes after upgrade to 12.5.2 (build 5006)

    I have already seen few similar posts on this forum for similar issue. However, I feel mine is different from those and could be some basic steps am missing. Thanks in advance for any comments.
    We are evaluating the effort and benefits of migrating our PB 10.2.1 (build 9731) application to  PB 12.5 Classic. After downloading the trial version from the SAP site, I could migrate the application easily with only a handful of warnings. However, while running the application either from build (EXE) or from IDE, it crashes (windows application failure) frequently. In addition to that, few of our application screens opens as blank screen (doesn’t display anything in the DW attached).
    My operating system is Windows 7 (32 bit) Service Pack 1. The application has many calls external DLLs (both windows standard and custom), as samples at the bottom. I believe that the correct (from PB 12.5) DLLs are copied to Powerbuilder home directory (C:\Software\Sybase\PowerBuilder 12.5 & C:\Software\Sybase\Shared\PowerBuilder) and the source code directory in my attempt to ensure that there are no issues with DLLs. However, initially I had installed powerbuilder 12.5 also under the same root as Power builder 10.0, but as I read few posts that DLLs from different version residing in same place can cause issues, uninstalled and installed PB 12.5 on different location.
    Our PB application also interact with the .Net modules of the application by communicating through a custom DLL. However, that seems still working and I am able to open the .Net screens from the migrated application.
    Below are the main scenarios in which the application crashes and every time I get a DLL error as given below.
    1. While running the application from IDE and selecting ‘Exit’ from the main window. This will close any instantiated objects and close the mutex by calling the windows API.
    function ulong CreateMutexA(ulong lpMutexAttributes, boolean bInitialOwner, ref string lpName) library "kernel32.dll" alias for "CreateMutexW" function ulong GetLastError() library "kernel32.dll" alias for "GetLastError;Ansi"
    function ulong CloseHandle(ulong hMutex) library  "kernel32.dll" alias for "CloseHandle;Ansi"
    This will result in the below crash.
    Faulting application name: PB125.EXE, version: 12.5.2.5006, time stamp: 0x50f93412
    Faulting module name: kernel32.dll, version: 6.1.7601.17932, time stamp: 0x503275b9
    Exception code: 0xc0000005 Fault offset: 0x0004c372
    Faulting process id: 0x2bdc
    Faulting application start time: 0x01cf3e72371227c9
    Faulting application path: C:\Software\Sybase\PowerBuilder 12.5\PB125.EXE
    Faulting module path: C:\Windows\system32\kernel32.dll
    Report Id: 8feef8fc-aa65-11e3-8049-f500274aecdc
    2. Opening of certain windows results in the below crash. If I try to debug the code and move mouse over the line of code being executed, then also I get the same crash. I don’t do the mouse move then I can proceed with the same line, however it will crash at a later line calling ‘classname’.
    Problem Event Name: APPCRASH
    Application Name: PB125.EXE
    Application Version: 12.5.2.5006
    Application Timestamp: 50f93412
    Fault Module Name: PBVM125.dll
    Fault Module Version: 12.5.2.5006
    Fault Module Timestamp: 50f93437
    Exception Code: c0000005
    Exception Offset: 00175357
    OS Version: 6.1.7601.2.1.0.256.48
    Locale ID: 3081
    Additional Information 1: 38ca
    Additional Information 2: 38ca6ad0537dbd0555785bd862b8e94f
    Additional Information 3: 0cd5
    Additional Information 4: 0cd54a5b6672f15bf2ca366539d89c12
    3. Few of the application screen opens but doesn’t display the datawindow attached to it.

    ... many calls external DLLs (both windows standard and custom),
    You have a very complex application and it is unlikely that you will receive much help in this type of setting.  As Chris has already pointed out, previous efforts appear to have been done in a sloppy manner; something indicated by the ANSI qualifiers on API functions that are not needed or relevant.  In addition, the PB alias of CreateMutexA for the API function CreateMutexW is also suggestive.
    I believe that the correct (from PB 12.5) DLLs are copied to Powerbuilder home directory (C:\Software\Sybase\PowerBuilder 12.5 & C:\Software\Sybase\Shared\PowerBuilder)
    You should be very very careful about doing things like this.  One should not simply scatter DLLs across directories without very good reasons as it often leads to strange problems.  On a machine with the IDE installed, you should allow PB to install everything where it wants them.  Copying or moving files is something done as a last resort - it is certainly something that you need to document in case you need to undo it or redo it at a later time.
    Lastly, you might reconsider attempting this with the trial version.  I don't how "current" the trial version is but I suspect it might be a bit buggier than the most current maintenance build.  I'm guessing that you will have to do a bit more than recompiling to get the functionality related to "opening .Net screens" working.  It might help to try creating a new application and put in some basic functionality to interact with all of these external processes, screens, dlls, etc since I suspect this is where the bulk of your problems exist.

  • Javax.xml.ws.soap.SOAPFaultException - complex type soap response

    Hi folks,
    got a - hopefully simple to answer - question about soap and webservices.
    first, the environment setup: Mac OS X 10.4.8, Java EE 5, Annotations, Hibernate, Sun Java System Application Server 9.
    second, the scenario: I have an enterprise application that consists of a WAR-archive (holding the webbased admin access to my application) and a EJB-Jar-archive inside. The latter one does define some Enterprise Java Beans (stateless SessionBeans), which are also annotated as being fully accessable Web-Services. A standalone client then should be able to access the application by calling these webservices. By deploying this EAR to the Sun Server, all WSDLs and webservices.xml are created dynamically.
    third, the problem: When testing the single webservice methods through the Sun Server admin interface test-page, only these methods work, which receive a simple type parameter and also return a simple type parameter (e.g. long, int, ..). When invoking a method to return a non-simple type (i.e. a self defined java object "jobOrder" holding ints, longs, Sets, etc..), i get the following error:
    on the webserver side:
    javax.servlet.ServletException: java.lang.reflect.InvocationTargetException at
    com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.doPost(WebServiceTesterServlet.java:311) at
    com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:106) at
    com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:102) at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at
    com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:101) at
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566) at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536) at
    com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:71) at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182) at
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566) at
    com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120) at
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137) at
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566) at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536) at
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) at
    org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239) at
    com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667) at
    com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574) at
    com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844) at
    com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287) at
    com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212) at
    com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252) at
    com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
    Caused by: 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:585) at
    com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.doPost(WebServiceTesterServlet.java:284) ... 23 more
    Caused by: javax.xml.ws.soap.SOAPFaultException: JTA transaction begin failed at com.sun.xml.ws.encoding.soap.ClientEncoderDecoder.toMessageInfo(ClientEncoderDecoder.java:86) at
    com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toMessageInfo(SOAPXMLDecoder.java:211) at
    com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:540) at
    com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:260) at
    com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.send(SOAPMessageDispatcher.java:139) at
    com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.java:86) at
    com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:174) at
    com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:108) at
    $Proxy105.findReparationOrderById(Unknown Source) ...in the Sun AppServer log file:
    Error in encoding SOAP Message
         at com.sun.xml.ws.encoding.soap.server.SOAPXMLEncoder.toSOAPMessage(SOAPXMLEncoder.java:115)
         at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.makeSOAPMessage(SOAPMessageDispatcher.java:352)
         at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:157)
         at com.sun.xml.ws.server.Tie.handle(Tie.java:90)
         at com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:160)
         at com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:89)
         at com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:186)
         at com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:117)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:101)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:71)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
         at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
         at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
         at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
         at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
    Caused by: javax.xml.bind.MarshalException
    [...]four, the question: is it generally only possible to pass and receive simple data types through soap? if so, what to do with more complex application-integrated data structures or even Lists? The generated *.xsd files which XML-define the structure of the given "jobOrder" object seem to be correct. Or is it just a completely different root cause ?
    any other suggestions, work-arounds, technologies to use or hints ?
    thanks in advance
    andre from berlin
    Message was edited by:
    derandre

    Hi folks,
    got a - hopefully simple to answer - question about soap and webservices.
    first, the environment setup: Mac OS X 10.4.8, Java EE 5, Annotations, Hibernate, Sun Java System Application Server 9.
    second, the scenario: I have an enterprise application that consists of a WAR-archive (holding the webbased admin access to my application) and a EJB-Jar-archive inside. The latter one does define some Enterprise Java Beans (stateless SessionBeans), which are also annotated as being fully accessable Web-Services. A standalone client then should be able to access the application by calling these webservices. By deploying this EAR to the Sun Server, all WSDLs and webservices.xml are created dynamically.
    third, the problem: When testing the single webservice methods through the Sun Server admin interface test-page, only these methods work, which receive a simple type parameter and also return a simple type parameter (e.g. long, int, ..). When invoking a method to return a non-simple type (i.e. a self defined java object "jobOrder" holding ints, longs, Sets, etc..), i get the following error:
    on the webserver side:
    javax.servlet.ServletException: java.lang.reflect.InvocationTargetException at
    com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.doPost(WebServiceTesterServlet.java:311) at
    com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.invoke(WebServiceTesterServlet.java:106) at
    com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:102) at
    javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at
    com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:101) at
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566) at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536) at
    com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:71) at
    org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182) at
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566) at
    com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120) at
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) at
    org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137) at
    org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566) at
    org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536) at
    org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939) at
    org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239) at
    com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667) at
    com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574) at
    com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844) at
    com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287) at
    com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212) at
    com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252) at
    com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
    Caused by: 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:585) at
    com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.doPost(WebServiceTesterServlet.java:284) ... 23 more
    Caused by: javax.xml.ws.soap.SOAPFaultException: JTA transaction begin failed at com.sun.xml.ws.encoding.soap.ClientEncoderDecoder.toMessageInfo(ClientEncoderDecoder.java:86) at
    com.sun.xml.ws.encoding.soap.client.SOAPXMLDecoder.toMessageInfo(SOAPXMLDecoder.java:211) at
    com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:540) at
    com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:260) at
    com.sun.xml.ws.protocol.soap.client.SOAPMessageDispatcher.send(SOAPMessageDispatcher.java:139) at
    com.sun.xml.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.java:86) at
    com.sun.xml.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:174) at
    com.sun.xml.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:108) at
    $Proxy105.findReparationOrderById(Unknown Source) ...in the Sun AppServer log file:
    Error in encoding SOAP Message
         at com.sun.xml.ws.encoding.soap.server.SOAPXMLEncoder.toSOAPMessage(SOAPXMLEncoder.java:115)
         at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.makeSOAPMessage(SOAPMessageDispatcher.java:352)
         at com.sun.xml.ws.protocol.soap.server.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:157)
         at com.sun.xml.ws.server.Tie.handle(Tie.java:90)
         at com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:160)
         at com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:89)
         at com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:186)
         at com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:117)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:101)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:71)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
         at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
         at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
         at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
         at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
    Caused by: javax.xml.bind.MarshalException
    [...]four, the question: is it generally only possible to pass and receive simple data types through soap? if so, what to do with more complex application-integrated data structures or even Lists? The generated *.xsd files which XML-define the structure of the given "jobOrder" object seem to be correct. Or is it just a completely different root cause ?
    any other suggestions, work-arounds, technologies to use or hints ?
    thanks in advance
    andre from berlin
    Message was edited by:
    derandre

  • Importing LCA applications issues

    Hello everybody.
    In the last few days I've been working with the LCES2 Linux virtual appliance made available by Adobe and I tried to import a fairly complex application developed with LCES 8.2.1.
    I stumbled across a few issues I'd like to share with you.
    The LCA archive was created with LCES WorkBench and I had no issues with previous versions of LCES; in LCES2, I had to import it using adminui [LiveCycle Archives (8.x)] and then, using LCES2 WB, I had to create a new application and import Processes and Resources from the server.
    Once the operation completed, I noticed the following:
    1) FTP Exceptions are not handled
    I had a couple of FTP "Get to filesystem" and "Put" operations whose "FTPConnectionException" was not handled and caused a LCES exception; as a workaround, I had to remove the exception and "re-draw" it as to point again to the handling block (and it worked).
    2) SubProcess renaming
    The main process had a subprocess named "PDF/A Operations" which, once imported into LCES2 WorkBench, was renamed (in the [Applications] view) as "A Operations". This seems to be a cosmetic issue since I did not have to change the invoking block as to reflect the change of the name.
    3) Accented characters
    In both a "Send with Document" email operation or in a simple assignment (Setvalue/Execute) I had an expression which contained accented characters (eg, à or è); I had to edit the message/assignment as to retype the offending characters (which got depicted as []) as to let LCES2 handle them as expected). The same went for the GeneratePDFOutput which suffered from the same "disease"
    4) Missing Font
    Since the original project was developed on a Windows 2003 server, I had to change a couple of fonts (namely, the "Times New Roman" one) in a form since this font does not exist under Linux by default (and I did not want to spend a lot of time by importing the missing fonts into the Linux box)
    5) Import issue
    I had a process who got incorrectly imported into the new LCES2 environment; by "incorrectly imported" I mean there are some operations (which existed in the LCES 8.2 one) which have not been imported into LCES2. I've still to fix it but I think a simple XML export from LCES WB + Import *might* fix it.
    If you have suggestions/opinions, please let me know.
    Have a nice Xmas time.
    Rob

    In the Region Inspector on the left of your Arrange you find a little box labeled "follow tempo" - if you untick that box the Audio will play at the original speed.

  • How to build complex object to be sent to a RESTful web service?

    Hi,
    I'm working with RESTful web services on J2EE 1.6.
    I create the database, generate the entities and generate the web services.
    I must implement Javascript clients and I don't want to use any open source for that.
    I have a simple example that works just fine. For the database :
    CREATE TABLE Shopper(
    shopperId MEDIUMINT AUTO_INCREMENT PRIMARY KEY,
    firstName VARCHAR(40),
    lastName VARCHAR(40),
    phone VARCHAR(40),
    email VARCHAR(50) NOT NULL,
    receiveEmailNotification ENUM('Y', 'N'),
    index(email)
    I create this xml information with javascript :
    *<shopper>*
    *<email>c</email>*
    *<firstName>c</firstName>*
    *<lastName>c</lastName>*
    *<phone>c</phone>*
    *<receiveEmailNotification>Y</receiveEmailNotification>*
    *</shopper>*
    and it is saved in the database. I have a more complex application with relationships between entites. For this database :
    CREATE TABLE Shopper(
    shopperId MEDIUMINT AUTO_INCREMENT PRIMARY KEY,
    firstName VARCHAR(40),
    lastName VARCHAR(40),
    phone VARCHAR(40),
    email VARCHAR(50) NOT NULL,
    receiveEmailNotification ENUM('Y', 'N'),
    index(email)
    CREATE TABLE Address(
    addressId MEDIUMINT AUTO_INCREMENT PRIMARY KEY,
    street VARCHAR(60),
    streetNo VARCHAR(20),
    postalCode VARCHAR(30),
    city VARCHAR(40),
    country VARCHAR(40),
    otherInfo TEXT,
    shopperId MEDIUMINT NOT NULL,
    foreign key (shopperId) REFERENCES  shopper(shopperId) ON DELETE CASCADE,
    index(shopperId)
    I was expecting that xml information sent from the browser should be:
    *<address>*
    *<city>c</city>*
    *<country>c</country>*
    *<otherInfo>c</otherInfo>*
    *<postalCode>c</postalCode>*
    *<street>c</street>*
    *<streetNo>c</streetNo>*
    *<shopper>*
    *<email>c</email>*
    *<firstName>c</firstName>*
    *<lastName>c</lastName>*
    *<phone>c</phone>*
    *<receiveEmailNotification>Y</receiveEmailNotification>*
    *</shopper>*
    *</address>*
    but I keep on getting errors.
    I want to send one XML structure that will be stored in two tables according to the foreign key relation.
    Does the RESTful web services code generated by Netbeans or Eclipse support this?
    Is my XML structure not built correctly?

    Kevin,
    My object base class is Abstract and class I am using in Flex 3 is class inheriting abstract class. But when calling webservice Flex creating soap message of base class and I am getting error in .Net web services that "Can not create instance of Abstract class".
    Below is the soap message difference calling same WCF method from .Net and Flex. For example Constraint is the base class and JobConstraint is the class which inherit Constraint class. But flex send message forming only Constraint while .Net soap is specifying i:type="JobConstraint".
    Part of soap message Calling from .Net 

    Constraints>< 
    Constraint i:type="JobConstraint"><Position 
    >true</Position>< 
    Rank>2</Rank>< 
    Requirement>true</Requirement></ 
    Constraint></ 
    Constraints> 
    Part of Soap message calling from Flex 3
    <ns0:Constraints>
    <ns0:Constraint>
    <ns0:Position>true</ns0:Position>
    <ns0:Rank>2</ns0:Rank>
    <ns0:Requirement>true</ns0:Requirement>
    </ns0:Constraint>
    </ns0:Constraints>

  • Thread problem in JavaNIO client server application

    **Dear experts,**
    I have problem with server which is nonblocking nio server, after registering one client the server is not registering other clients can some body told me, what is going on why sever is not showing any activity*
    this is Tour proxy class which is at client site and dealing with server and updating GUI on client site:*
    public void run() {
              connect(host);
              running = true;
              while (running) {
                   readIncomingMessages();
                   // nap for a bit
                   try {
                        Thread.sleep(50);
                   catch (InterruptedException ie) {
         } this is GUI which is dealing with Tourproxy
    class WrapNetTour3D
    void createSceneGraph(String userName, String tourFnm,
                                                 double xPosn, double zPosn)
      // initialize the scene
        sceneBG = new BranchGroup();
        bounds = new BoundingSphere(new Point3d(0,0,0), BOUNDSIZE);
        // to allow clients to be added/removed from the world at run time
        sceneBG.setCapability(Group.ALLOW_CHILDREN_READ);
        sceneBG.setCapability(Group.ALLOW_CHILDREN_WRITE);
        sceneBG.setCapability(Group.ALLOW_CHILDREN_EXTEND);
        lightScene();         // add the lights
        addBackground();      // add the sky
        sceneBG.addChild( new CheckerFloor().getBG() );  // add the floor
        makeScenery(tourFnm);      // add scenery and obstacles
        TP = new TourProxy("localhost",this,obs);
        makeContact();     // contact server (after Obstacles object created)
        addTourist(userName, xPosn, zPosn);     
                                // add the user-controlled 3D sprite
        sceneBG.compile();   // fix the scene
      } // end of createSceneGraph()
    private void makeContact()
      /* Contact the server, and set up a TourProxy to monitor the
         server. */
        try {
               TP.start();
        catch(Exception e)
        { System.out.println("No contact with server");
          System.exit(0);
      }  // end of makeContact()
    ....} this is class which is initializing the above class WrapNetTour3D:
      public NetTour3D(String args[])
        super("3D NetTour");
        processArgs(args);
        setTitle( getTitle() + " for " + userName);
        Container c = getContentPane();
        c.setLayout( new BorderLayout() );
        w3d = new WrapNetTour3D(userName, tourFnm, xPosn, zPosn);
        c.add(w3d, BorderLayout.CENTER);
         addWindowListener( new WindowAdapter() {
           public void windowClosing(WindowEvent e)
           { w3d.closeLink(); }
        pack();
        setResizable(false);    // fixed size display
        setVisible(true);
      } // end of NetTour3D() and this is server:
    public NIOTourServer( String string, int port) throws IOException {
              this.addr = string;
              this.port = port;
              writeBuffer = ByteBuffer.allocateDirect(BUFFER_SIZE);
              dataMap = new HashMap<SocketChannel, List<byte[]>>();
              clients = new LinkedList();
              userName = "?";
              startServer();
         private void startServer() throws IOException {
              // create selector and channel
              this.selector = Selector.open();
              ServerSocketChannel serverChannel = ServerSocketChannel.open();
              serverChannel.configureBlocking(false);
              // bind to port
              InetSocketAddress listenAddr = new InetSocketAddress(this.addr,
                        this.port);
              serverChannel.socket().bind(listenAddr);
              serverChannel.register(this.selector, SelectionKey.OP_ACCEPT);
              log("Echo server ready. Ctrl-C to stop.");
              // processing
              while (true) {
                   // wait for events
                   this.selector.select();
                   // wakeup to work on selected keys
                   Iterator keys = this.selector.selectedKeys().iterator();
                   while (keys.hasNext()) {
                        SelectionKey key = (SelectionKey) keys.next();
                        // this is necessary to prevent the same key from coming up
                        // again the next time around.
                        keys.remove();
                        if (!key.isValid()) {
                             continue;
                        if (key.isAcceptable()) {
                             this.accept(key);
                        } else if (key.isReadable()) {
                             this.read(key);
                        } else if (key.isWritable()) {
                             //this.write(key);
         private void accept(SelectionKey key) throws IOException {
              ServerSocketChannel serverChannel = (ServerSocketChannel) key.channel();
              SocketChannel channel = serverChannel.accept();
              clients.add(channel);
              log.info("got connection from: " + channel.socket().getInetAddress());
              channel.configureBlocking(false);
              // write welcome message
              channel.write(ByteBuffer.wrap("Welcome, this is the Tour server\r\n"
                        .getBytes("US-ASCII")));
              Socket socket = channel.socket();
              SocketAddress remoteAddr = socket.getRemoteSocketAddress();
              log.info("Connected to: " + remoteAddr);
              // register channel with selector for further IO
              dataMap.put(channel, new ArrayList<byte[]>());
              channel.register(this.selector, SelectionKey.OP_READ);
         private void sendMessage(SocketChannel channel, String mesg) {
              prepWriteBuffer(mesg);
              channelWrite(channel, writeBuffer);
         private void read(SelectionKey key) throws IOException {
              try {
                   SocketChannel channel = (SocketChannel) key.channel();
                   ByteBuffer buffer = ByteBuffer.allocate(4192);
                   int numRead = -1;
                   // read from the channel into our buffer
                   numRead = channel.read(buffer);
                   // check for end-of-stream
                   if (numRead == -1) {
                        log.info("disconnect: " + channel.socket().getInetAddress()
                                  + ", end-of-stream");
                        channel.close();
                        clients.remove(channel);
                        sendBroadcastMessage("logout: "
                                  + channel.socket().getInetAddress(), channel);
                   } else {
                        byte[] data = new byte[numRead];
                        System.arraycopy(buffer.array(), 0, data, 0, numRead);
                        String dataReturn = new String(data, "US-ASCII");
                        log("Got: " + dataReturn);
                        processClient(dataReturn,channel);
              } catch (IOException ioe) {
                   log.warn("error during select(): ", ioe);
              } catch (Exception e) {
                   log.error("exception in run()", e);
         private void processClient(String line,SocketChannel from)
         /* Stop when the input stream closes (is null) or "bye" is sent
               Otherwise pass the input to doRequest(). */
              //String line;
              boolean done = false;
              while (!done) {
                   // if((line = in.readLine()) == null)
                   if(line == null)
                        done = true;
                   else {
                        // System.out.println(userName + " received msg: " + line);
                        if (line.trim().equals("bye"))
                             done = true;
                        else
                             doRequest(line.trim(), from);
         }  // end of processClient()
    ...} i thought there is some problem with threads
    can somebody tell me how can i deal with it, as i m new newbie and how could i avoid problems in such design and complex application so that i am able to complete this application
    please help,
    thanks a lot
    jibbylala
    Edited by: 805185 on Nov 23, 2010 10:43 AM
    Edited by: 805185 on Nov 23, 2010 11:36 AM

    ejp:Here you are assuming that the socket is readable. Check it. You also need to check for isConnectable(), and if true, try finishConnect(), and if that succeeds deregister OP_CONNECT and register OP_READ.
    where i do this or it should be  done in connect method() or in readIncomingMessages() .
    the current problem is connecting 2nd client.
    i thought the other steps came later
    i changed the connect method like this :
    private void connect(String hostname) {
              try {
                   InetAddress addr = InetAddress.getByName(hostname);
                   int mnInterestOps = 0;
                   try
                        channel = SocketChannel.open();
                        channel.configureBlocking(false);
                        InetSocketAddress mxRemoteAddress = new InetSocketAddress(addr, PORT);
                        boolean t_connect = channel.connect(mxRemoteAddress);
                        if (t_connect)
                             System.out.println("connected");
                             mnInterestOps = SelectionKey.OP_WRITE | SelectionKey.OP_READ ;
                        else
                             mnInterestOps = SelectionKey.OP_CONNECT;
                        //create the selector
                        readSelector= SelectorProviderImpl.provider().openSelector();
                        //register the channel with the selector indicating an interest
                        SelectionKey x_key = channel.register(readSelector, mnInterestOps);
                        //select loop
                        while(true)
                             //block until connect response is received
                             int selectReturn = readSelector.select(0);
                             if (selectReturn == 0)
                                  System.out.println("select returned 0");
                             Set myKeys = readSelector.selectedKeys();
                             if (!myKeys.isEmpty())
                                  Iterator x_readyKeysIterator = myKeys.iterator();
                                  // Iterate over the set of keys for which events are available
                                  while (x_readyKeysIterator.hasNext())
                                       SelectionKey x_selectionKey = (SelectionKey) x_readyKeysIterator.next();
                                       // Remove selected key
                                       x_readyKeysIterator.remove();
                                       if (x_selectionKey.isValid())
                                            if (x_selectionKey.isConnectable()) {
                                                 channel.finishConnect();
                                                 System.out.println("connection 2 accepted");
                                            else if (x_selectionKey.isWritable()) {
                                                 System.out.println("writable channel, select return =" + selectReturn);
                                                 x_selectionKey.cancel();
                                            else if (x_selectionKey.isReadable()) {
                                                 System.out.println("readable channel" + selectReturn);
                                       else
                                            //cancel the channel registration with this selector
                                            x_selectionKey.cancel();
                                            System.out.println("key not valid");
                        } //end while(true)
                   } //end try block
                   catch (Exception ex)
                        System.out.println("exception " + ex);
              catch (UnknownHostException uhe) {
                   uhe.printStackTrace();
              catch (Exception e) {e.printStackTrace();
         } but now i m getting NPE HERE in tourproxy class.
    this is method which is calling channelWrite() and this method sendMessage()  i m calling from different other gui classes and i don't think so that i need  to pass the channel from there:
    void sendMessage(String mesg) {
              prepWriteBuffer(mesg);
              channelWrite(channel, writeBuffer);
    private void channelWrite(SocketChannel channel, ByteBuffer writeBuffer) {
    nbytes += channel.write(writeBuffer); *//channel is null here*
    } *can you just  tell me why it is null as i m populating it in connect method or what should i do?
    PS: i already created chat application with javaNIO....
    The output of this application  is nothing but a sprite which has to move simultaneously on two clients but it is not because server can't register more than one client.

Maybe you are looking for

  • Security in Lion 10.7.3?

    My first line of security with my desktop Mac Pro is to force password entry after screen saver activation or sleep. This has been a nightmare to get working! Finally, after deleting preference files, changing preference settings, quitting preference

  • Saving iPhoto library

    I am preparing to wipe my hard disk and do a clean install of Tiger. However, I want to save my iPhoto library, *keeping all of the albums and metadata intact*. How do I do that?

  • Can't find Retail & Insurance

    Hi Experts, I installed SAP 6.0 ECC with industry Solotions i can find oil & gas, but i can't find retail & insurance. I even checked in Implementation guide also but i can't find. so can any body send me how to check and configure retail & insurance

  • Iphoto opens but will not display photos, just spins

    nto sure what happened, opened iphoto and it opens fine, but the processing circle just spins.  I shut the program and the computer down to not resolve.  its not the color wheel but the other one.

  • Draw lines in AdvancedDataGrid header

    Hi all,               I want to draw a vertical line in AdvancedDataGrid column header.               Can any one bring me in to that way. Thanks in advance