Stu Quinn

Ranch Hand
+ Follow
since Feb 27, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Stu Quinn

Deepak,

Thanks for the suggestion, however per the IBM docs I did not think this was necessary. Using RAD 8 over WebSphere 7 a client stub project was auto-generated and the jar is contained within the EAR I deployed for the service.

Below is an excerpt from the IBM docs http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.ejbfep.multiplatform.doc/info/ae/ae/rejb_3stubscmd.html

For many client-side scenarios, the WebSphere Application Server Just-In-Time (JIT) deployment feature dynamically generates the RMI-IIOP stub classes that are required for invocation of remote EJB 3.0 business interfaces. However, there are some scenarios where the JIT deploy environment is not available to dynamically generate these classes. In these scenarios, the createEJBStubs command must be used instead to generate and embed the client-side stub class files in your client application. If your client environment is one of the following, use the createEJBStubs command:

* "Bare" Java Standard Edition (SE) clients, where a Java SE Java Virtual Machine (JVM) is the client environment.
* A WebSphere Application Server container (web container, EJB container, or application client container) from a version earlier than version 7, or without the Feature Pack for EJB 3.0 applied.
* Non-WebSphere Application Server environments.



Perhaps I am missing something. I will follow up some more in the morning (USA PCT).

Stu
14 years ago
Good day,

I just installed RAD 8 over WebSphere 7.0 and want to knock out a simple example of an EJB 3.0 stateless session that is called from a java client. I have performed this over JBOSS and Glassfish in the past, but now seem to be tripping up on WebSphere. Must be doing something sideways. Port 2811 is the BOOTSTRAP_ADDRESS.

Here is the entry from the log on startup.
The server is binding the com.stu.sample.ejb.business.svc.CustomerSvcRemote interface of the CustomerSvc enterprise bean in the SampleEjbSvc.jar module of the SampleEjbEAR application. The binding location is: ejb/SampleEjbEAR/SampleEjbSvc.jar/CustomerSvc#com.stu.sample.ejb.business.svc.CustomerSvcRemote



Here is the jUnit test from a stand alone Java client.




Here is the exception
java.lang.ClassCastException: org.omg.stub.java.rmi._Remote_Stub incompatible with com.stu.sample.ejb.business.svc.CustomerSvcRemote
at com.stu.sample.ejb.business.svc.CustomerSvcTest.testHello(CustomerSvcTest.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)





Here is the bean impl



Here is the remote interface



Any help for this WebSphere newbie would be appreciated.

14 years ago
If near real-time is satisfactory your life may be simplified by persisting and then turning around and querying on your Java side.

If you want to pass each tick to Java that is going to be awkward. The out-of-the-box method to pass data between the two is via a web service (see Java4Ever trailer). This approach is not going to cut it for high volume, fine grained transactions.
Thank you for your recommendations. This works great. I had originally placed the file in \classes because there are some other related files at the root of \src and hence are copied to \classes. Your comments are right on and I will move my file to \WEB-INF.

I really appreciate the help.

Back in the saddle,
Stu
14 years ago
Hello,

I want to pull in an xml file, however I seem to be having difficulty with the relative path. The file is on the root of src and is therefore replicated into the root of classes, however this fails indicating the file reference is invalid.

I am within a war (within an ear) however I am not in a servlet so I cannot take advantage of servletContext.

The following code fails indicating file not found. Any suggestions?


String path = "/WEB-INF/classes/";

String fileName = "SearchCriteria.xml";

