C Wrappering

To all...
I have never done any C Wrappering so please excuse the ignorance of this
question.
I had always thought of this as a way to get a C function that I had written
into Forte so that it could be called in Tool code.
I was recently presented with another alternative. There is a 3rd party DLL
that is this product's API. From the 3rd party API documentation we know the
signature of each call. So, it seems THEORETICALLY possible to create a C
project Definition File describing these functions and them import etc. so that
you have these API functions directly callable from Tool.
So with this as the theory, what are the problems in reality? Is this
practical? Has anybody done this? Is everybody doing this?
Jerry Fatcheric
Relational Options, Inc.
Morristown, Nj
201-301-0200
[email protected]

Parvathi Iyer wrote:
>
We are trying to wrapper 'C' functions which contain Oracle pre-complied
SQL. Has anybody done this? We could do with a lot of help
[email protected], thanks for your reply. We are tying to wrapper
Oracle PRO*C precompiled C libraries to use with forte. Our existing
system revolves around these C libraries, which are server based. We are
thus not creating DLLs but trying to run the wrappered C code in the
server. The problem is that the PRO*C precompiled libraries are static
while forte expects them to be shareable. We actually need a work around
to be able to - either call static libraries in Forte (not possible in
Forte, we think) or make the static libraries shareable (not supported
by Oracle, till v7.2). Are there any work-arounds ??Parvathi,
I have done quite a bit of wrappering with Forte. I have called COBOL Oracle
pre-compiled programs (ok, you can stop laughing now).
You did not mention the hardware platform you are running on. Its been a while
since I did wrappering but here is what I had to do. I am fairly certain you will
have to do something similar.
We are running Forte on a HP9000 UNIX box with Windows clients. We are porting a
huge medical management system that contains over a million lines of COBOL code,
so wrappering is near and dear to us, so we do not have to re-write all that code.
My wrappering goes back to release C of Forte, so I am not sure what changes have
been made since then.
Basically, you need to build your Pro C programs into a shared library. To do this,
first, you need to compile it position independent. Next, build it into a shared lib.
From what I understand, Forte uses sh_load to load the shared lib at run-time. Now, yourmethods (functions) can be executed by Forte. Your wrappered C code will probably not be
thread safe so you need to restrict these projects.
A word about run-time binding. Last time I did wrappering, Forte was loading the shared libs
with the bind immediate fatal option. This is a very restrictive way to load a lib.
Basically, all references must be resolved at load time and if one can not the load fails and so
does your program. I disagree with Forte's binding policies but have learned to live with them.
Our shared libs require MicroFocus COBOL and Oracle library functions. You will need in link some
of the Oracle libs with your shared libs when you build them to resolve link references. In addition,
we had to re-link ftexec with MicoFocus and Oracle libs to resolve run-time references. We modified
the link.sybase script to do this.
We actually created a program that does a sh_load bind immediate fatal to test loading of our shared
libs without running ftexec. This is a simple C program that you pass the lib name and it tries to
load it. It reports whether it is successful or not. Whatever libs you need to link into the C program,
are the libs that must be linked into ftexec. If your are running compiled partitions, you will need to add
these libs to the compile and link of the partition.
This may seem like a lot of trouble. Well, it was. This was not easy to figure out. It took some
work with some Forte guru's. The good news is that once you do it and understand what is going on,
it pretty easy. You definitely need to be familiar with compiling, linking and shared libs to get all
this working.
Robert Crisafulli
AMISYS
(301)838-7540

