How to use byte[] in EJB Model

Hi Colleagues,
I have problem with binding byte[] to model attribute.
So I have methos myMethod(byte[] byteArr).
byte[] in the model is represent as Byte_Item type.
So I fill this attribute in this way:
inputFile is of type byte[]
for (byte b: inputFile) {
            IImportedFileElement el = wdContext.nodeImportedFile().createAndAddImportedFileElement();
            el.setItem(b);           
Then when I'm executing model object Ireceive.
java.lang.NullPointerException: while trying to invoke the method java.lang.Object.getClass() of an object loaded from local variable 'value'
at com.sap.tc.webdynpro.model.ejb.model.EJBGenericModelClassExecutable.setPropertiesForModelClass(EJBGenericModelClassExecutable.java:485)
at com.sap.tc.webdynpro.model.ejb.model.EJBGenericModelClassExecutable.buildModelClassListFromCollection(EJBGenericModelClassExecutable.java:655)
at com.sap.tc.webdynpro.model.ejb.model.EJBGenericModelClassExecutable.setPropertiesForModelClass(EJBGenericModelClassExecutable.java:553)
at com.sap.tc.webdynpro.model.ejb.model.EJBGenericModelClassExecutable.fillReturnParameterToMc(EJBGenericModelClassExecutable.java:711)
at com.sap.tc.webdynpro.model.ejb.model.EJBGenericModelClassExecutable.execute(EJBGenericModelClassExecutable.java:158)
Could you help me with this problem.
Best Regards,
Dimitar

You can put your Javascript code in the Onmouseover property of the column.
I don't have the Javascript code for changing the color but for example the following will pop up an alert
<af:outputText value="#{row.DepartmentId}" onmouseover="alert(\'Unload event fired!\')">

Similar Messages

  • How to use Script in ADF model?

    Hi!
    I don't know how to use Script in ADF model. Help me, please!
    Detail: javaScript.
    Thanks so much!

    You can put your Javascript code in the Onmouseover property of the column.
    I don't have the Javascript code for changing the color but for example the following will pop up an alert
    <af:outputText value="#{row.DepartmentId}" onmouseover="alert(\'Unload event fired!\')">

  • How to use UndoableEditSupport in undo model?

    The undo example of Java Tutorials just use UndoManager and UndoableEditListener. It didn't use the class UndoableSupport, How to use it?
    thanks for any replier.

    You can put your Javascript code in the Onmouseover property of the column.
    I don't have the Javascript code for changing the color but for example the following will pop up an alert
    <af:outputText value="#{row.DepartmentId}" onmouseover="alert(\'Unload event fired!\')">

  • How to use an existing data model using Business Components in OEPE

    I am a beginner in ADF. I am working on a project with an existing data model that uses Business Components (EO, VO and AM). I know that OEPE does not handle the creation of BC, so if I want to modify them, I will have to do that in JDev. That's fine.
    OEPE can create pages with drag and drop like in JDev. In my eclipse ADF projects, I would like to use the existing BC, to be able to use the bindings with ADF Faces. So far I have nothing in the Data Controls tab.
    How to import the BC into the Data Controls tab?
    JDev 11.1.1.6
    WLS 10.3.6
    Eclipse Kepler

    We currently don't support DataControls based on the ADF BC technology. We will consider such support if there is a strong interest in that use case.
    Independent of the IDE's you use, there are ways to expose services based on ADF BC that can then be consumed by the view layer. A Google search will point you to some of the approaches.
    HTH. Thanks for your interest in OEPE.

  • How to use byte[] for calculation

    i use a random number generater to produce a random byte[] array . I need to use the byte[] generated to do some calculation. how i can do that?? do i need to change the byte[] array to integer first??

    You didn't say how many bytes make up your byte array. 1. Assuming the size of the array is 8 bytes or less, you could write your own code to convert the array to an int or long. 2. You can use the BigInteger class. 3. You can write your own code to do the calculations.

  • How to use a grayscale color model in converting a colored image

    how to convert a colored image into grayscale using :
    ColorSpace cs = ColorSpace.getInstance(ColorSpace.CS_GRAY);
    int bits[] = new int[] {8};
    ColorModel cm = new ComponentColorModel(cs, bits, false, false,
    Transparency.OPAQUE,
    DataBuffer.TYPE_BYTE);
    please only this method , i don't need the "bandcombine" method cause i need to know that i have exact 256 grayscale colors, thanx in advance.

    I went into mail preferences in the first place. I found the fonts and colors and picked the color I want but it doesn;t seem to be sticking?

  • How to  use Timing with EJB in J2EE1.3

    Hi,
    I am developing an EJB app where I need some sort of timing service. Unfortunately, I can't resort to the EJB Timer Service which is available under the J2EE1.4 spec, because the server I am working on is only J2EE1.3 compatible.
    I understand that I cannot use threads as they would intervene with the EJB thread handling.
    Can anybody give me an idea what I could use instead? Is there any trivial solution this? I'd be thankful to hear it..
    Regards,
    Katrin.

    Cross-post
    http://forum.java.sun.com/thread.jspa?threadID=730563&messageID=4204123#4204123

  • How to use the character encoding model to use ' �'  in java

    hi
    I have to use the special characters like '�' using java.but when '�' character is transferred to data base or is displayed in my form,it is shown as '?'.but i need to display the original characters in the form of what it is.
    what can i do as i expects the result .i needs it very urgently.so reply to me as soon as possible.
    advance thank you
    rgds
    Oasisdeserts

    Java stores all characters as 16 bit UNICODE (which has plenty of room far more exotic characters than Greek). Every time character data is brought into, or stored from the Java environment it passes through a specific character encoding. If you don't state the encoding explicitly it uses the default encoding of the machine it's running on (which is typically oriented to the language set in the locale.).
    With a database the database driver is supposed to do any necessary translation. The non-latin character could be stored wrongly, the database could be returning it wrongly or whatever's creating your form could be interpretting it wrongly, or lack the capacity to display the character.
    If it's, say, a JSP try setting the page encoding to UTF-8. Try dumping the characters read from the database in HEX and look them up at www.unicode.org.
    Take a look at the database setup information, some have an option of storing characters as UNICODE or ASCII.
    The "?" is substituted whenever a codec can't make sense of the codes it's translating, either the byte array is invalid or the UNICODE character can't be represented.

  • How to use JDO in EJBs?

    Hi, dear colleagues
    Could someone direct me to a small example of using Java Data Objects in WebLogic AppServer 8.1 or in another appserver?
    Thank you in advance,
    Georgi Cholakov
    ISY Intellect

    http://java.sun.com/developer/technicalArticles/J2SE/jdo/

  • How can I uses byte[] to represent the length of a message?

    hihi,
    I want to using 3-bytes to represent the length of a message that send over a socket,
    I don't know how to using byte to represent the length, should I parse integer to byte?
    thank you

    int length;
    DataOutputStream dos = ...;
    dos.writeByte(length >>> 16);
    dos.writeByte(length >>> 8);
    dos.writeByte(length & 0xff);But why 3? Why not 2 or 4 like everybody else? with DataOutputStream.writeShort() or writeInt()?

  • Using log4j in EJB: where to configure the logging service?

    Hi there,
    I have a question on how to use log4j in EJBs. Details:
    I want to provide a static final Logger instance in each bean class. This logger will be used by my bean instance to log some interesting messages. The log4j service should be initialized (by calling BasicConfigurator.configure() for example) only once before any message is logged. So where should i place the initialization code?
    I know that for a web app, i can define a ServletContextListener implementation to do the initialization work when my web app is loaded. Is there anything similar for EJB?
    Thanks in advance.
    heavyz

    Hi xHacher,
    do you mean something like this?
    public class LogFactory {
        static {
            BasicConfigurator.configure();
        public static Logger getLogger(Class clazz) {
            return Logger.getLogger(clazz);
    }And in each of my bean class, i may get the logger by using:
    private static final Logger log = LogFactory.getLogger(MyBean.class);The code above ensures that log4j is well initialized before any logger instance is created. But any better solutions?
    heavyz

  • How to use a session bean in another session bean (or an EJB in a session)

    JDev 11.1.1.4, WLS 10.3.4, Windows 7 x64
    I have a login controller with a session-scoped bean that manages logins.
    I have another session-scoped bean that manages menu security.
    both modules compile and work fine now I need to share the data from one to another.
    I need to reference the login controller in the menu security bean. How do I reference (include) the login bean in the security bean?
    I tried an EJB - what a farce - these are supposed to be universal and easy ( basis of the oop in Java).
    the bean is defined:
    @Stateless(name = "SecurityEJB", mappedName = "ZITASApplication-ZITASModel-SecurityEJB")
    I have tried :
    ic = new InitialContext();
    session = (SecurityEJBLocal)ic.lookup("ZITASApplication-ZITASModel-SecurityEJB#model.security.logic.SecurityEJB");
    session = (SecurityEJBLocal)ic.lookup("ZITASApplication-ZITASModel-SecurityEJB#model.security.logic.SecurityEJBLocal");
    session = (SecurityEJBLocal)ic.lookup("java:ejb/model.security.logic.SecurityEJB");
    session = (SecurityEJBLocal)ic.lookup("java:ejb/SecurityEJB");
    session = (SecurityEJBLocal)ic.lookup("java:app/SecurityEJB");
    session = (SecurityEJBLocal)ic.lookup("java:module/SecurityEJB");
    All return null pointers and claim the name cannot be resolved.
    As you can see - I have found various claims to how to do this.
    One way says create a sevlet, generate a listener and use the sevlet. Basically one for every EJB - a lot of work to use the EJBs
    I would assume that this would be one of the easiest parts of java - as it is the foundation of re-usability and oop.
    I can do either in the application - the added complexity of the EJB is less desirable - but better programming?

    Hi,
    ic.lookup("ZITASApplication-ZITASModel-SecurityEJB#model.security.logic.SecurityEJB");This should work with remote interface. If you want to lookup local interface, you need to register it in web.xml. Quote:
    To access the business local interface you need to define ejb local references for your component environment (i.e. from your servlet environment). You can do this by defining references in your web.xml. For example:
    <ejb-local-ref>
    <ejb-ref-name>ejb/BusinessLogicBean</ejb-ref-name>
    <local>packagename.BusinessLogicBean</local>
    </ejb-local-ref>
    To lookup your local reference from your servlet you need to use the following JNDI reference:
    java:comp/env/ejb/BusinessLogicBean Another one
    First, declare a local ejb reference in your web.xml file (This will add it to JNDI):
    <ejb-local-ref>
    <ejb-ref-name>ejb/Foo</ejb-ref-name>
    <local>simple.ejb.FooLocal</local>
    </ejb-local-ref>
    Then it can be looked up from JNDI:
    InitialContext ctx = new InitialContext();
    FooLocal foo = ctx.lookup("java:comp/env/ejb/Foo");Hope this helps.
    Pedja
    Helpful links (judging from your first post, you are probably sick of these :) )
    How to lookup local EJB in Oracle Weblogic 10.3
    http://m-button.blogspot.com/2008/07/reminder-on-how-to-use-ejb3-with.html
    http://www.coderanch.com/t/451012/EJB-JEE/java/EJB-Local-Lookup-not-working

  • How to use Adaptive WebService Model with CAF WebService and Complex Type

    Hi All,
    I am trying to use the Adaptive Web Service Model and call a WebService generated by the CAF. The return type of the WebService is a Complex Type.. I receive an exception when trying to instantiate the Model Node.
    Does anybody know how to use the Adpative Web Service Model with CAF WebServices and Complex Types as return type?
    Help is appreciated..
    Thanks, Johannes

    Thanks Mukesh.
    It is not possible to apply the Service Controller Template on Enterprise Java Bean Models as described in the Document. When I try to aply the template on the EJB Model, NWDS says: Only Webservice Models and RFC Models are supported...???
    I did not find any information about how to return complex types in AWS.. in this document???
    Is there such information available? Has anybody ever done that? There must be a way to do that.. Is is the standard approach, isn't it...? Please help me out there.. I need to get this running..
    Thanks, Johannes

  • How to achive multi-line editing (CRUD) with a table-UI on a ejb-model

    Hello community,
    i'm working on an prototype. we want to migrate an existing web-application to nw 7.1 with web-dynpro as ui-technology. the old application often uses javascript-/ajax- driven table-grid-controls. this table controls allowed editing the data in it. the conrol "records" every action. for example which rows were deleted, which were updated and which were appended.
    when the user has finished editing, he simply clicks a save-button. the table-grid control then sends the changes via ajax-calls to the server.
    now i want the achive such behavior in web-dynpro (7.1)
    for getting the data to be edited, i wrote an ejb and created an ejb-model in web-dynpro. so viewing the data works fine so far. the view-controller with the table-ui-element is bound to the view-controllers context, which is mapped to the context-controller to which again a model-object is bound, which retrieves the data from the ejb.
    inserting, updating and deleting single rows with a detail-view-controller also works, using additional context nodes (again mapped to addtional model-classes for crudp.
    but i know want to have all rows and cells to be editable. the user should be able to insert, update and delete in that table without neccessarily using a detail-view-controller.
    how would you achive this? holding every creates, update, deletes in single nodes? and when clicking a button to fire the save action to go to that nodes and apply that action? Or would you create an addtional flag-attribute in the node that shows what was done with that row? after pressing save also iterating the nodes, checking for the flag and doing the appropriate actions (but this maybee is performance critical when having a lot of rows)?
    any ideas how to achieve multiple crud-operations on a context-node, viewed with a table-ui-element would be welcome.
    regards
    Matthias

    Matthias,
    Let's address your questions one by one.
    1. You can make the table cells editable by chosing 'InputField' as TableCellEditor.
    2. Since you have bound your table to 'View Context' and 'View Context' to 'Component Context', all changes made by you in table will be visible in Component Context after every round-trip to server.
    3. To modify the data in 'backend', you need to modify your 'Save' method to check for every changed element and modify the data only if element was changed by user. To see if the element has been changed by user, use [IWDNodeElement.isChangedByClient()|https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/progmodel/api/IWDNodeElement.html] method. This method returns true if element was changed by user - this is what you need.
    To learn more about WD Table UI element, you may want to see [this link|http://help.sap.com/saphelp_nw70/helpdata/en/eb/220a415a47f06fe10000000a1550b0/frameset.htm].   
    Hope this helps.
    Vishwas.

  • How can Transformation control be used from an EJB Project?

    I want to perform some data transformation directly from within the EJBs. Can Transformation
    control be used from an EJB Project? How?

    William, thanks for the reply.
    I bought this drive module from a private party and was surprised to find out what it was. At first I thought it was just Apple's way of protecting the drive during shipping.
    I own it and will probably have an hard time returning it. It was advertised as a 750GB Seagate SATA ES hard drive. The price was very reasonable, especially if I was buying it as a Drive Module. So if I can sell it great, if not I want to use the drive.
    How can I tell if this is a Xserve RAID module or Drive Module? The box just says Apple Drive Module no mention of RAID. The Apple model # is MA504G/A, and it say Apple Drive Module 750GB SATA (Intel). On the hard drive itself it says Seagate Barracuda ES 750Gbytes.
    If this is just the Drive Module and I can use it in my Mac Pro, does it just unplug or unscrew out of the housing it's in and plug into the Mac Pro like a normal drive? And then can it be used like a normal drive to set up a RAID in the Mac Pro with a duplicate bare drive? It's sealed and I don't want to open it until I know I can use it.
    Sorry for all the questions but I know enough to be dangerous and this this has me stumped.

Maybe you are looking for

  • Photoshop CS3 Extended Not Responding after Installation

    A couple of days ago, I purchased a copy of CS3 Extended and was ecstatic. I got home and installed it on my computer, only to find that when I opened the program, it would just not respond, so I was left with a white window. I was afraid it might be

  • $0.99 Weekend Movie Rental

    Rented *Breakfast At Tiffany's* a week ago at $2.99 but it's at $0.99 for this weekend only. Ouch! Anyhow, I think it's a weekly promo thingy from iTunes Store. Guess I shall do my rentals over weekends from now on. :P Also, I think it's better to re

  • MacBook Pro Trackpad Experience?

    Hi there, I'm an avid MacBookPro User, and last year abandoned my mouse in favour our purely using the trackpad. I'd now like to start using an external monitor and keyboard and am wondering what the best solution for a similar experience is? I've re

  • TRANSFORMATION STARTS AGAIN, WHEN I RESTART THE COMPUTER OR ENABLE THE CAPTURE PROCES

    Hello all, I am using a Transformation function which is invoked by Capture process whenever a delete is performed on source table, then Transformation function collect the required data from LCR and stores in some other local table. When capture pro

  • RFC: new PKGBUILD for odfpy

    odfpy is a nice library for producing ODF documents with python. I've created a PKGBUILD for it, any comments before I submit it to the AUR? # Contributor: Joel Schaerer <[email protected]> pkgname=odfpy pkgver=0.7 pkgrel=1 pkgdesc="A complete API fo