try {
Reader reader = new FileReader(path + fileName);
.
.
.

This is on WebSphere 6.0, jdk 1.4 (yes this is old, but I am promised a shiny new WAS 7.0 soon).


Thanks,
Stu
14 years ago
I neglected to mention where I found the solution:

http://www.jroller.com/mert/entry/jsfbarcodecreator_released_in_jsf_comp#comments

Life is good,
Stu
14 years ago
JSF
Yes, I am aware my platform is dated, however that was the hand I was dealt. I need a bumper sticker that reads "I would rather be coding EJB3 on JBOSS".

As for displaying the barcode I am supporting in-house PCs so I can load up a font. I will head down that route.

I ran across a JSF component that uses Barbeque. I will take a look at that as well.

Thanks,
Stu
14 years ago
JSF
Good day,

Web page development really is not my area and I need to determine the best approach to display a barcode. Any suggestions and snippets would be appreciated.

Note I am restricted to JDK 1.4 and JSF 1.1 running on Websphere 6.0.

Thanks for any assistance,
Stu

14 years ago
JSF
David,

Sorry I was not very clear. Yes, I only have one action class backing my .jsp form. What I meant was perhaps I was causing myself a problem because I was navigating off of my menu page and that menu page was using Action rather than DispatchAction. Of course, there may be something else wrong. However I wanted to communicate to folks reading the post that the code as written does actually work. The problem likes outside the scope of what I had originally posted and this is moving into a new question (can I use Action for one page and LookupDispatchAction for another page). Time to get back to reading the book and trying a few things.

Thanks for your interest and your feedback is appreciated.
14 years ago
Although I stated I was "following the example" there was one important difference. I had a been using simple menu and was navigating to a few different .jsp & action variants as I was learning Struts.

When I go directly to the .jsp that utilized the LookupDispatchAction it is working fine. Only when navigating from another .jsp which used the standard Action was it failing. Perhaps there are limitations regarding mixing and matching the different types of actions.


14 years ago
I am not sure what you mean by "looking on the wire" however I have looked at the actionmapping object passed into the execute method and parameter equals "submitMethod".

Thanks,
Stu

14 years ago
Good day,

After reviewing numerous posts and on-line tutorials I am having trouble identifying the problem with my sample struts code.

My action class extends LookupDispatchAction. If I include the execute method in my action class that is the only method that gets fired. If I do not include the execute method I receive the following error message.

  • [6/4/10 14:43:21:730 PDT] 0000001d RequestProces W org.apache.struts.action.RequestProcessor processException Unhandled Exception thrown: class javax.servlet.ServletException
    [6/4/10 14:43:21:761 PDT] 0000001d ServletWrappe E SRVE0068E: Could not invoke the service() method on servlet action. Exception thrown : javax.servlet.ServletException: Request[/customerEdit2] does not contain handler parameter named submitMethod



  • With any luck this will be obvious to somebody. I am just getting starting with Struts and I am stuck at this point.

    I am using JDK 1.4 and Struts 1.1.


    Here is a snippet of the action class (without the execute):


    Here is a snippet of the struts-config.xml (it also references the resources file, but I did not include that in the snippet).



    Here is the resources file:



    Here is a snippet of the .jsp




    Thanks for any help here.

    p.s. I welcome any opinions on the prefered methods for calling multiple methods from the Action class.
    14 years ago
    Prasad,

    I regularly test this way from JUnit running in Eclipse. Below are samples that are working just fine in JBOSS and GlassFish V2. The problem seems to be when attempting to narrow the remote object, but I am away from the laptop where I am having the problem at the moment. I need to see what it is trying to return.

    Samples that work:


    Thanks,
    Stu
    Good day,

    After using GlassFish v2 and JEE 5 I have decided to give GlassFish V3 and JEE 6 a go. I am using Eclipse V3.4 and have configured the GlassFish v3 JEE 6 Server Adapter. My server and client side apps are referencing the new libraries and I am ready to go. I have deployed my EJB 3 application successfully to the server, however I will be a son-of-a-gun if my client is having problems connecting via JNDI. The stacktrace indicates I am trying to grab an object that is not Remote, but that seems rather odd to me as this has not changed and it is in fact my @Remote interface to my session bean.

    Quick view of the implementation code:



    Now the remote interface:


    Now the client (this is JUnit)



    And here is the error I get when attempting to run the JUnit (again, this same code worked find under GlassFish v2)

    javax.naming.CommunicationException: Can't find SerialContextProvider [Root exception is java.lang.ClassCastException]
    at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:164)
    at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:409)
    at javax.naming.InitialContext.lookup(InitialContext.java:392)
    at com.quintessential.ub3.bam.IUB3Session_Physical_MeterReadPostingTest.setUp(IUB3Session_Physical_MeterReadPostingTest.java:46)
    at junit.framework.TestCase.runBare(TestCase.java:128)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:120)
    at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Caused by: java.lang.ClassCastException
    at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:258)
    at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
    at com.sun.enterprise.naming.SerialContext.narrowProvider(SerialContext.java:136)
    at com.sun.enterprise.naming.SerialContext.getCachedProvider(SerialContext.java:259)
    at com.sun.enterprise.naming.SerialContext.getRemoteProvider(SerialContext.java:204)
    at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:159)
    ... 14 more
    Caused by: java.lang.ClassCastException: Object is not of remote type com.sun.enterprise.naming.SerialContextProvider
    at com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:250)
    ... 19 more


    Thanks for any clues here,
    Stu
    If there is a need to keep track of Left & Right perhaps these can be subtypes.





    Good luck,
    Stu