Similar Messages

  • ArrayList and wrappers

    Can an ArrayList contain different types of objects from the same class?
    I know that it must be an object but can one be of type String and another be of type int?
    I am reading information from a file that looks something like this:
    Sam
    Jones
    21
    Tim
    Hendricks
    15
    I have written the following method:
    ArrayList list = new ArrayList();
    String fname;
    try
      BufferedReader br = new BufferedReader(new FileReader("student.txt"));
      while ((fname = br.readLine()) != null)
             String lname=br.readLine();
         int age= br.readLine();
         br.readLine(); //FOR THE BLANK LINE
         list.add(new Student(fname, lname, age));
      br.close();
    catch(IOException e)
      System.err.println(e.getMessage());
      System.exit(0);
    }If I declare age as type String the method and other methods work great, but I need to make it of type int.
    I have read up about wrappers and I think that is what I am suppose to use for the int but no matter what I do, I get tonnes of error messages.
    Any help would be appreciated.

    A better way would be to build a class for your data packet.
    class Thing {
      public final String name;
      public final int age;
      public Thing(String name, int age) {
        this.name = name;
        this.age = age;
    public class SomeClass {
      public static void main(String[] args) {
        List list = new ArrayList();
        list.add(new Thing("Jill",10));
        list.add(new Thing("John",20));
        list.add(new Thing("Janet",30));
        list.add(new Thing("Jeremy",40));
    }Then you can simply get your values back with
    for(Iterator iterator = list.iterator(); iterator.hasNext(); ) {
      Thing thing = (Thing) iterator.next();
      System.out.println("Name: "+thing.name);
      System.out.println("Age: "+thing.age);
    }Or something like that...
    Talden

  • How To Create Object Wrappers

    Hi there,
    I would like to implement some better and custom error handling in some of the business objects.  Objects such as the Recordset and Documents can have a tendency to 'die' on a line that errors and I would like to create wrappers for these classes so I can handle them using common methods.
    I have tried to create new classes inheriting from RecordsetClass and DocumentsClass and everything compiles fine but produces COM errors as soon as I try to access them at runtime.  Are we just out of luck trying to enhance these classes?  Is our only option to write a one-off wrapper that simply handles the SBO object type internally in our new class?
    It would seem very beneficial to be able to extend these objects in order to implement common methods and business rules.  Has anyone been successful at doing this?
    Here is my class declaration that fails when I try to access it at runtime:
    using System;
    using System.Runtime.InteropServices;
    using SAPbobsCOM;
    namespace NMO.SAP.Shared
        /// <summary>
        /// PLS Wrapper for the SAP Documents object
        /// </summary>
        public class SBODocuments : DocumentsClass
            private SAPbobsCOM.Company sboCompany;
            public SBODocuments(SAPbobsCOM.Company company)
                this.sboCompany = company;
            /// <summary>
            /// New implementation of the Add method returning true or false
            /// </summary>
            /// <returns>True or false</returns>
            public new Boolean Add()
                Boolean retVal = true;
                try
                    // Add method returns 0 if successful
                    if (base.Add() != 0)
                        retVal = false;
                        SBOErrorHandler.HandleSAPError(this.sboCompany);
                catch (COMException cex)
                    retVal = false;
                    SBOErrorHandler.HandleSAPError(this.sboCompany, cex);
                catch (Exception ex)
                    retVal = false;
                    SBOErrorHandler.HandleSAPError(this.sboCompany, ex);
                return retVal;
    Thanks very much,
    David

    David,
    A good aproach would be to convert .COM objects to .NET
    This application <a href="http://www.aurigma.com/Products/COMtoNET/">COMtoNET</a>
    Will generate all the C# Code needed to convert COM objects to .NET, and then you'll be able to catch any event, error and so on.

  • EJB 3.0 Web Services - Custom Request/Response Wrappers

    Hi All,
    I'm having an issue using Document Literal Wrapped web services with EJB 3.0. I have declared a service endpoint interface(SEI) in one jar file, along with custom wrapper classes for the requests and responses. The wrappers have the XML content customized a bit (different type names, etc.), but should be compatible with the @RequestWrapper and @ResponseWrapper annotations. The implementation is in an EJB jar file that includes the jar with the SEI in it. My issue is that the wrapper classes I declared are not being used, and instead new ones are being generated. Is it even possible for it to use supplied wrappers, or does it have to generate its own (and if so, is it in any way possible to specify the XML types it generates). I've tested this with wsgen, and I get the same result (new wrapper classes, the ones I supplied ignored) as when I deploy it. Here is the output from wsgen:
    Note: ap round: 1
    [ProcessedMethods Interface: com.company.IngestorService]
    [should process method: ingestProductDirectory hasWebMethods: false ]
    [endpointReferencesInterface: true]
    [declaring class has WebSevice: true]
    [returning: true]
    [WrapperGen - method: ingestProductDirectory(java.lang.String,java.lang.String)]
    [method.getDeclaringType(): com.company.IngestorService]
    [requestWrapper: com.company.IngestProductDirectoryRequest]
    [should process method: datatypes hasWebMethods: false ]
    [endpointReferencesInterface: true]
    [declaring class has WebSevice: true]
    [returning: true]
    [WrapperGen - method: datatypes()]
    [method.getDeclaringType(): com.company.IngestorService]
    [requestWrapper: com.company.DatatypesRequest]
    com\company\DatatypesRequest.java
    com\company\DatatypesResponse.java
    com\company\IngestProductDirectoryRequest.java
    com\company\IngestProductDirectoryResponse.java
    Note: ap round: 2
    I note that is says "hasWebMethods: false". Could that be an issue? Could it not be seeing my methods as web methods. The SEI and the implementation class are in different jar files and different packages. Could this be an issue?
    Here is the web service interface:
    @WebService(
    name = "IngestorService",
    targetNamespace = "http://company.com/"
    @SOAPBinding(
    style = SOAPBinding.Style.DOCUMENT,
    parameterStyle = SOAPBinding.ParameterStyle.WRAPPED
    public interface IngestorService
    @WebMethod(
    action = "http://company.com/ingestProductDirectory"
    @WebResult(
    name = "response",
    targetNamespace = ""
    @RequestWrapper(
    className = "com.company.IngestProductDirectoryRequest"
    @ResponseWrapper(
    className = "com.company.IngestProductDirectoryResponse"
    public void ingestProductDirectory(
    @WebParam(
    name = "sourceDirectory",
    targetNamespace = ""
    String sourceDirectory,
    @WebParam(
    name = "datatype",
    targetNamespace = ""
    String datatype);
    @WebMethod(
    operationName = "datatypes",
    action = "http://company.com/datatypes"
    @WebResult(
    name = "datatypes",
    targetNamespace = ""
    @RequestWrapper(
    localName = "DatatypesRequest",
    className = "com.company.DatatypesRequest"
    @ResponseWrapper(
    localName = "DatatypesResponse",
    className = "com.company.DatatypesResponse"
    public List datatypes();
    Here are the datatype request and response wrappers:
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(
    name = "DatatypesRequest"
    public class DatatypesRequest
    DatatypesResponse.java:
    @XmlAccessorType(XmlAccessType.PROPERTY)
    @XmlType(
    name = "DatatypesResponse",
    propOrder =
    "datatypes"
    public class DatatypesResponse
    private List<String> _datatypes;
    @XmlElementWrapper(
    name = "datatypes",
    required = true,
    nillable = false
    @XmlElement(
    name = "datatype",
    required = false
    public List<String> getDatatypes() {
    if (_datatypes == null) {
    _datatypes = new ArrayList<String>();
    return _datatypes;
    Any help would be greatly appreciated. Thanks.

    I have been trying to do the same... and it seems to be impossible... (or completly undocumented).
    It seems that OC4J 10.3.x is ... no exactly fully EJB3/J2EE5 compliant...
    Or something like that:
    http://blogs.infosupport.com/berte/archive/2005/09/09/1117.aspx
    IMHO... OC4J 10.3.x is still a preview for OC4J 11...
    OC4J 10.3.x is kind of a J2EE4/5 hybrid... if you start digging in the documentation, you will find out that the only
    way to have WS-Security is going back to J2EE4 http://www.oracle.com/technology/products/jdev/howtos/1013/wssecure/10gwssecurity_howto.html
    (of course, I hope you probe me wrong)
    Message was edited by:
    luxspes

  • How to define tcp wrappers for a new service in Solaris 10?

    Hi all, I need to setup tcp wrappers for a third-party software product with /etc/hosts.allow.
    I installed Trillium software on a new Solaris 10 server. It added this entry to /etc/inetd.conf:
    dscserv0_rel1300 stream tcp nowait tsadmin /usr/bin/env env -i HOME=/home/tsadmin LOGNAME=tsadmin /opt/trilv13/TrilliumSoftware/server/metabase/bin/mtb_server
    After the install, I ran inetconv and this new SMF service was created:
    *# svcs -a|grep dsc*
    online         13:22:57 svc:/network/dscserv0_rel1300/tcp:default
    Here's the problem: After this, all new connections were denied by default. I had to disable tcp wrappers with this command:
    inetadm -m svc:/network/dscserv0_rel1300/tcp:default tcp_wrappers=FALSE
    I would prefer to enable tcp wrappers, and put an entry into /etc/hosts.allow, but I can't figure out what service name to put into /etc/hosts.allow. I've read through the man pages but I can't identify the service name to use for this new service, and it won't accept the FMRI or an abbreviation of it either.
    How do I identify the service name to put into /etc/hosts.allow?

    At OS level, before entering Sql*Plus, do :
    $ EDITOR=vi; export EDITOR
    $ sqlplus ......
    Message was edited by:
    Paul M.
    Ciao Nicolas :-)

  • Error while mapping BAPI wrappers.

    Hi,
    I have two SAP standard BAPIs (GetList & GetDetail) related with Inventory. When I assigned these BAPIs into my SyncBO and tried for mapping, I got an error "No import parameter refering to a filed of header structure exists in GetDetail BAPI Wrapper". How can I rectify this?
    I have seen some previous threads in forum like this, but I didnt got it well.
    Hope someone can give me better clarification regarding this & the constraints required for BAPI wrappers that can be used with a SyncBO. 
    Regards
    Shemim

    Hi Shemim,
    Kindly check the below article which explains about developing bapi wrappers with a sample syncbo.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/mobile/mobile%20infrastructure/mobile%20offline%20application%20development%20a%20complete%20guide%20using%20mobile%20infrastructure%20tools.pdf
    This will give you a better picture, how a bapi should be developed.
    Cheers,
    Karthick

  • How to enable TCP Wrappers with SMF services?

    I am using a site.xml file to enable/disable services during a Jumpstart configuration. This works great.
    However, I can't yet figure out how to configure the various properties of those services, such as enabling TCP Wrappers for a service. I can set the properties of a service and verify that they are set, but a "svccfg extract" does not capture that information.
    Is this a short coming of svccfg extract? Or are the properties of a service stored and configured elsewhere?

    That will work, as will any path underneath
    /var/svc/manifest.Got it working...Exported the inetd configuration, set tcp_wrappers to false, dropped inetd.xml into my jumpstart tree, jumped a box, and tcp_wrappers came up enabled by default for my inetd services!
    What is the difference between the /var/svcs/profile and /var/svcs manifest directory? Is profile for enabling/disabling services and manifest for service configuration?
    Does /var/svcs/profile/site.xml and /var/svcs/manifest/whatever.xml get read on every system boot? If not, what is the appropriate procedure to "reinitialize" smf if you want to change the existing behaviour by having it reread those files?
    Hmm. The defaults get written on the inetd serviceI believe, so exporting that would give you the
    fragment
    you want.It did, and I was able to accomplish what I needed to do.
    Sorry that it's such a slog in the meanwhile.Will there be something before FCS in a couple weeks?
    I can definetly see the managability and robustness of SMF. It's just going to take time to learn it, and documentation is needed for that.
    Thanks for all your help!

  • JMS Wrappers can't cache JNDI lookups when using secured queues

    Hi All!
    We are working on a jms client, inside a webapp(servlets), using Weblogic 9.2 and Weblogic 10.3.
    As we want to use secured queues and keep being efficient we tryed to use Weblogic JMS Wrappers, that should work according to the docs:
    Enhanced Support for Using WebLogic JMS with EJBs and Servlets
    http://download.oracle.com/docs/cd/E12840_01/wls/docs103/jms/j2ee.html
    But we are facing a problem:
    When we define a JMS Wrapper and try to cache JNDI lookups for the QueueConnectionFactory and Queue, as the docs recommend for efficiency, the connection to the queue is ignoring the user/pwd.
    The JMS Wrapper is using <res-auth>Application</res-auth>.
    We are creating the connection using createQueueConnection(user, pwd) from QueueConnectionFactory and after several tests it seems that the user and password are ingored unless a jndi lookup is made in the same thread, as if when there are not any thread credentials present user and password are ignored for the connection...
    so the question is:
    That behaviour goes against Weblogic JMS Wrapper documentation, doesn't it?
    Is there then any other way to access efficiently secured queues using a servlet as a client? (iit's not an option for us to use mdbs, or ejbs).
    If it helps, this seems related to this still opened spring-weblogic issue: SPR-2941 --> http://jira.springframework.org/browse/SPR-2941 and SPR-4720 --> http://jira.springframework.org/browse/SPR-4720
    Thanxs
    And here goes our DDs and code to reproduce:
    First in pretty format:
    web.xml --> http://pastebin.com/f5f85e8d4
    weblogic.xml --> http://pastebin.com/f2fbe10cc
    Client code --> http://pastebin.com/f586d32d9
    And now emmebded in the msg:
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-web-app
      xmlns="http://www.bea.com/ns/weblogic/90"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.bea.com/ns/weblogic/90
      http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">
        <description>WebLogic Descriptor</description>
        <resource-description>
            <res-ref-name>jms/QCF</res-ref-name>
            <jndi-name>weblogic.jms.ConnectionFactory</jndi-name>
        </resource-description>
    </weblogic-web-app>weblogic.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
          <display-name> QCFWrapperCredentialsTest </display-name>
          <description> QCFWrapperCredentialsTest  </description>
          <servlet id="Servlet_1">
             <servlet-name>QCFWrapperCredentialsTest</servlet-name>
             <servlet-class>QCFWrapperCredentialsTest</servlet-class>
             <load-on-startup>1</load-on-startup>
          </servlet>
          <servlet-mapping id="ServletMapping_1">
             <servlet-name>QCFWrapperCredentialsTest</servlet-name>
             <url-pattern>/Test</url-pattern>
          </servlet-mapping>
         <resource-ref>
            <res-ref-name>jms/QCF</res-ref-name>
            <res-type>javax.jms.QueueConnectionFactory</res-type>
            <res-auth>Application</res-auth>
            <res-sharing-scope>Shareable</res-sharing-scope>
        </resource-ref>
    </web-app>And our test client:
    import java.io.*;
    import java.util.Properties;
    import javax.jms.*;
    import javax.naming.*;
    import javax.servlet.http.*;
    public class QCFWrapperCredentialsTest extends HttpServlet {
        QueueConnectionFactory factory = null;
        Queue queue = null;
        String jndiName = "java:comp/env/jms/QCF";
        String queueName= "jms/ColaEntradaConsultas";
        String user = "usuarioColas";
        String pwd = "12345678";
        String userjndi = "usuarioColas";
        String pwdjndi = "12345678";
        String serverT3URL="t3://127.0.0.1:7007";
        public void init() {
            setupJNDIResources();
        private void setupJNDIResources(){
            try {
                Properties props = new Properties();
                props.put("java.naming.factory.initial",
                        "weblogic.jndi.WLInitialContextFactory");
                props.put("java.naming.provider.url",serverT3URL );
                props.put("java.naming.security.principal", userjndi);// usr
                props.put("java.naming.security.credentials", pwdjndi);// pwd
                InitialContext ic = new InitialContext(props);
                factory = (QueueConnectionFactory) ic.lookup(jndiName);
                queue = (Queue) ic.lookup(queueName);
            } catch (NamingException e) {
                e.printStackTrace();
        public void service(HttpServletRequest req, HttpServletResponse res) {
            res.setContentType("text/html");
            Writer wr = null;
            try {
                wr = res.getWriter();
                //Comment this out, do a lookup for each request and it will work
                //setupJNDIResources();
                String user = this.user;
                String pwd = this.pwd;
                //read users and passwords from the request in case they are present
                if (req.getParameter("user") != null) {
                    user = req.getParameter("user");
                if (req.getParameter("pwd") != null) {
                    pwd = req.getParameter("pwd");
                wr.write("JNDI  User: *" + userjndi + "* y pwd: *" + pwdjndi + "*<p>");
                wr.write("Queue User: *" + user + "* y pwd: *" + pwd + "*<p>");
                //Obtain a connection using user/pwd
                QueueConnection conn = factory.createQueueConnection(user, pwd);
                QueueSession ses = conn.createQueueSession(true,
                        Session.SESSION_TRANSACTED);
                QueueSender sender = ses.createSender(queue);
                TextMessage msg = ses.createTextMessage();
                msg.setText("Hi there!");
                conn.start();
                sender.send(msg);
                ses.commit();
                sender.close();
                ses.close();
                conn.close();
            } catch (Exception e) {
                e.printStackTrace();
                try {
                    wr.write(e.toString());
                } catch (Exception e2) {
                    e2.printStackTrace();
            finally{
                try {
                    wr.close();
                } catch (IOException e) {
                    e.printStackTrace();
    }Edited by: user2525402 on Feb 9, 2010 7:14 PM

    Thanks Tom,
    Quite a useful response .-)
    Leaving aside the fact that weblogic behaviour with jms wrappers and secured queues seems to not be working as the docs says...
    Talking about workarounds:
    Both workarounds you suggest works, but as you already noted, creating a new JNDI context just to inject credentials into the threads is overkill when high performance is needed.
    I also found more information about the same issue here: http://sleeplessinslc.blogspot.com/2009/04/weblogic-jms-standalone-multi-threaded.html
    And he suggest the same workaround, injecting credentials
    So I tried the second approach, successfully, injecting credentials into the thread using the security API.
    This way, using JMS wrappers and injecting credentials into the thread we get the best performance available, caching resource using wrappers and using credentials in a somewhat efficient way.
    Now the test snippet looks like this:
    import java.io.*;
    import java.security.PrivilegedAction;
    import java.util.Properties;
    import javax.jms.*;
    import javax.naming.*;
    import javax.security.auth.Subject;
    import javax.security.auth.login.LoginException;
    import javax.servlet.http.*;
    import weblogic.jndi.Environment;
    import weblogic.security.auth.Authenticate;
    public class JMSWrapperCredentialsTest extends HttpServlet {
        QueueConnectionFactory factory = null;
        Queue queue = null;
        String jndiName = "java:comp/env/jms/QCF";
        String queueName= "jms/ColaEntradaConsultas";
        String user = "usuarioColas";
        String pwd = "12345678";
        String userjndi = "usuarioColas";
        String pwdjndi = "12345678";
        String serverT3URL="t3://127.0.0.1:7007";
        public void init() {
            setupJNDIResources();
        private void setupJNDIResources(){
            try {
                Properties props = new Properties();
                props.put("java.naming.factory.initial",
                        "weblogic.jndi.WLInitialContextFactory");
                props.put("java.naming.provider.url",serverT3URL );
                props.put("java.naming.security.principal", userjndi);// usr
                props.put("java.naming.security.credentials", pwdjndi);// pwd
                InitialContext ic = new InitialContext(props);
                factory = (QueueConnectionFactory) ic.lookup(jndiName);
                queue = (Queue) ic.lookup(queueName);
            } catch (NamingException e) {
                e.printStackTrace();
        public void service(HttpServletRequest req, HttpServletResponse res) {
            final HttpServletRequest fReq=req;
            final HttpServletResponse fRes=res;
            PrivilegedAction action = new java.security.PrivilegedAction() {
                public java.lang.Object run() {
                    performRequest(fReq,fRes);
                    return null;
            try {
                Subject subject=createSingleSubject(serverT3URL,user,pwd);
                weblogic.security.Security.runAs(subject, action);
            } catch (Exception e) {
                e.printStackTrace();
        public void performRequest(HttpServletRequest req, HttpServletResponse res) {
            res.setContentType("text/html");
            Writer wr = null;
            try {
                wr = res.getWriter();
                //Comment this out, do a lookup for each request and it will work
                //setupJNDIResources();
                String user = this.user;
                String pwd = this.pwd;
                //read users and passwords from the request in case they are present
                if (req.getParameter("user") != null) {
                    user = req.getParameter("user");
                if (req.getParameter("pwd") != null) {
                    pwd = req.getParameter("pwd");
                wr.write("JNDI  User: *" + userjndi + "* y pwd: *" + pwdjndi + "*<p>");
                wr.write("Queue User: *" + user + "* y pwd: *" + pwd + "*<p>");
                //Obtain a connection using user/pwd
                QueueConnection conn = factory.createQueueConnection(user, pwd);
                QueueSession ses = conn.createQueueSession(true,
                        Session.SESSION_TRANSACTED);
                QueueSender sender = ses.createSender(queue);
                TextMessage msg = ses.createTextMessage();
                msg.setText("Hi there!");
                conn.start();
                sender.send(msg);
                ses.commit();
                sender.close();
                ses.close();
                conn.close();
            } catch (Exception e) {
                e.printStackTrace();
                try {
                    wr.write(e.toString());
                } catch (Exception e2) {
                    e2.printStackTrace();
            finally{
                try {
                    wr.close();
                } catch (IOException e) {
                    e.printStackTrace();
        private Subject createSingleSubject(String providerUrl, String userName, String password) {
            Subject subject = new Subject();
            // Weblogic env class
            Environment env = new Environment();
            if(providerUrl!=null)
                env.setProviderUrl(providerUrl);
            env.setSecurityPrincipal(userName);
            env.setSecurityCredentials(password);
            try {
              // Weblogic Authenticate class will populate and Seal the subject
              Authenticate.authenticate(env, subject);
              return subject;
            catch (LoginException e) {
              throw new RuntimeException("Unable to Authenticate User", e);
            catch (Exception e) {
              throw new RuntimeException("Error authenticating user", e);
    }Thanks a lot for the help

  • CS3 - what container/wrappers does it accept?

    I asked this on the Premiere forum, but I suppose it's more of an Encore thread so I'm re-posting on here
    looking at the FAQ I can see what codecs it accepts but not what containers/wrappers it accepts those codecs in:
    http://livedocs.adobe.com/en_US/EncoreDVD/3.0/help.html?content=WS5C9E1CF8-B5BC-436f-89D3- 61DDC02A2C47.html
    does anyone know if any of the following will import?
    1080i/1080p mpeg2 with AC3 5.1 audio in TS container (.ts)
    720p mpeg2 with AC3 5.1 audio in TS container
    1080i/1080p h.264/avc with AC3 5.1 audio in TS container
    1080p wmv-hd VC-1 with wma 5.1 audio in WMV container
    720p h.264 with AC3 5.1 audio in MKV container
    1080i/1080p h.264/avc with AAC 5.1 audio in MP4 container
    most Hi-def videos these days are in these formats and I'm wanting to back mine up to Blu-ray and keep the 5.1 audio with no downmixing to stereo. Can Encore handle any/most/all of these formats?
    If it can't, can anyone suggest what to use to convert them to a format Encore would allow (except mpeg2 TS files which I can convert to mpeg2 PS or elementary streams)
    any help/advise would be greatly appreciated

    @ Matthew.
    Er, no chance will I be trying
    i that
    out!
    AC3 is already heavily compressed, so decoding to WAV and recompressing again is going to create a file that sounds bloody awful. Once the data has been tossed out in the original AC3 (Dolby Digital 5.1) creation, it is gone forever - and we are talking 6 channels at a minimum of 6,144 kbps to DD at 448 kbps. That's a lot to throw away, and it cannot be recovered again. If you started with 24 bit audio & used a licensed encoder, the loss is paradoxically not so great.
    (Wonder if the DD Decoder is actually licensed, or a hack job?)

  • Using WebLogic JMS Wrappers with Spring

    Hi,
    I was just wondering if anyone used WebLogic JMS wrappers with Spring?
    I am using WebLogic configured to have Sonic as my Foreign JNDI Provider. Weblogic provide me with specific entries on the admin console to set information such as the JNDI name of the Sonic Connection Factory. If I specify this JNDI name in the Spring config, and call getConnection() then I will get back a new connection each time.
    I don't want this, I want to cache the connection (as connections are expensive in Sonic). This is where the WebLogic JMS wrappers come in, they can handle the pooling for me but the only way I can see to use them is via a resource-ref. It is possible for Spring to get a handle onto these wrappers or should I use Spring's own pooling mechanism instead?
    P.S. I've also asked this question on the Spring forum
    Thanks for any help
    Mandy

    Maybe you have already tried the following:
    <beans xmlns:jee="http://www.springframework.org/schema/jee" ... >
    <jee:jndi-lookup id="connectionFactory" jndi-name="jms.ConnectionFactory">
    <jee:environment>
    java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
    java.naming.provider.url=t3://localhost:7001
    </jee:environment>
    </jee:jndi-lookup>
    </beans>
    an alternative is to use the JNDI template
    <beans ... >
    <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
    <props>
    <prop key="java.naming.factory.initial">weblogic.jndi.WLInitialContextFactory</prop>
    <prop key="java.naming.provider.url">t3://localhost:7001</prop>
    </props>
    </property>
    </bean>
    <bean id="connectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiTemplate" ref="jndiTemplate" />
    <property name="jndiName"><value>jms.ConnectionFactory</value></property>
    </bean>
    </beans>

  • Programs for creating executable wrappers?

    Hi there,
    I am searching for good/free java-executable wrappers (programs that create a double-clickable executable which automatically searches for an appropriate JVM).
    I already tried 2 opensource ones however both had problems with a non-standard jre setup :-(
    It would be great if you could list all programs you know so that I can test all of them and maybe a short description what you think whats good.
    This could become a list which would help other too searching for a list with comparison.
    Thank you in advance, lg Clemens

    JSmooth
    Launch4j
    jstart32
    exeJ
    Janel
    jstart
    Roxes Ant Tasks Marner Java Launcher
    jelude
    the list is taken from this article:
    " Convert Java to EXE: Why, When, When Not and How"
    http://www.excelsior-usa.com/articles/java-to-exe.html
    Denis

  • Errors/warnings occurred when generating the local proxy dll and VI wrappers for web service

    Hello,
    I'm new to web services - trying to import a WSDL that was created by an outside vendor and placed on a company server.  I imported a previous version successfully.  The error I'm getting doesn't make a lot of sense to me, here it is:
    The following errors/warnings occurred when generating the local proxy dll and VI wrappers for this web service.
    Can't generate files.
    Possible reasons are:
    1. The output file(s) might be read-only.
    Remove the read-only attribute and import the Web service again.
    2. A proxy DLL that LabVIEW created under the same file path exists in memory.
    Restart LabVIEW and import the Web service again.
    I don't see any read-only attributes on the output files and I've tried restarting LabVIEW - no luck.  Any help is greatly appreciated.
    Thanks,
    Al Rauch
    Merck & Co., Inc.

    Aaron,
    I was able to successfully import and run the web services from the WSDL file in question in LV2009 on a different computer than the one on which I had the original problem.  Unfortunately I am still having the original problem on the project computer and will need to get it working there . . . still looking for a solution to that.  Apparently LV2009 is perfectly capable of importing and running this WSDL file, but there is something still in the way on the project PC.
    Thanks,
    Al

  • Wrappers

    Looks like XMLBeans is very powerful and elegant technology for "correct"
    XML handling that has no equivalent competitor today. It's strange that so
    many people ask what is difference from JDOM/DOM/SAX/Castor etc...
    Questions:
    1. The wrappers that implement XSD-derived interfaces seem to be built
    dynamically from magic .xsb files. What motivated this architectural
    decision (versus generating java/class files) ?
    2. What is the performance difference (parsing speed, memory usage, number
    of objects) between using generated strongly-typed wrappers vs. using
    provided XmlObject type hierarchy ?
    thanks
    -gia

    Livid.War.Mole wrote:
    What is a wrapper class? I guess I'm just looking for a broad, yet simple definition with a illustrative example.You posted a broad yet simple definition in your original post and claimed you didn't understand it. (I like examples too.)
    Sorry if that is quite demanding. I came across the term as I was reading about Java I/O for the first time, and I have done some other reading, but I think it is always best to hear it from the perspective of a programmer in a practical context as opposed to a dictionary or a wikipedia article (no offense to you wikifanatics out there).The definition you posted sounds like the Facade pattern to me. I tend to think of the Decorator pattern as being wrappers, and I wouldn't have given the definition you posted at all. And I suspect you were reading about the Decorator pattern in that tutorial, too. A ZipOutputStream can wrap any kind of OutputStream, but generally it isn't simpler than them. In fact often it's more complex. So perhaps it's just one of those terms that different people use for different things.

  • RE: C Wrappering GetScope error follow-up

    How you solve the problem probably has a lot to do with what your C
    library is actually trying to do. The C wrappering I've done has all
    involved cases where I could get away with not needing to maintain any
    data bewteen method calls, and hence from the C libary's perspective,
    every call was self-contained. It sounds like this is not the case for
    you. Let's look at each of your cases individually.
    So where do I store the file pointers of the files that I want to access?Why do you want to store the C file pointers in Forte? Are you keeping
    the files open all the time? If so, maybe you want to consider opening
    and closing the files on every call into the C library. This
    introduces a bit more overhead, but prevents you from having to store
    any knowlege of the C file pointers in Forte.
    The pointer to char I can probably get round with a 'string', but even
    then I'd want to store the actual contents of the string in Forte's
    memory space!You could store the data as a string attribute in Forte. Then, when
    making a call into the C library, copy the string into a local variable
    of type "pointer to char" and pass that variable to C. If the C call
    might change the data, then upon returning from the call, copy the data
    back to the Forte string attribute. Again, a bit of overhead, but it
    gets around the problem.
    What your suggesting is that the C library itself should have appropriate
    static variables holding the pointer values themselves. Or is there
    another way to keep the pointers in Forte? The particular pointer I need
    is a pointer to long (or rather a pointer to 4 bytes of memory). I'm
    passing this to the C as a "long **" so that the C can actually change the
    pointer.I'm not certain I understand the need for the C routine to change the
    pointer value.....
    Dale
    ================================================
    Dale V. Georg
    Systems Analyst
    Indus Consultancy Services
    [email protected]
    ================================================

    On 28 Jan 98 at 21:49, Dale V. Georg wrote:
    It sounds from your description that you have pointer types as
    attributes on your Service Object class; is this correct?Yes.
    I tried this myself once, and even though, like you, I was careful to
    keep all access, mallocs, etc private to the SO itself, I had problems
    when I tried to run distributed. Forte Tech Support kindly slapped me
    on the wrists and told me not to use pointers to C structures as
    attributes on a Service Object. :) I forget the details of the
    explanation they gave me, but I believe the cause of the problem was
    that Forte couldn't properly create the proxies for the SO if there were
    C structures referenced by the attributes, even if those attributes were
    private.So where do I store the file pointers of the files that I want to access?
    The pointer to char I can probably get round with a 'string', but even
    then I'd want to store the actual contents of the string in Forte's
    memory space!
    What your suggesting is that the C library itself should have appropriate
    static variables holding the pointer values themselves. Or is there
    another way to keep the pointers in Forte? The particular pointer I need
    is a pointer to long (or rather a pointer to 4 bytes of memory). I'm
    passing this to the C as a "long **" so that the C can actually change the
    pointer.
    Thanks again for your help.
    Cheers,
    Duncan Kinnear,
    McCarthy and Associates, Email: [email protected]
    PO Box 794, McLean Towers, Phone: +64 6 834 3360
    Shakespeare Road, Napier, New Zealand. Fax: +64 6 834 3369
    Providing Integrated Software to the Meat Processing Industry for over 10 years

  • Advantages of wrappers over primitives

    1.) Can someone tell me what the advantages are of using wrappers (Integer, Double, etc.) for attributes of a class rather than their primitive counterparts?
    2.) I thought I had read that primitives would eventually be deprecated and removed from Java. Is there any truth to that?
    The advantage of wrappers I have seen mainly deal with being able to use the wrappers in collections.
    It seems so much easier to do math and such on primitives i = parm1 + parm2 rather than using i = new Integer(parm1.intValue() + parm2.intValue()); It also seems like memory requirements would be lower using primitives.
    Can someone set me straight?
    Thanks.

    1.) Can someone tell me what the advantages are of
    using wrappers (Integer, Double, etc.) for attributes
    of a class rather than their primitive counterparts?Well, a couple of nit picky things:
    a. you can synchronize on them.
    b. they work with collections, as you mentioned.
    c. Necessary for dynamically calling methods / constructors where a primitive is needed
    2.) I thought I had read that primitives would
    eventually be deprecated and removed from Java. Is
    there any truth to that?Haven't heard that, and I'd be very very ... very very very sketical if i heard such a thing. You are right; it would make java much more difficult to work with. The other thing is that the size of your average object is pretty small, so this would have a major effect on memory consumption.
    >
    The advantage of wrappers I have seen mainly deal
    with being able to use the wrappers in collections.yes
    >
    It seems so much easier to do math and such on
    primitives i = parm1 + parm2 rather than using i =
    new Integer(parm1.intValue() + parm2.intValue());
    ; It also seems like memory requirements would be
    lower using primitives.
    yes
    Can someone set me straight?
    Thanks.

Maybe you are looking for

  • What is happening with my Macs these days???

    Okay, two different Macs, both loaded with TONS of multi-media apps and supporting tech. One is a dual G5 and the other a 17" Macbook Pro. Both with the latest updates of everything I actively use. So, here are the issues I'm SUFFERING lately. MAIL:

  • Trouble connecting to Iphone software update server

    I am trying to update and Iphone4. When I try to download the new OS 5.1. Itunes tells me its having trouble connecting to the Iphone software update server and to check network connections or try again later. I have turned off virus software I am ru

  • Thirdparty Subcontracting

    Hi gurus....... My client wants following scenario to be mapped in SAP. My client gives raw material to his subcontracter. Then subcontractor makes processes on that and make finish product and then that subcontractor directly supplied finish product

  • Why does feba post to worng posting key?

    Generated IDoc from FEBA and processed an incoming payment . it was supposed to be posted to vendor but posts to customer in stead. Where can I check for FEBA related configuration and vendor customer relationship

  • Has anyone else been disappointed in their finished iPhoto book?

    I experienced several problems with poor quality results in my iphoto book received this January. I created it on the latest Macbook Air, using iPhoto "11. The cover was shoddily finished, the pages were wrinkled as if the book were shipped while sti