Java EE Tutorial - problem with the example Bookstore

Hi,
I've been working few days on a problem running the Bookstore example from the Java EE Tutorial. When I run the application, I'm redirected from the servlet BookStoreServlet to errorpage.html with the following message: The application is unavailable. Please try later. The tutorial troubleshooting reads: ... a servlet can’t retrieve the web context attribute representing the bookstore. This will occur if the database server hasn’t been started. But the database server is running (I'm running Derby bundled into NetBeans 6.5). The Glassfish admin console reads:
StandardWrapperValve[BookStoreServlet]: PWC1406: Servlet.service() for servlet BookStoreServlet threw exception
com.sun.bookstore.exception.BookNotFoundException: Couldn't find book: 203
        at com.sun.bookstore1.database.BookDBAO.getBook(BookDBAO.java:58)
        at com.sun.bookstore1.servlets.BookStoreServlet.doGet(BookStoreServlet.java:76)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:734)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:333)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        at com.sun.bookstore1.filters.HitCounterFilter.doFilter(HitCounterFilter.java:71)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:246)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:313)
        at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
        at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
        at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1096)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:288)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:647)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:579)
        at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:831)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
        at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
        at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:380)
        at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
        at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)This would indicate that the tables are empty, but they were created according to the tutorial, with the command ant create-tables, and I can see their content in NetBeans. Please help, I really need to run the examples.
Best regards,
Rene Puchinger

I solved the problem running the command that is correctly explained in the page 97 of the tutorial:
Ant create-tables
My mistake was that until that day, I was believing that I could do everything inside Netbeans.
For this you explicitly need to use ant.
Then I got some error which I solved fixing the file
C:\Java\JavaEETutorial5\examples\bp-project\ build.properties
( like set correctly the path to the server and so on)

