Platform Invoke in SUN's Java

The most of Java developer does not use (maybe cannot use) JNI. Because this API is very low and complex in use. But in some type applications developers need to call Native functions from system or other libraries. And the only decision is to write JNI code or to use some tools like xFunctions, JNIWrapper, etc. which are not easy. Why SUN does not developed something like Platform Invoke, which main idea is �declare� and "use"? For example, I want to call in C# function GetSystemMetrics I write code:
value class Win32 {
public
[DllImport("User32.dll")]
static int GetSystemMetrics(int);
enum class SystemMetricIndex {
// Same values as those defined in winuser.h.
SM_CXSCREEN = 0,
SM_CYSCREEN = 1
and call it
int main() {
int hRes = Win32::GetSystemMetrics( safe_cast<int>(Win32::SystemMetricIndex::SM_CXSCREEN) );
int vRes = Win32::GetSystemMetrics( safe_cast<int>(Win32::SystemMetricIndex::SM_CYSCREEN) );
Console::WriteLine("screen resolution: {0},{1}", hRes, vRes);
Very easy, semantic and syntax suitable to C#, no low level code like JNI.
So I tried to prove that the same can be done in Java and wrote my Platform Invoke for Java. In my API I can write as follows:
@NativeLibrary(name = "user32.dll")
public class User32Lib extends CNativeLibrary {
public static final int SM_CXSCREEN = 0;
public static final int SM_CYSCREEN = 1;
@NativeFunction(name = " GetSystemMetrics")
public native int GetSystemMetrics(int);
and in any Java method I can call this function:
User32Lib user32 = new User32Lib();
int hRes = user32.GetSystemMetrics(user32.SM_CXSCREEN );
int vRes = user32.GetSystemMetrics(user32.SM_CYSCREEN);
System.out.println("screen resolution: � + hRes + �,� + vRes);
In my API I added hidden marshal of arrays and simple data structures, explicit marshal (Marshal class) for complex data structures and Delegate class that makes Thunk for Java methods used as callbacks of native functions. I do not claim that in this case JNI will not be used. But the most Java developers will be able to write code without JNI use.
Message was edited by:
vitallis
Message was edited by:
vitallis
Message was edited by:
vitallis
Message was edited by:
vitallis
Message was edited by:
vitallis

JNative, See:
http://jnative.free.fr/SPIP-v1-8-3/article.php3?id_art
icle=4Thank you, but I am the developper of JNative ;)
J/Invoke had been finished some day ago and should
pass QA. It will be a part of OLEJA
(http://www.simtel.net/product.php%5bid%5d93010%5bSite
ID%5dsimtel.net) because J/Invoke supports calls to
native functions from Virtual Table. That is COM
native interfaces can be implemented in Java easy.So it is a commercial product. Our license terms are incompatible.
--Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Using Linux/Red Hat/Intel for Sun ONE/Java Directory Server

    Anybody have any experience of this? We're looking to get off AIX, and Total Cost of Ownership for using Solaris/Sparc versus Linux/Intel is very similar.
    The decider will be if no-one is using Linux as a platform for Sun ONE/Java Directory Server....
    Any feedback would be appreciated....

    We run Directory 5.1 in production on Solaris/Sparc, but I've tried it with sucess on Red Hat 7.2 on Intel. We have not been able to get it to work on Red Hat Enterprise 2.1 or 3.0. The main problem has been that the administration server fails on startup. Obvious the lack of support for the latest enterprise class Linux is a huge drawback. At this point I've decided to stay on Solaris/Sparc until Red Hat comes out with its own release of Netscape's Directory. When that happens we're going to evaluate whether to move the whole environment to Red Hat. The Sun and Netscape servers are almost identical in terms of features and performance, but having an open source version that can run on less expensive hardware would be a terrific win for us.

  • Error when invoking Rule Engine using Java API

    Hi,
    I have implemented a Java class which calls the Rule Engine to execute the rules. If I test by setting the value of the input inside a main method and get the output, it is working fine. The ruleset is also invoked and there is no problem. However, when I expose this java class as a web service and invoke the web service, I get the below error. I dont get the error if the .rules file is not present in the loaction mentioned. I get the error when the .rules file is present in the location. Not sure if this is an issue with the java call outs or loading the dictionary.
    Error:_
    <faultcode>S:Server</faultcode>
    <faultstring>oracle/rules/sdk2/exception/SDKException</faultstring>
    <ns2:exception xmlns:ns2="http://jax-ws.dev.java.net/" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false" class="java.lang.NoClassDefFoundError">
    <message>oracle/rules/sdk2/exception/SDKException</message>
    <ns2:stackTrace>
    <ns2:frame line="38" file="ImplementRules.java" method="Query" class="oracle.rules.querystudentcriteria.ImplementRules"/>
    <ns2:frame line="native" file="NativeMethodAccessorImpl.java" method="invoke0" class="sun.reflect.NativeMethodAccessorImpl"/>
    <ns2:frame line="39" file="NativeMethodAccessorImpl.java" method="invoke" class="sun.reflect.NativeMethodAccessorImpl"/>
    <ns2:frame line="25" file="DelegatingMethodAccessorImpl.java" method="invoke" class="sun.reflect.DelegatingMethodAccessorImpl"/>
    <ns2:frame line="597" file="Method.java" method="invoke" class="java.lang.reflect.Method"/>
    <ns2:frame line="101" file="WLSInstanceResolver.java" method="invoke" class="weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker"/>
    <ns2:frame line="83" file="WLSInstanceResolver.java" method="invoke" class="weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker"/>
    <ns2:frame line="152" file="InvokerTube.java" method="invoke" class="com.sun.xml.ws.server.InvokerTube$2"/>
    <ns2:frame line="264" file="EndpointMethodHandler.java" method="invoke" class="com.sun.xml.ws.server.sei.EndpointMethodHandler"/>
    <ns2:frame line="93" file="SEIInvokerTube.java" method="processRequest" class="com.sun.xml.ws.server.sei.SEIInvokerTube"/>
    <ns2:frame line="604" file="Fiber.java" method="__doRun" class="com.sun.xml.ws.api.pipe.Fiber"/>
    <ns2:frame line="563" file="Fiber.java" method="_doRun" class="com.sun.xml.ws.api.pipe.Fiber"/>
    <ns2:frame line="548" file="Fiber.java" method="doRun" class="com.sun.xml.ws.api.pipe.Fiber"/>
    <ns2:frame line="445" file="Fiber.java" method="runSync" class="com.sun.xml.ws.api.pipe.Fiber"/>
    <ns2:frame line="275" file="WSEndpointImpl.java" method="process" class="com.sun.xml.ws.server.WSEndpointImpl$2"/>
    <ns2:frame line="454" file="HttpAdapter.java" method="handle" class="com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit"/>
    <ns2:frame line="250" file="HttpAdapter.java" method="handle" class="com.sun.xml.ws.transport.http.HttpAdapter"/>
    <ns2:frame line="140" file="ServletAdapter.java" method="handle" class="com.sun.xml.ws.transport.http.servlet.ServletAdapter"/>
    <ns2:frame line="319" file="HttpServletAdapter.java" method="run" class="weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke"/>
    <ns2:frame line="232" file="HttpServletAdapter.java" method="post" class="weblogic.wsee.jaxws.HttpServletAdapter"/>
    <ns2:frame line="310" file="JAXWSServlet.java" method="doPost" class="weblogic.wsee.jaxws.JAXWSServlet"/>
    <ns2:frame line="727" file="HttpServlet.java" method="service" class="javax.servlet.http.HttpServlet"/>
    <ns2:frame line="87" file="JAXWSServlet.java" method="service" class="weblogic.wsee.jaxws.JAXWSServlet"/>
    <ns2:frame line="820" file="HttpServlet.java" method="service" class="javax.servlet.http.HttpServlet"/>
    <ns2:frame line="227" file="StubSecurityHelper.java" method="run" class="weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction"/>
    <ns2:frame line="125" file="StubSecurityHelper.java" method="invokeServlet" class="weblogic.servlet.internal.StubSecurityHelper"/>
    <ns2:frame line="292" file="ServletStubImpl.java" method="execute" class="weblogic.servlet.internal.ServletStubImpl"/>
    <ns2:frame line="26" file="TailFilter.java" method="doFilter" class="weblogic.servlet.internal.TailFilter"/>
    <ns2:frame line="56" file="FilterChainImpl.java" method="doFilter" class="weblogic.servlet.internal.FilterChainImpl"/>
    <ns2:frame line="326" file="DMSServletFilter.java" method="doFilter" class="oracle.dms.wls.DMSServletFilter"/>
    <ns2:frame line="56" file="FilterChainImpl.java" method="doFilter" class="weblogic.servlet.internal.FilterChainImpl"/>
    <ns2:frame line="3592" file="WebAppServletContext.java" method="run" class="weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction"/>
    <ns2:frame line="321" file="AuthenticatedSubject.java" method="doAs" class="weblogic.security.acl.internal.AuthenticatedSubject"/>
    <ns2:frame line="121" file="SecurityManager.java" method="runAs" class="weblogic.security.service.SecurityManager"/>
    <ns2:frame line="2202" file="WebAppServletContext.java" method="securedExecute" class="weblogic.servlet.internal.WebAppServletContext"/>
    <ns2:frame line="2108" file="WebAppServletContext.java" method="execute" class="weblogic.servlet.internal.WebAppServletContext"/>
    <ns2:frame line="1432" file="ServletRequestImpl.java" method="run" class="weblogic.servlet.internal.ServletRequestImpl"/>
    <ns2:frame line="201" file="ExecuteThread.java" method="execute" class="weblogic.work.ExecuteThread"/>
    <ns2:frame line="173" file="ExecuteThread.java" method="run" class="weblogic.work.ExecuteThread"/>
    </ns2:stackTrace>
    The Java class looks like:
    public PersonType Query (PersonType p)
    try {
    //FileReader reader = new FileReader("/home/orasoa/223345/STRS1.rules");
    //FileReader reader = new FileReader("D:\\Arun\\NGCE_WS\\POC1\\UHG\\QueryStudentCriteria\\oracle\\rules\\querystudentcriteria\\STRS1.rules");
    InputStream stream=ImplementRules.class.getResourceAsStream("/STRS1.rules");
    Reader reader=new InputStreamReader(stream);
    RuleDictionary dict = RuleDictionary.readDictionary(reader, new DecisionPointDictionaryFinder(null));
    List<SDKWarning> warnings = new ArrayList<SDKWarning>();
    dict.update(warnings);
    DecisionPoint decisionPoint = new DecisionPointBuilder().with("STRS1_DecisionService_1").with(dict).build();
    DecisionPointInstance point = decisionPoint.getInstance();
    ArrayList input=new ArrayList();
    input.add(p);
    point.setInputs(input);
    List<Object> output=point.invoke();
    catch (Exception e) {}
    return p;
    Cheers,
    - AR

    Hi, I am getting a similar error when I deploy my application on the weblogic server.
    Could you detail how this was resolved?
    Thanks,
    SB

  • Sun One Java mobile Application start error

    Hi,
    I established sun one java mobile application builder but I coudn not start it . when it come to %27 it show me this messagebox "This application has unexpectedly has caused an ExceptionInInitializerError. This Application will now exit (LAX)"
    in detail
    "java.lang.NullPointerException
         at com.aligo.tools.action.NewApplicationAction.<clinit>(NewApplicationAction.java:34)
         at com.aligo.tools.applicationbuilder.ApplicationBuilder.defineActions(ApplicationBuilder.java:460)
         at com.aligo.tools.applicationbuilder.ApplicationBuilder.<init>(ApplicationBuilder.java:325)
         at com.aligo.tools.applicationbuilder.ApplicationBuilder.<init>(ApplicationBuilder.java:82)
         at com.aligo.tools.applicationbuilder.ApplicationBuilder$83.construct(ApplicationBuilder.java:3278)
         at com.aligo.tools.thread.SwingWorker$2.run(SwingWorker.java:149)
         at java.lang.Thread.run(Thread.java:484)
         at com.aligo.tools.thread.SwingWorker.start(SwingWorker.java:192)
         at com.aligo.tools.applicationbuilder.ApplicationBuilder.main(ApplicationBuilder.java:3325)
         at java.lang.reflect.Method.invoke(Native Method)
         at com.zerog.lax.LAX.launch(DashoA8113)
         at com.zerog.lax.LAX.main(DashoA8113)"
    Please help me..
    Thanks ...

    This question does not appear to relate to Java Studio Enterprise. Try locating the forum for the product you are using, and ask your question there.

  • New Patch (Web)Forms  with Sun's Java Plugin 1.4 certified - when?

    Hello,
    We are waiting for the new patch version for Forms6i or Forms9i with
    Sun's java Plugin on client platforms like Linux,... certified.
    But when will it be available?
    Peter

    Peter,
    Sun's Plugin 1.4 was certified with Forms6i patch 12. The forms9i certification comes with teh first patch set.
    Frank

  • Invoking Microsoft Word from Java code

    I want to invoke Microsoft word from Java code. How can i do this plz ............... Help

    do something along these lines.... here is an example with notepad
    create a .bat file with the commmand in to run notepad for example
    notpad c:\test.txtthis command calls notepad and passes it the argument C:\test.txt which is the file and it's location, that I want to open.
    The Java program
    import java.util.*;
    import java.io.*;
    public class Run
    public static void main(String args[])
        try
           //the name of the batch file with your commands in
           String command ="runprog.bat";
           //get the runtime 
           Runtime rt  = Runtime.getRuntime();
           //run the bat file  
           Process proc = rt.exec(command);
          //wait for the program to exit i.e notepad then get the return code
          int exitVal = proc.waitFor();
          //print out the exit value
          System.out.println(2THe Process exit value is: " + exitVal);
      catch(Throwable t)
         t.printStackTrace();
    }have a look at this
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html
    and this
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps_p.html

  • Dead-end with EJB3.0 and Sun's Java WebApp

    Hi,
    Wondering if you can help me as I'm a bit stuck with my EJB3.0 remote connection using Sun's Java WebApp9.0 Server.
    Quick over-view:
    I have a Client.war file which contains my Servlets and the Remote interfaces for teh EJB and other 'client' classes
    I have a EJB.jar which contains the EJBs with their interfaces
    I need to make a remote connection to the CreateNewUserAccountBean (Stateless) which connects to the Uploader (Entity) Bean
    I have tried to post all the relivent parts of the code, but it's quite hard to make sure I have everything.
    My code gets as far as the [InitialContext ic = new InitialContext(this.getEjbRemoteProps());] then bombs out claiming it can not find the Uploader class (under EJB.jar)
    As I say, there is rather a lost here and it's not the easiest to look through, but kust wondering if there are any glaring erroes in the code.
    All the code bits.........
    THESE ARE IN THE CLIENT WAR
    ============================
    CreateUserAccountServlet
    code:
         final private boolean uploadUserAccountDetails(CreateNewUserAccountBean crUsrAccBean) {
              System.out.println("uploadUserAccountDetails()");
              try {
                   System.out.println("point 1");
                   ICreateUserAccountManager crUsrAccMan = new CreateUserAccountManager();
                   isSuccessful = crUsrAccMan.uploadAccountDetails(crUsrAccBean);
              } catch (NamingException e) {
                   e.printStackTrace();
                   isSuccessful = false;
              return isSuccessful;
    CreateUserAccountManager
    code:
         final public boolean uploadAccountDetails(CreateNewUserAccountBean crUsrAccBean) throws NamingException {
              System.out.println("point 2");
              IRemoteEjbConnector remEjbConn = new RemoteEjbConnectionManager();
              ICreateAccountRemote createAccRem = remEjbConn.createUserAccountRemoteConnection();
              createAccRem.setFirstname(crUsrAccBean.getFirstname());
              isValid = remEjbConn.uploadAccountDetails(createAccRem);
              return isValid;          
    RemoteEjbConnectionManager
    code:
    final private Properties getEjbRemoteProps() {
              Properties props = new Properties();
              // To be put into a Properties file!
         props.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
         props.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
         props.setProperty("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
         props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
         props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");          
              return props;
         final public ICreateAccountRemote createUserAccountRemoteConnection() throws NamingException {
              System.out.println("point 3");
              InitialContext ic = new InitialContext(this.getEjbRemoteProps());
              System.out.println("point 4");
              // ##### SEEMS TO ONLY GET THIS FAR, THEN BOMBS OUT! #####
              ICreateAccountRemote createAccRem = (ICreateAccountRemote) ic.lookup("createNewUserAccountEjb");
              System.out.println("point 5");
              return createAccRem;
    THESE TWO ARE IN THE EJB3.0 JAR
    ===============================
    CreateNewUserAccountBean
    code:
         @Stateless (mappedName="createNewUserAccountEjb")
         @Remote ({ICreateAccountRemote.class})
         public Uploader findByPrimaryKey(String fname) {
              Uploader uploader;
              try {
                   EntityManager em = emf.createEntityManager();
                   uploader = (Uploader)em.find(Uploader.class, fname);
                   em.close();
                   return uploader;
              } catch (Exception ex) {
                   ex.printStackTrace();
                   uploader = null;
              return uploader;
    ICreateAccountRemote
    ======================
    code:
    @Remote
    public interface ICreateAccountRemote {
    public String getFirstname();
    public void setFirstname(String sFname);
    public boolean createNewUserAccount();
    public Uploader findByPrimaryKey(String name);
    Uploader
    code:
         @Entity
         @Table(name="tbl_user_details")
    persistence.xml (under EJB.jar)
    ================================
    code:
    <?xml version="1.0" encoding="UTF-8"?>
    <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
         <persistence-unit name="create_account_persistence_ctx" transaction-type="JTA">
              <provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
                   <jta-data-source>jdbc/testDB</jta-data-source>
              <properties>
                   <!-- empty -->
              </properties>
         </persistence-unit>
    </persistence>
    SERVER.LOG OUTPUT
    =================
    code:
    [#|2008-08-26T10:15:55.387+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|2008-08-26 10:15:55,387 INFO [com.test.client.web.pageloader.PageLoader] - <Loading page [pages/welcome.jsp]>
    |#]
    [#|2008-08-26T10:15:58.662+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|2008-08-26 10:15:58,662 INFO [com.test.client.web.servlets.CreateUserAccountServlet] - <createUserAccount()>
    |#]
    [#|2008-08-26T10:15:58.662+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|2008-08-26 10:15:58,662 INFO [com.test.client.web.servlets.CreateUserAccountServlet] - <iStep: 1>
    |#]
    [#|2008-08-26T10:15:58.662+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|loadRegistrationPage()|#]
    [#|2008-08-26T10:16:11.060+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=11;_ThreadName=httpWorkerThread-80-0;|
    2008-08-26 10:16:11,060 INFO [com.test.client.web.servlets.CreateUserAccountServlet] - <createUserAccount()>
    |#]
    [#|2008-08-26T10:16:11.060+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=11;_ThreadName=httpWorkerThread-80-0;|2008-08-26 10:16:11,060 INFO [com.test.client.web.servlets.CreateUserAccountServlet] - <iStep: 2>
    |#]
    [#|2008-08-26T10:16:11.150+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=11;_ThreadName=httpWorkerThread-80-0;|>> CreateUserAccountServlet step 2 - crUsrAccBean.setFirstname: bob|#]
    [#|2008-08-26T10:16:11.150+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=11;_ThreadName=httpWorkerThread-80-0;|
    >> CreateUserAccountServlet step 2 - crUsrAccBean.setSurname: fish|#]
    [#|2008-08-26T10:16:11.170+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=11;_ThreadName=httpWorkerThread-80-0;|
    validateRegistrationDetails()|#]
    [#|2008-08-26T10:16:11.210+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=11;_ThreadName=httpWorkerThread-80-0;|
    loadRegistraionConfirmation()|#]
    [#|2008-08-26T10:16:12.822+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|
    2008-08-26 10:16:12,822 INFO [com.test.client.web.servlets.CreateUserAccountServlet] - <createUserAccount()>
    |#]
    [#|2008-08-26T10:16:12.822+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|2008-08-26 10:16:12,822 INFO [com.test.client.web.servlets.CreateUserAccountServlet] - <iStep: 3>
    |#]
    [#|2008-08-26T10:16:12.832+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|>> CreateUserAccountServlet step 3 - crUsrAccBean.setFirstname: bob|#]
    [#|2008-08-26T10:16:12.832+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|
    >> CreateUserAccountServlet step 3 - crUsrAccBean.setSurname: fish|#]
    [#|2008-08-26T10:16:12.832+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|
    uploadUserAccountDetails()|#]
    [#|2008-08-26T10:16:12.832+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|
    point 1|#]
    [#|2008-08-26T10:16:12.832+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|
    point 2|#]
    [#|2008-08-26T10:16:12.862+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|
    point 3|#]
    [#|2008-08-26T10:16:12.882+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|
    point 4|#]
    [#|2008-08-26T10:16:12.882+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|
    java.naming.factory.initial: com.sun.enterprise.naming.SerialInitContextFactory|#]
    [#|2008-08-26T10:16:12.882+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|
    java.naming.factory.url.pkgs: com.sun.enterprise.naming|#]
    [#|2008-08-26T10:16:12.882+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|
    java.naming.factory.state: com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl|#]
    [#|2008-08-26T10:16:12.892+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|
    org.omg.CORBA.ORBInitialHost: localhost|#]
    [#|2008-08-26T10:16:12.892+0100|INFO|sun-appserver-pe9.0|javax.enterprise.system.stream.out|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;|
    org.omg.CORBA.ORBInitialPort: 3700|#]
    [#|2008-08-26T10:16:13.043+0100|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.web|_ThreadID=12;_ThreadName=httpWorkerThread-80-1;_RequestID=c61ac1aa-c2f1-4535-941f-572cf6e3e528;|StandardWrapperValve[RegisterUserAccount]: Servlet.service() for servlet RegisterUserAccount threw exception
    java.lang.NoClassDefFoundError: com/test/ejb/user/createaccount/Uploader
         at java.lang.Class.getDeclaredMethods0(Native Method)
         at java.lang.Class.privateGetDeclaredMethods(Class.java:2365)
         at java.lang.Class.privateGetPublicMethods(Class.java:2488)
         at java.lang.Class.getMethods(Class.java:1406)
         at com.sun.ejb.codegen.RemoteGenerator.<init>(RemoteGenerator.java:108)
         at com.sun.ejb.EJBUtils.loadGeneratedRemoteBusinessClasses(EJBUtils.java:367)
         at com.sun.ejb.EJBUtils.loadGeneratedRemoteBusinessClasses(EJBUtils.java:332)
         at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:297)
         at com.sun.ejb.containers.RemoteBusinessObjectFactory.getObjectInstance(RemoteBusinessObjectFactory.java:61)
         at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
         at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:314)
         at javax.naming.InitialContext.lookup(InitialContext.java:351)
         at com.test.client.ejb.RemoteEjbConnectionManager.createUserAccountRemoteConnection(RemoteEjbConnectionManager.java:53)
         at com.test.client.user.account.CreateUserAccountManager.uploadAccountDetails(CreateUserAccountManager.java:55)
         at com.test.client.web.servlets.CreateUserAccountServlet.uploadUserAccountDetails(CreateUserAccountServlet.java:225)
         at com.test.client.web.servlets.CreateUserAccountServlet.createUserAccount(CreateUserAccountServlet.java:168)
         at com.test.client.web.servlets.CreateUserAccountServlet.doPost(CreateUserAccountServlet.java:43)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:278)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
         at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
         at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
         at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:231)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
         at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
         at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
         at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
         at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
         at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
    |#]
    Any help would be fantastic, cheers!!!

    KPS_UK wrote:
    It has been deployed, incorrectly.
    it's in the ejb.jar which is deplyed under the 'Applications/EJB Modules' in Sun's WebApp 9.0.it's still incorrect - the app server is telling you so.
    I don't know if there is any other config that needs to be done with the WebApp to tell it where the WebApp .war should look to find the EJB Module?I use weblogic, so I don't know. Without seeing anything else, I'd say it's not packaged correctly. You think that class is available, but the app server disagrees with you. Believe the app server and figure out where you've gone wrong. Check your assumptions.
    %

  • Problem instatiating factory implementation when invoking a service in java

    Hello,
    I' have the following problem: When I invoke a service from java code (it is a customized policy step implementation of a server agent), I get the following exception (some part of the error message description is german because it's a german versin of the SOA Suite, my translations are in []):
    error.build.wsdl.model: oracle.j2ee.ws.common.tools.api.WsdlValidationException: modeler error: Problem instantiating factory implementation.:
         Fehlende Klasse [missing class]: oracle.webservices.wsdl.WSDLFactoryImpl
         Abhängige Klasse [dependent class]: javax.wsdl.factory.WSDLFactory
         Loader: oracle.jwsdl:10.1.3
         Code-Source: /C:/product/10.1.3.1/OracleAS_1/webservices/lib/orawsdl.jar
         Konfiguration [Configuration]: <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar
    Diese Load wurde um oracle.wsm.agent:10.1.3.1 mit der Methode Class.forName() eingeleitet [This load was introduced/caused with/by method Class.forName() on...].
    Die fehlende Klasse ist in den folgenden Speicherorten verfügbar [The missing class is available in the following location]:
         1. Code-Source: /C:/product/10.1.3.1/OracleAS_1/webservices/lib/orawsdl.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar)
         Diese Code-Source ist im Loader oracle.jwsdl:10.1.3 verfügbar [This source code is available in loader oracle.jwsdl:10.1.3].
    : oracle.classloader.util.AnnotatedClassNotFoundException:
         Fehlende Klasse [missing class]: oracle.webservices.wsdl.WSDLFactoryImpl
         Abhängige Klasse [dependent class]: javax.wsdl.factory.WSDLFactory
         Loader: oracle.jwsdl:10.1.3
         Code-Source: /C:/product/10.1.3.1/OracleAS_1/webservices/lib/orawsdl.jar
         Konfiguration: <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar
    Diese Load wurde um oracle.wsm.agent:10.1.3.1 mit der Methode Class.forName() eingeleitet.
    Die fehlende Klasse ist in den folgenden Speicherorten verfügbar:
         1. Code-Source: /C:/product/10.1.3.1/OracleAS_1/webservices/lib/orawsdl.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar)
         Diese Code-Source ist im Loader oracle.jwsdl:10.1.3 verfügbar.
         at oracle.classloader.PolicyClassLoader.handleClassNotFound (PolicyClassLoader.java:2068) [C:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
         at oracle.classloader.PolicyClassLoader.internalLoadClass (PolicyClassLoader.java:1679) [C:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
         at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1635) [C:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
         at oracle.classloader.PolicyClassLoader.loadClass (PolicyClassLoader.java:1620) [C:/product/10.1.3.1/OracleAS_1/j2ee/home/lib/pcl.jar (from system property java.class.path), by sun.misc.Launcher$AppClassLoader@10469011]
         at java.lang.ClassLoader.loadClassInternal (ClassLoader.java:319) [jre bootstrap, by jre.bootstrap:1.5.0_06]
         at java.lang.Class.forName0 (Native method) [unknown, by unknown]
         at java.lang.Class.forName (Class.java:242) [jre bootstrap, by jre.bootstrap:1.5.0_06]
         at javax.wsdl.factory.WSDLFactory.newInstance (WSDLFactory.java:75) [C:/product/10.1.3.1/OracleAS_1/webservices/lib/orawsdl.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oracle.jwsdl:10.1.3]
         at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLModeler.buildModel (WSDLModeler.java:137) [C:/product/10.1.3.1/OracleAS_1/webservices/lib/wsclient.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oracle.ws.client:10.1.3]
         at oracle.j2ee.ws.common.processor.config.ModelInfo.buildModel (ModelInfo.java:167) [C:/product/10.1.3.1/OracleAS_1/webservices/lib/wsclient.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\product\10.1.3.1\OracleAS_1\j2ee\home\oc4j.jar), by oracle.ws.client:10.1.3]
         at oracle.j2ee.ws.client.dii.ServiceInfoBuilder.getModel (ServiceInfoBuilder.java:196)
    at ... ...
    at ... ...
    Here is the relevant part of my source code:
    import javax.xml.rpc.ServiceFactory;
    import javax.xml.rpc.Service;
    import javax.xml.rpc.Call;
    // create service
    Service service = null;
    try{
         service = factory.createService(wsdlLocation, serviceName);
    // HERE (the line above) the exception is thrown!!!!
    catch (Exception e) {
    Does anybody have an idea what the reason for this problem is and how I can fix it?
    Thank you very much,
    Stefan

    Hello,
    I had to add the information, which jar-file has to be used, into the build.xml that is used by the ant script.
    Now the missing class problem is solved, but now there is another (similar) problem:
    error.build.wsdl.model: oracle.j2ee.ws.common.tools.api.WsdlValidationException: modeler error: Problem instantiating factory implementation.: oracle.webservices.wsdl.WSDLFactoryImpl: java.lang.ClassCastException: oracle.webservices.wsdl.WSDLFactoryImpl
    at javax.wsdl.factory.WSDLFactory.newInstance(WSDLFactory.java:77)
    at oracle.j2ee.ws.common.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:137)
    at oracle.j2ee.ws.common.processor.config.ModelInfo.buildModel(ModelInfo.java:167)
    at oracle.j2ee.ws.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBuilder.java:196)
    at oracle.j2ee.ws.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBuilder.java:199)
    at oracle.j2ee.ws.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBuilder.java:181)
    at oracle.j2ee.ws.client.dii.ServiceInfoBuilder.buildServiceInfo(ServiceInfoBuilder.java:114)
    at oracle.j2ee.ws.client.dii.ConfiguredService.<init>(ConfiguredService.java:54)
    at oracle.j2ee.ws.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:43)
    at customsteps.StefansAspektStep.invokeService(Unknown Source)
    Any ideas? Do I have to set some System properties? What is the reason for this class cast error?

  • Can JRE for Sun One Java Directory Server 5.2 be upgraded to JRE 6.0 Update

    I am trying to upgrade jre installed with Sun One Java DS 5.2 from 1.5.0 to JRE 6.0 Updat 16. Is this possible?

    I never received any feedback on my question.
    I am attempting to upgrade our JRE version (installed with Sun One Directory Sever 5.2) from 1.4 to 1.6. I've installed JRE 1.6 Update 16 and set the JAVA_HOME environment variable to d:\programs\java\jre6 and don't know how to configure the directory server to run the 1.6 java version. Any help would be greatly appreciated.
    Edited by: CDRA on Feb 2, 2010 6:17 PM

  • I would like to know which Sun Cert Java Course I should take ???

    I am a very good C programmer that is trying to learn Java programming.
    I know my way around all the various programming statements such as if-then-else, switch etc etc ...
    I know the basics of an Applet and a Stand Alone application ...
    I feel that I need some grounding on OO Technology ...
    I would like to learn JAVA from where I am ...
    I have also been reading up a lot on Java Programming lately ...
    I am more of an Intermediate programmer ...
    I have seen the Sun Certified Java courses web page and is quite confused by the many assortment of courses available ...
    I would like to ask which Java Course is right for me at my level of programming experiences ???
    Thanks in advance !!!
    Andy

    My limited understanding is that there are two main tests you can go for. The first is the Programmer certification, which tests your knowledge of the Java language itself, so you're asked questions about very specific things about the language syntax and such. I think these questions are stupid, because they serve no practical purpose, and some questions are more of a test of your memory.
    Then you can take the Developer certification, which is focused more on evaulating and writing programs.
    I haven't taken either, but there are some good resources for preparing for these tests.
    http://www.javaprepare.com/quests/test.html

  • I would like to know which Sun Cert JAVA Course should I take ???

    I am a very good C programmer that is trying to learn Java programming.
    I know my way around all the various programming statements such as if-then-else, switch etc etc ...
    I know the basics of an Applet and a Stand Alone application ...
    I feel that I need some grounding on OO Technology ...
    I would like to learn JAVA from where I am ...
    I have also been reading up a lot on Java Programming lately ...
    I am more of an Intermediate programmer ...
    I have seen the Sun Certified Java courses web page and is quite confused by the many assortment of courses available ...
    I would like to ask which Java Course is right for me at my level of programming experiences ???
    Thanks in advance !!!
    Andy

    www.jcert.org has the information laid out a little better. I picked up Java without a formal course and I had about the same specs as you (although I had done a fair amount of c++ work). I would suggest the Java book by van der Linden (I know I'm not spelling the name right). I think it's called Just Java 2. Also Thinking in Java by Eckel has gotten good recommendations. For exam prep, the Exam Cram book by Brogden is highly recommended, but it won't teach you OO.

  • JavaEditorKit sun.tools.java.Constants jar help

    I found a good article on JavaEditorKit using JEditorPane.
    Problem is this article uses sun.tools.java.Constants. I could not find a jar that would provide the functionality.
    I was able to see api for sun.tools.java.Constants.
    I need someone to help me in getting the approriate jar.
    Thanks & Regards
    Ajay Kalidindi

    Hi,
    I saw that too thinking it would be a good way to learn about a simple editor in Java.
    I got it working only after upgrading the code to Java 2 (ie com.java to javax) and extracting out all of sun.tools.java package from tool.jar out of my jdk. It looked ok but I think this is way too old example to be using now days.
    I think that the sun.tools.java package has been protected from developers use so it wouldn't help you
    develope anything anyway, however http://www.jext.org uses a similiar idea to do its' syntax highlighting
    it might worth checking out.
    regards
    David

  • How to invoke dos shell from java program

    Hi,
    I'm not able to invoke dos shell from java.
    Can any one help me in this issue.
    I'm providing the source code below:
    try{
    Runtime.getRuntime().exec("cmd.exe")
    catch(IOException e) {
    System.out.println(e.getStackTrace());
    Thanks

    Does it throw a different exception?
    Or does it just do nothing at all?
    It does nothing at all[/b
    Is this a standalone Java app?
    Or a Java Applet running via a webbrowser? [b]It's a standalone application

  • How do I update Java(TM) Platform SE 7 U51Next Generation Java Plug-in 10.51.2 for Mozilla browsers

    I am suggested by the mozilla plugin manager that I need to UPDATE Java(TM) Platform SE 7 U51Next Generation Java Plug-in 10.51.2 for Mozilla browsers
    How do I do that and ask for it to be updated automatically
    Thanks in advance

    Hello eserub1, if you can not update from the next link : https://www.mozilla.org/en-US/plugincheck/ , choose the button '''Update Now''', then you have to manually install the offline version from the next link : http://www.java.com/en/download/manual.jsp (before you do that uninstall java from control panel > add or remove programs) and then install the new version.
    Note that because xp is unsupported for almost a year maybe it is better to do that manually (i do it in my xp !)
    thank you

  • How to invoke BPEL process from JAVA API

    Hi Guys
    Any idea if you can tell me how to invoke BPEL process from JAVA API ?
    What to do in BPEL process manager to achieve that?
    Regards
    Deepak

    See http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/invoke.htm#sthref1373 and the JavaDocs http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/toc.htm.

Maybe you are looking for