Similar Messages

  • Problems with the examples in NWDS

    Hi All,
    Running the Welcome example project in NWDS i  have the included error.
    I have problems with other examples too.
    I did all the step by step tutorials.
    I have NWDS 2.0.3
             J2EE 6.40 SP15
             EP 2004
    I am new in NWDS and i have not still successed to run any application.
    What is wrong with my systems?
    I did all the configurations start J2EE /sdm etc.
    Do i have to install other versions? I read that maybe i have to install the same SP 15.
    Please if anybody can help me .
    Thanks,
    Ari 
    Error Summary
    While processing the current request, an exception occured which could not be handled by the application or the framework.
    If the information contained on this page doesn't help you to find and correct the cause of the problem, please contact your system administrator. To facilitate analysis of the problem, keep a copy of this error page. Hint: Most browsers allow to select all content, copy it and then paste it into an empty document (e.g. email or simple text file).
    Root Cause
    The initial exception that caused the request to fail, was:
    com.sap.tc.webdynpro.services.sal.deployment.api.WDClassLoaderException: Classloader of 'local/Welcome' is null, even though application is started.
    at com.sap.tc.webdynpro.serverimpl.wdc.deployment.DeployableObject.getClassLoader(DeployableObject.java:81)
    at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:588)
    at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)
    at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:248)
    at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)
    ... 18 more
    Ari

    Thank you for your help,
    I have NWDS 2.0.3 and Web AS 6.40 SP15 and EP 04.
    How can i be sure if  are compatible? Maybe i have to install NWDS SP15?
    I did "Rebuild" and then  "Deploy new archive and run" Deploying i was asking for the sdm password  , then the application opened in a new browser and we can see this message below.
    The Deploy Output View is empty. There is no eny successful deploy message.
    I appreciate your help.
    Thanks,
    Ari
    500   Internal Server Error
      Web Dynpro Container/SAP J2EE Engine/6.40 
    Failed to process request. Please contact your system administrator.
    [Details...]
    Error Summary
    While processing the current request, an exception occured which could not be handled by the application or the framework.
    If the information contained on this page doesn't help you to find and correct the cause of the problem, please contact your system administrator. To facilitate analysis of the problem, keep a copy of this error page. Hint: Most browsers allow to select all content, copy it and then paste it into an empty document (e.g. email or simple text file).
    Root Cause
    The initial exception that caused the request to fail, was:
       java.lang.InstantiationError: com.sap.tc.webdynpro.progmodel.context.NodeInfo
        at com.sap.examples.welcome.wdp.InternalWelcomeComponent.<init>(InternalWelcomeComponent.java:41)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        ... 27 more
    See full exception chain for details.
    Correction Hints
    The currently executed application, or one of the components it depends on, has been compiled against class file versions that are different from the ones that are available at runtime.
    If the exception message indicates, that the modified class is part of the Web Dynpro Runtime (package com.sap.tc.webdynpro.*) then the running Web Dynpro Runtime is of a version that is not compatible with the Web Dynpro Designtime (Developer Studio or Component Build Server) which has been used to build + compile the application.
    Note: the above hints are only a guess. They are automatically derived from the exception that occurred and therefore can't be guaranteed to address the original problem in all cases.
    System Environment
    Client
    Web Dynpro Client Type HTML Client
    User agent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
    Version 
    DOM version 
    Client Type msie6
    Client Type Profile ie6
    ActiveX enabled
    Cookies enabled
    Frames enabled
    Java Applets enabled
    JavaScript enabled
    Tables enabled
    VB Script enabled
    Server
    Web Dynpro Runtime Vendor: SAP, Build ID: 6.4015.00.0000.20051123162612.0000 (release=630_VAL_REL, buildtime=2005-12-14:21:51:22[UTC], changelist=377533, host=PWDFM026)
    J2EE Engine No information available
    Java VM Java HotSpot(TM) Server VM, version:1.4.2_07-b05, vendor: Sun Microsystems Inc.
    Operating system Windows 2003, version: 5.2, architecture: x86
    Other
    Session Locale en_US
    Time of Failure Fri Jan 26 14:29:31 EET 2007 (Java Time: 1169814571353)
    Web Dynpro Code Generation Infos
    local/Welcome
    No information available
    sap.com/tcwddispwda
    No information available
    sap.com/tcwdcorecomp
    No information available
    Detailed Error Information
    Detailed Exception Chain
    com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to create delegate for component com.sap.examples.welcome.WelcomeComponent. (Hint: Is the corresponding DC deployed correctly? Does the DC contain the component?)
         at com.sap.tc.webdynpro.progmodel.generation.ControllerHelper.createDelegate(ControllerHelper.java:110)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingComponent.<init>(DelegatingComponent.java:38)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.doInit(ClientComponent.java:776)
         at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.init(ClientComponent.java:330)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:370)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:608)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)
         at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:248)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:48)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
         at com.sap.tc.webdynpro.progmodel.generation.ControllerHelper.createDelegate(ControllerHelper.java:74)
         ... 26 more
    Caused by: java.lang.InstantiationError: com.sap.tc.webdynpro.progmodel.context.NodeInfo
         at com.sap.examples.welcome.wdp.InternalWelcomeComponent.<init>(InternalWelcomeComponent.java:41)
         ... 31 more

  • Java EE tutorial, problem with ANT populating database

    Hi!
    I have followed the instructions in the Java EE tutorial to set up the enviroment but when I execute the command "ant create tables" I get this output:
    C:\javaeetutorial5\examples\web\bookstore1>ant create-tables
    Buildfile: build.xml
    -pre-init:
    init:
    check:
    tools:
    start-db:
    BUILD FAILED
    C:\javaeetutorial5\examples\bp-project\app-server-ant.xml:140: The directory you specified does not existI have changed in the build.properties file to this:
    # The SDK's default installation on Windows is c:/Sun/SDK
    # The Application Server's default installation on Windows is
    # c:/Sun/AppServer
    javaee.home=C:\Sun\SDK
    javaee.tutorial.home=C:\javaeetutorial5
    # machine name (or the IP address) where the applications will be deployed.
    javaee.server.name=localhost
    # port number where the app-server is accessed by the users
    javaee.server.port=8080
    # port number where the admin server of the app-server is available
    javaee.adminserver.port=4848
    # Uncomment the property j2ee.server.username,
    # and replace the administrator username of the app-server
    javaee.server.username=admin
    # Uncomment the property j2ee.server.passwordfile,
    # and replace the following line to point to a file that
    # contains the admin password for your app-server.
    # The file should contain the password in the following line:
    # AS_ADMIN_PASSWORD=adminadmin
    # Notice that the password is adminadmin since this is
    # the default password used by the glassfish app-server installation.
    javaee.server.passwordfile=${javaee.tutorial.home}\examples\common\admin-passwo rd.txt
    appserver.instance=server
    # Uncomment and set this property to the location of the browser you
    # choose to launch when an application is deployed.
    # On Windows and Mac OS X the default browser is used.
    #default.browser=\Applications\Firefox.app\Contents\MacOS\firefox-bin
    # Database vendor property for db tasks
    db.vendor=javadb
    # Digital certificate properties for mutual authentication
    keystore=${javaee.tutorial.home}\examples\jaxws\simpleclient-cert\support\clien t_keystore.jks
    truststore=${javaee.home}\domains\domain1\config\cacerts.jks
    keystore.password=changeit
    truststore.password=changeitAny idea which directory the error refers to?
    I�m using Netbeans 5.5 and have a connection to my local mysql database.

    Ok, this is the build.xml from bookstore1:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- You may freely edit this file. See commented blocks below for -->
    <!-- some examples of how to customize the build. -->
    <!-- (If you delete it and reopen the project it will be recreated.) -->
    <project name="bookstore1" default="default" basedir=".">
        <description>Builds, tests, and runs the project bookstore1.</description>
        <property name="is.war.module" value="true" />
        <property name="uses.db.sql.file" value="true"/>
        <path id="common.jars">
            <filelist dir="../bookstore" files="build.xml"/>
        </path>
        <macrodef name="iterate">
            <attribute name="target"/>
            <sequential>
                <subant target="@{target}" failonerror="false">
                    <buildpath refid="common.jars"/>
                </subant>
            </sequential>
        </macrodef>
        <import file="../../bp-project/main.xml" />
        <target name="-pre-deploy" unless="netbeans.home">
            <antcall target="create-tables"/>
        </target>
        <target name="-pre-compile" unless="netbeans.home" depends="init,build-common,copy-common-jars"/>
        <target name="build-common" unless="netbeans.home" depends="init">
            <iterate target="default"/>
        </target>
        <target name="copy-common-jars" unless="netbeans.home" depends="init">
            <mkdir dir="${build.web.dir}/WEB-INF/lib"/>
            <copy file="${reference.bookstore.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
        </target>
    </project>And the build.xml in bookstore looks like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- You may freely edit this file. See commented blocks below for -->
    <!-- some examples of how to customize the build. -->
    <!-- (If you delete it and reopen the project it will be recreated.) -->
    <project name="bookstore1" default="default" basedir=".">
        <description>Builds, tests, and runs the project bookstore1.</description>
        <property name="is.war.module" value="true" />
        <property name="uses.db.sql.file" value="true"/>
        <path id="common.jars">
            <filelist dir="../bookstore" files="build.xml"/>
        </path>
        <macrodef name="iterate">
            <attribute name="target"/>
            <sequential>
                <subant target="@{target}" failonerror="false">
                    <buildpath refid="common.jars"/>
                </subant>
            </sequential>
        </macrodef>
        <import file="../../bp-project/main.xml" />
        <target name="-pre-deploy" unless="netbeans.home">
            <antcall target="create-tables"/>
        </target>
        <target name="-pre-compile" unless="netbeans.home" depends="init,build-common,copy-common-jars"/>
        <target name="build-common" unless="netbeans.home" depends="init">
            <iterate target="default"/>
        </target>
        <target name="copy-common-jars" unless="netbeans.home" depends="init">
            <mkdir dir="${build.web.dir}/WEB-INF/lib"/>
            <copy file="${reference.bookstore.jar}" todir="${build.web.dir}/WEB-INF/lib"/>
        </target>
    </project>And the main.xml in \bp-projects looks like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.  You may not modify, use, reproduce, or distribute this software except in compliance with the terms of the License at:
    http://developer.sun.com/berkeley_license.html
    $Id: main.xml,v 1.2 2006/04/12 17:20:13 ie139813 Exp $ -->
    <!-- main.xml: this is the file that should be included by the project
         build files. It will figure out whether it is running from inside Netbeans
         or command line and include appropriate tasks.
         @Author: Inderjeet Singh -->
    <project name="main" default="dummy-default">
      <property file="build.properties"/>
      <property value="1.5" name="default.javac.source"/>
      <property value="1.5" name="default.javac.target"/>
      <condition property="common-ant-tasks-file"
              value="${ant.file}/../nbproject/build-impl.xml"
              else="${ant.file.main}/../command-line-ant-tasks.xml">
        <and>
        <isset property="netbeans.home"/>
        <available file="${ant.file}/../nbproject/build-impl.xml"/>
        </and>
      </condition>
      <import file="${common-ant-tasks-file}"/>
      <target name="dummy-default"/>
    </project>

  • Problem with the examples of Transmitting and Receiving Custom RTP Payloads

    I have tried the examples of this web:
    http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/solutions/CustomPayload.html
    Transmitting and Receiving Custom RTP Payloads
    I run the examples all right.
    But I want to transmit the sound using my own format, so i want to change the file PcmPacketizer.java
    and PcmDepacketizer.java
    I think the sound data is in the byte[] inData ---- {byte[] inData = (byte[])inBuf.getData();}
    so i change the data with my own function, so the inData have the diffrent length:
    then i transmit the data with the packet header
    public synchronized int process(Buffer inBuf, Buffer outBuf) {
    int inLength = inBuf.getLength();
    byte[] inData = (enbase((byte[])inBuf.getData()));
    byte[] outData = (byte[])outBuf.getData();
         if (outData == null || outData.length < PACKET_SIZE) {
         outData = new byte[PACKET_SIZE];
         outBuf.setData(outData);
         // Generate the packet header.
         int rate = (int)inFormat.getSampleRate();
         int size = (int)inFormat.getSampleSizeInBits();
         int channels = (int)inFormat.getChannels();
         outData[0] = 0;     // filler
         outData[1] = (byte)((rate >> 16) & 0xff);
         outData[2] = (byte)((rate >> 8) & 0xff);
         outData[3] = (byte)(rate & 0xff);
         outData[4] = (byte)inFormat.getSampleSizeInBits();
         outData[5] = (byte)inFormat.getChannels();
         outData[6] = (byte)inFormat.getEndian();
         outData[7] = (byte)inFormat.getSigned();
         int frameSize = inFormat.getSampleSizeInBits() * inFormat.getChannels();
         // Recompute the output format if the input format has changed.
         // The crucial info is the frame rate and size. These are used
         // to compute the actual rate the data being sent.
         if (rate != (int)outFormat.getFrameRate() ||
         frameSize != outFormat.getFrameSizeInBits()) {
              outFormat = new AudioFormat(CUSTOM_PCM,
                        AudioFormat.NOT_SPECIFIED, // rate
                        AudioFormat.NOT_SPECIFIED, // size
                        AudioFormat.NOT_SPECIFIED, // channel
                        AudioFormat.NOT_SPECIFIED, // endian
                        AudioFormat.NOT_SPECIFIED, // signed
                        size * channels,     // frame size
                        rate,               // frame rate
                        null);
    if (inLength + historyLength >= DATA_SIZE) {
         // Enough data for one packet.
                   int copyFromHistory = Math.min(historyLength, DATA_SIZE);
                   System.arraycopy(history, 0, outData, HDR_SIZE , copyFromHistory);
    int remainingBytes = DATA_SIZE - copyFromHistory;
    System.arraycopy(inData, inBuf.getOffset(),
                   outData, copyFromHistory + HDR_SIZE, remainingBytes);
    historyLength -= copyFromHistory;
    inBuf.setOffset( inBuf.getOffset() + remainingBytes);
    inBuf.setLength( inLength - remainingBytes);
         outBuf.setFormat(outFormat);
         outBuf.setLength(PACKET_SIZE);
         outBuf.setOffset(0);
    return INPUT_BUFFER_NOT_CONSUMED ;
    if (inBuf.isEOM()) { // last packet
    System.arraycopy(history, 0, outData, HDR_SIZE, historyLength);
    System.arraycopy(inData, inBuf.getOffset(),
                   outData, historyLength + HDR_SIZE, inLength);
         outBuf.setFormat(outFormat);
         outBuf.setLength(inLength + historyLength + HDR_SIZE);
         outBuf.setOffset(0);
    historyLength = 0;
    return BUFFER_PROCESSED_OK;
    // Not enough data for one packet. Save the remainder
         // for next time.
    System.arraycopy(inData, inBuf.getOffset(),
                   history, historyLength,inLength) ;
    historyLength += inLength;
    return OUTPUT_BUFFER_NOT_FILLED ;
    I think I change the data use my own function debase(), so i should decode the data in the file:PcmDepacketizer.java
    but int PcmDepacketizer.java the example is so simple that i don't know how to find and change the data.
    there is only a few lines here:
    Object outData = outBuf.getData();
         outBuf.setData(inBuf.getData());
         inBuf.setData(outData);
         outBuf.setLength(inBuf.getLength() - HDR_SIZE);
         outBuf.setOffset(inBuf.getOffset() + HDR_SIZE);
         System.out.println("the outBuf length is "+inBuf.getLength());
    I write a function : public static byte [] debase(byte[] str)
    but i don't know where can i use it.
    please tell me what should i do or where is wrong about my thought.

    the function in PcmPackettizer.java is
    public static byte[] enbase(byte [] b) {
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         //byte[] oo = new byte[(b.length + 2) / 3*4];
         //for (int i = 0; i < (b.length + 2) / 3; i++) {
         for (int i = 0; i < (b.length + 2) / 3; i++) {
              short [] s = new short[3];
              short [] t = new short[4];
              for (int j = 0; j < 3; j++) {
                   if ((i * 3 + j) < b.length)
                        s[j] = (short) (b[i*3+j] & 0xFF);
                   else
                        s[j] = -1;
              t[0] = (short) (s[0] >> 2);
              if (s[1] == -1)
                   t[1] = (short) (((s[0] & 0x3) << 4));
              else
                   t[1] = (short) (((s[0] & 0x3) << 4) + (s[1] >> 4));
              if (s[1] == -1)
                   t[2] = t[3] = 64;
              else if (s[2] == -1) {
                   t[2] = (short) (((s[1] & 0xF) << 2));
                   t[3] = 64;
              else {
                   t[2] = (short) (((s[1] & 0xF) << 2) + (s[2] >> 6));
                   t[3] = (short) (s[2] & 0x3F);
              for (int j = 0; j < 4; j++)
                   os.write(t[j]);
                   //os.write(t[j],(3*i+j),1);
                   //os.write(Base64.charAt(t[j]));
         //return new String(os.toByteArray());
         return os.toByteArray();
    just like the base64 function

  • Reading TDMS files in Matlab - problems with the example code

    I want to use the TDMS files to store data and do offline analysis in Matlab, version 2009b (either on Mac OS10.6 or Windows XP).
    To test the data import in Matlab I tried the example from http://digital.ni.com/public.nsf/allkb/0EEADA99DC7D00A4862572E30037C3A2 , but without success.
    I tried either with and without the path definition (as explained on the page I referred to before) at the start, and got back the following errors:
    with:
    ??? Error using ==> loadlibrary>deltempfiles at 559
    nilibddc_m.i.
    Error in ==> loadlibrary at 452
        deltempfiles(delfiles);
    Error in ==> Read_TDMData at 7loadlibrary([examplePath '\nilibddc'], hfile);
    without: 
    ??? Error using ==> loadlibrary>deltempfiles at 559
    nilibddc_m.i.
    Error in ==> loadlibrary at 452
        deltempfiles(delfiles);
    Error in ==> Read_TDMData at 36loadlibrary(NI_TDM_DLL_Path,NI_TDM_H_Path); 
    I found a few messages on the issue, dating from 2006 and 2007, that didn't lead to a satisfying solution and was hoping that, by now, there would be a solution to my problem.
    Thanks a lot
    Remco   
    Solved!
    Go to Solution.

    Hi Musk,
    Thanks for your answer. 
    Unfortunately it didn't help as my problem is not discussed there. I have a problem with this line:
    loadlibrary(NI_TDM_DLL_Path,NI_TDM_H_Path);
    I said before that I was using 2009b, but I was mistaken, I have R2008a, but the 'loadlibrary' is opened in a 2008b editor (no idea why). On the Mac I have 2009b installed.
    Thanks
    Remco 

  • Java system copy problems with the Java Migration Toolkit

    During the JAVA system copy, we have have got the error in second last
    step i.e;Java Migration Toolkit. We tried to do the system copy twice
    but every time we have got the below error.
    Is this a know bug? I have got the OSS note 966752 but the value
    of 'src.ci.host' is already correct. has anybody come across the similar issue. please help.
    " CJSlibModule::writeInfo_impl()
    Output of /usr/java14_64/bin/java -
    classpath /usr/sap/CMT/SYS/global/sltools/sharedlib/launcher.jar:. -Xj9
    com.sap.engine.offline.OfflineToolStart
    com.sap.sdt.jmt.migrationtool.MigrationToolImport /usr/sap/CMT/SYS/global/sltools/jmt:/usr/sap/CMT/SYS/global/sltools/sharedlib import.switch
    resume downtime mti.properties is written to the
    logfile /home/cmtadm/CI_Import_08312009/runJmt.log.
    WARNING 2009-09-01 20:49:43.473
    CJSlibModule::writeWarning_impl()
    Execution of the command "/usr/java14_64/bin/java -
    classpath /usr/sap/CMT/SYS/global/sltools/sharedlib/launcher.jar:. -Xj9
    com.sap.engine.offline.OfflineToolStart
    com.sap.sdt.jmt.migrationtool.MigrationToolImport /usr/sap/CMT/SYS/global/sltools/jmt:/usr/sap/CMT/SYS/global/sltools/sharedlib import.switch
    resume downtime mti.properties" finished with return code 27. Output:
    ERROR 2009-09-01 20:49:43.477
    CJSlibModule::writeError_impl()
    CJS-20068 Error when running the J2EE Migration Toolkit.<br>SOLUTION:
    See output of logfile /home/cmtadm/CI_Import_08312009/runJmt.log: ''.
    ERROR 2009-09-01 20:49:43.479
    CJSlibModule::writeError_impl()
    CJS-20068 Error when running the J2EE Migration Toolkit.<br>SOLUTION:
    See output of logfile /home/cmtadm/CI_Import_08312009/runJmt.log: ''.
    ERROR 2009-09-01 20:49:43.480 [iaxxgenimp.cpp:731]
    showDialog()
    FCO-00011 The step RunMigrationController with step key
    |NW_Doublestack_OneHost|ind|ind|ind|ind|0|0|NW_Onehost_System|ind|ind|ind|ind|1|0|NW_CI_Instance|ind|ind|ind|ind|11|0|NW_CI_Instance_Configure_Java|ind|ind|ind|ind|4|0|NW_RUN_MIGRATION_CONTROLLER|ind|ind|ind|ind|2|0|RunMigrationController was executed with status ERROR ."
    There is no log file by the name runJmt.log.
    Regards,
    Sagar

    This issue was resolved by OSS note 966752 itself. Below is the important line in the OSS note.
    Note: The default value is crucial! If a custom value other than the default value was applied, we highly recommend that you restore the default value.
    Thanks,
    Sagar

  • Problems with Duke's Bookstore Examples (Chapter 3 of the J2EE 1.4 Tut)

    Hi
    Please help me, I am going through the J2EE tutorial (I have the Sun App Server 8 installed on a Win XP Service Pack 2 machine) but am running into problems.
    I'm having a problem with the
    1. asant build and
    2. asant create-db_common
    commands.
    1. asant build
    ===========
    When trying to use the command asant build I get the following problems:
    D:\P.Files Ext\MJ Ext\J2EE 1.4 Tutorial EXT\j2eetutorial14\examples\web\bookstore>asant build
    Buildfile: build.xml
    D:\P.Files%20Ext\MJ%20Ext\J2EE%201.4%20Tutorial%20EXT\j2eetutorial14\examples\common\targets.xml could not be found
    D:\P.Files%20Ext\MJ%20Ext\J2EE%201.4%20Tutorial%20EXT\j2eetutorial14\examples\web\common\targets.xml could not be found
    init:
    prepare:
    build:
    [javac] Compiling 11 source files to D:\P.Files Ext\MJ Ext\J2EE 1.4 Tutorial EXT\j2eetutorial14\examples\web\booksto
    re\build
    BUILD FAILED
    file:D:/P.Files%20Ext/MJ%20Ext/J2EE%201.4%20Tutorial%20EXT/j2eetutorial14/examples/web/bookstore/build.xml:54: D:\lib not found.
    Total time: 8 seconds
    I then created an empty folder = D:\lib
    It then seemed to work?? but still could not find targets.xml as below
    D:\P.Files Ext\MJ Ext\J2EE 1.4 Tutorial EXT\j2eetutorial14\examples\web\bookstore>asant build
    Buildfile: build.xml
    D:\P.Files%20Ext\MJ%20Ext\J2EE%201.4%20Tutorial%20EXT\j2eetutorial14\examples\common\targets.xml could not be found
    D:\P.Files%20Ext\MJ%20Ext\J2EE%201.4%20Tutorial%20EXT\j2eetutorial14\examples\web\common\targets.xml could not be found
    init:
    prepare:
    build:
    [javac] Compiling 11 source files to D:\P.Files Ext\MJ Ext\J2EE 1.4 Tutorial EXT\j2eetutorial14\examples\web\bookstore\build
    BUILD SUCCESSFUL
    Total time: 18 seconds
    D:\P.Files Ext\MJ Ext\J2EE 1.4 Tutorial EXT\j2eetutorial14\examples\web\bookstore>
    2. asant create-db_common
    ======================
    When trying to use the command asant create-db_common I get the following problems (I had to create an empty folder - D:\pointbase\lib to get this far)
    D:\P.Files Ext\MJ Ext\J2EE 1.4 Tutorial EXT\j2eetutorial14\examples\web\bookstore>asant create-db_common
    Buildfile: build.xml
    D:\P.Files%20Ext\MJ%20Ext\J2EE%201.4%20Tutorial%20EXT\j2eetutorial14\examples\common\targets.xml could not be found
    D:\P.Files%20Ext\MJ%20Ext\J2EE%201.4%20Tutorial%20EXT\j2eetutorial14\examples\web\common\targets.xml could not be found
    init:
    create-db_common:
    [java] java.lang.NoClassDefFoundError: com/pointbase/tools/toolsCommander
    [java] Exception in thread "main"
    [java] Java Result: 1
    BUILD SUCCESSFUL
    Total time: 8 seconds
    D:\P.Files Ext\MJ Ext\J2EE 1.4 Tutorial EXT\j2eetutorial14\examples\web\bookstore>
    Now I know that creating empty folders is not the solution so if anyone has any ideas as to what is wrong PLEASE tell me. I think there is something I need to add to a configuration file or something. I have re-installed the App Server but I still get the same problems. Thanks for your time!!

    Hi
    I have the same problem with the hello2 example, in the tutorial... You didnt??
    anyway maybe you are not setting the j2ee.home.
    somebody named " Jennifer " give me this advise ( i told you this to recognice that i was helped before)
    " Hello,
    You are probably not setting j2ee.home correctly. Please go to the following page and read section Building The Examples. Pay special attention to the Note in that section.
    http://java.sun.com/j2ee/1.4/docs/tutorial/doc/About.html
    thanks,
    Jennifer "
    good luck, see ya

  • Error thread java : problem with the function "resume 0x***"  (forum sun)

    One problem with the function of jdb occured when I tried to use it to
    pilot the processor with differents threads. In fact, I use a simple example with 2 threads.
    I stop the two threads with two breakpoint, and I want to resume one or the other (with the function "resume 0x****"), the one wich I resumed stop again on the breackpoint and I decide again to resume one or the other. All of that to obtain a tree of execution.
    I give you the code of the class and the code of jdb.
    CLASS: (it's just a object Room with a variable degre that I increment and decrement with two threads increase and decrease)
    public class Test{
         public static void main(String[] args){
              Room r = new Room();
              decrease de = new decrease(r);
              increase in = new increase(r);
              de.start();
              in.start();
    class Room {
         private volatile int degre=20;
         public void more(){
         degre += 4;
         public void less(){      
         degre -= 3;
    class decrease extends Thread{
    private Room room;
    public decrease(Room r){
              room =r;
    public void run(){
    try{ 
         while (!interrupted()){ 
              room.less();
    catch(InterruptedException e) {}
    class increase extends Thread{
    private Room room;
    public increase(Room r){
         room =r;
    public void run(){ 
         try{ 
              while (!interrupted()){
                   room.more();
    catch(InterruptedException e) {}
    JDB:
    Initializing jdb ...
    stop at Test:7Deferring breakpoint Test:7.
    It will be set after the class is loaded.
    runrun Test
    Set uncaught java.lang.Throwable
    Set deferred uncaught java.lang.Throwable
    >
    VM Started: Set deferred breakpoint Test:7
    Breakpoint hit: "thread=main", Test.main(), line=7 bci=30
    7 in.start();
    main[1] stop at room:16
    Set breakpoint room:16
    main[1] stop at room:20
    Set breakpoint room:20
    main[1] resume
    All threads resumed.
    >
    Breakpoint hit: "thread=Thread-0", room.less(), line=20 bci=0
    20 degre -= 3;
    Thread-0[1] threads
    Group system:
    (java.lang.ref.Reference$ReferenceHandler)0x10d Reference Handler cond. waiting
    (java.lang.ref.Finalizer$FinalizerThread)0x10c Finalizer cond. waiting
    (java.lang.Thread)0x10b Signal Dispatcher running
    Group main:
    (decrease)0x146 Thread-0 running (at breakpoint)
    (increase)0x147 Thread-1 running (at breakpoint)
    (java.lang.Thread)0x148 DestroyJavaVM running
    Thread-0[1] resume 0x147
    Thread-0[1]
    Breakpoint hit: "thread=Thread-1", room.more(), line=16 bci=0
    16 degre += 4;
    Thread-1[1] resume 0x147
    Thread-1[1]
    Breakpoint hit: "thread=Thread-1", room.more(), line=16 bci=0
    16 degre += 4;
    Thread-1[1] print degre
    degre = 24
    Thread-1[1] resume 0x146 //It's here the problem, thread 0x146 have to stop on the //next breakpoint of decrease but nothing happen
    Thread-1[1] resume 0x147
    Thread-1[1]
    Breakpoint hit: "thread=Thread-1", room.more(), line=16 bci=0
    16 degre += 4;
    Thread-1[1] clear
    Breakpoints set:
    breakpoint Test:7
    breakpoint room:16
    breakpoint room:20
    PS: I tried many other examples with other class and other kind of breakpoints, but, in any cases, on thread doesn't manage to resume. When I try with general resume (no specification of the thread), It works but it isn't interresting for me because I want to decide wich thread continue his execution.

    Hi,
    I have read the FAQ of the JMF.
    The problem was the jar files of the JMF were not in the JRE\BIN\EXT
    folder of the Java runtime!
    now it works!
    thanks
    Reg

  • Sqljdbc4 driver problem with the latest version of java (java6 update9)

    Hi all, sorry for my ingles.Need help with a problem, I have to connect to sql server 2008 from Java, I had install the Java SE Development Kit 6u22, and when the upgrade to the 6u29, the driver stopped working, they let the following example:
    public static Connection getConnection(String db_connect_string,String jdbcDriver)
    Connection conn = null;
    try {
    Class.forName(jdbcDriver);
    conn = DriverManager.getConnection(db_connect_string); //when you run this line, does nothing mores, nor throws errors
    } catch (Exception e) {
    System.out.println("Error de conexion." + e.getMessage());
    return conn;
    uninstall update29, and install that before and had returned to work. Still do not know how to solve this problem with the latest version of java. Any ideas?.
    Thanks.

    You are not the only one.
    MS SQL JDBC does not work with 1.6.0_29?

  • Has anyone else had problems with the latest system updates to Mac OS X v10.6.8 with the java virus patch?

    After installing the latest updates to Snow Leopard the system hangs up and will not open properly.  This is the update to Java, etc after the virus was discovered.  I have done the updates on four different systems with the same result. 

    No problems with the Java update here, although I have Java disabled. Might try reapplying the Java standalone while in Safe Boot (Shift at startup chime), if you did it from Software Update.
    http://support.apple.com/kb/DL1516

  • Solution Manager systems RAM requirements - problems with the Java Engine

    Hello,
    I am about to install SAP Solution Manager 7 on a WIndows 2003 Server x64 but I need to know what the RAM requirements are? I have been having problems with the Java Engine starting and it seems to time out, I have heard that this is a very RAM hungry process and it might be why?
    Many thanks for your help in advance,
    Omar

    Hello Omar,
    To size SAP Solution Manager 7.0 EHP1 we recommend to use the SAP Solution Manager Quicksizer Tool at:
    http://service.sap.com/sizing-solman
    Here you find information on how to use the tool, how to collect input data for E2E Scenario Sizing, on SAP E2E RCA Sizing, Introscope Tuning, Wily Enterprise Manager Cluster Setup for E2E RCA Scenario and BI Aggregation Strategy in E2E Scenario.
    Please find more information about installing Solution Manager in:
    http://service.sap.com/instguides -> SAP Solution Manager
    I hope this information helps.
    Thanks,
    Mark

  • Problems with the jax-rpc testcase from the JWSDP tutorial

    Hello.
    I have e few problems with the hello case from the JWSDP tutorial.
    Everything works fine during the build/compile/installation phase but when I'm accessing the url http://localhost:8080/jaxrpc-hello/jaxrpc, the server wont find the service and I get:
    404 The requested resource (/jaxrpc-hello/jaxrpc) is not available.
    I've trippel checked the environment settings and other properties and I don't know where to go to error check.
    I've tried to install the client as well but it wont detect the service so I guess there is a problem on the server side.
    I'm quite new to the whole "Web Service thing" So I would be happy to get som help.
    Chris

    if you run the tomcat manager application at http://localhost:8080/manager/list, what do you see? I suppose if you have successfully run the ant "install" task after "compile-server" and "xrpcc-server", you will see that your service is registered with its context path, but is not "running". This will be probably because of a runtime error. For further diagnosis of errors like these, I recommend to take a look at the log file at "<%JWSDP_HOME%>/logs/catalina.out".
    If you are satisfied with this answer, please be so kind and assign some of your duke dollars to me ;-)

  • HELLO, I HAVE THE SNOW OF LEOAPARD 10.6.8, I WOULD LIKE TO UPDATE THE LAST LION. I WOULD LIKE TO KNOW IF THERE ARE PROBLEMS WITH THE SOFTWARE COMPATIBILITY NOW, EXAMPLES: LOGIC, REASON, SUITE ADOBE CS5 ... THANK YOU

    HELLO, I HAVE THE SNOW LEOAPARD 10.6.8, I WOULD LIKE TO UPDATE THE LAST LION. I WOULD LIKE TO KNOW IF THERE ARE PROBLEMS WITH THE SOFTWARE COMPATIBILITY NOW, (EXAMPLES: LOGIC, REASON, SUITE ADOBE CS5 ...) THANK YOU!

    Have a look here:
    http://applehelpwriter.com/2011/07/24/will-my-old-apps-work-with-lion/
    (Like any website owner, I may (or may not) derive compensation from my website)

  • What's the best cover for the new iPad (3rd generation).  I've been told by a store employee (university bookstore) that there are problems with the magnetic covers on the newest iPad. Suggestions?

    What's the best cover for the new iPad (3rd generation).  I've been told by a store employee (university bookstore) that there are problems with the magnetic covers on the newest iPad. Suggestions?

    The best cover is the one that suites your needs. Try Google. There are dozens on the market.
    As for the Apple Smart Cover, it does work with the new iPad. There are a few reported issues with it, but that doesn't come close to representing the totality of folks with it.

  • Getting problem with the new java.util.concurrent package

    i m using the new concurrency package of jdk 1.5 in my code. see the line:
    Executor threadPool = Executors.newCachedThreadPool();
    about this, api doc says Creates a thread pool that creates new threads as needed, but will reuse previously constructed threads when they are available
    but i dont find this method to create new threads whenever required. please tell me about this.
    in my code, in some rare cases many threads r created, and very difficult to detect the number of active threads.
    as the previous one failed i tried with another one newFixedThreadPool(int). but here i got another problem. it works successfully but i dont understand what should be the size of the pool. i tried with 1000, it works well, but in a very rare case, it failed also. then i tried with 10000. but i m still confused, i dont know whether it would work always or not. with traditional threads my code never fails.
    please tell me, what should be the size of the pool and also let me know what is the problem with the first one (newCachedThreadPool)

    The thread pool should not be more than 100 threads. Ideally you should only have a small number of threads per CPU. If your threads are not long running it is possible that you could add 10,000 runnables but on start a small number of threads. Note, adding a thread take a non trivial amount of time so while the thread is added, all the others could finish. This could mean the number of threads could be 140 or smaller.
    Have you looked at the code to see what it does?

Maybe you are looking for

  • Can I connect  my iMac to my mac mini??

    I have the new 27 inch imac with thunderbolt, and I want to connect it to my new mac mini in my media closet. I was windering if there is a way to do this. The purpose of my mac mini is strictly as a media server, and all of my work and media are don

  • Not able to create sales order.

    Guru's, I unable to create the sales order. After entering sold to,material and qty and plant system is giving error Template material processing is deactivated Murali suggested to implement the note 1094540. But I am facing this problum in one box.

  • Halo: Combat Evolved EAX Windows 7 64 bit working!

    I used the newest version of Alchemy and Halo .05, with Windows 7 64 bit. The settings that are provided for 32 bit vista work as well in Windows 7. If you run 64 bit Windows 7 or Vista here is the new key: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mic

  • RAID driver for Linux Assaf?

    I have an 845 Ultra AR and the amount of mb's with a PDC20276 chip from promise is growing. Sadly the Promise source code are not open so the Linux community can't write any drivers on their own, nor do they support the OEM chips - this is left for t

  • Water damage on screen

    I spilled water on the screen and the LCD is damaged and I don't know how to fix it. Will it dry on its own? iBook G4