http://localhost:8080/tomee/

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

http://localhost:8080/tomee/

Zahid Rahman
When I select the URL  Provider URL: http://localhost:8080/tomee/ejb

I get a blank page  even though I have the struts application  example
application installed.


*Am I supposed to get a blank page ?*

Provider URL: http://localhost:8080/tomee/ejb

Your server is fully installed.


http://localhost:8080/struts/listAllUsers.action

ID First Name Last Name
1 zahid amin
2 zahid amin
Footer


https://www.backbutton.co.uk/ <http://Backbutton.co.uk>
¯\_(ツ)_/¯
♡۶Java♡۶RMI ♡۶
<http://www.backbutton.co.uk>
Reply | Threaded
Open this post in threaded view
|

Re: http://localhost:8080/tomee/

David Blevins-2
> On Aug 18, 2020, at 11:37 AM, Zahid Rahman <[hidden email]> wrote:
>
> When I select the URL  Provider URL: http://localhost:8080/tomee/ejb
>
> I get a blank page  even though I have the struts application  example
> application installed.
>
>
> *Am I supposed to get a blank page ?*

Yes.  You can ignore that URL unless you need to do remote EJB calls over HTTP.  If you do need that, that end point will effectively allow you to use OpenEJB's binary protocol layered over HTTP.  To use it you point EJB clients to that endpoint when constructing the InitialContext and then they will open a socket to that URL, send the appropriate HTTP headers and then immediately switch to binary communication.

It doesn't have any relationship to Struts, HTML, REST or any kind of text or human readable/consumable information or UI.


-David


smime.p7s (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: http://localhost:8080/tomee/

Zahid Rahman
Provider URL: http://localhost:8080/tomee/ejb

THANK YOU.

*Effectively  I  am being SHOWN the end point url  to be used in the
calling client when EJB deployed in Tomee as seen in the code *

        Properties props = new Properties();
        props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.RemoteInitialContextFactory");
        props.put(Context.PROVIDER_URL, "http://127.0.0.1:8080/tomee/ejb");

*Creating an EJB in Eclipse, deploying on tomee  and calling it remotely
using  HTTP/HTTPS  is my final objective.*

*Is this client code up to date ?*

            Context ctx = new InitialContext(props);
            final Object ref = ctx.lookup("CalculatorImplRemote");
            Calculator calc = (Calculator) PortableRemoteObject.narrow(ref,
Calculator.class);

            double result = calc.add(10, 30);


public class JNDILookupTest {

    @Test
    public void test() {
        Properties props = new Properties();
        props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.openejb.client.RemoteInitialContextFactory");
        props.put(Context.PROVIDER_URL, "http://127.0.0.1:8080/tomee/ejb");
        try {
            Context ctx = new InitialContext(props);
            System.out.println("Found context " + ctx);
            final Object ref = ctx.lookup("CalculatorImplRemote");
            Calculator calc = (Calculator) PortableRemoteObject.narrow(ref,
Calculator.class);
            double result = calc.add(10, 30);
            Assert.assertEquals(40, result, 0.5);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }



https://www.backbutton.co.uk/ <http://Backbutton.co.uk>
¯\_(ツ)_/¯
♡۶Java♡۶RMI ♡۶
<http://www.backbutton.co.uk>


On Fri, 21 Aug 2020 at 22:03, David Blevins <[hidden email]> wrote:

> > On Aug 18, 2020, at 11:37 AM, Zahid Rahman <[hidden email]> wrote:
> >
> > When I select the URL  Provider URL: http://localhost:8080/tomee/ejb
> >
> > I get a blank page  even though I have the struts application  example
> > application installed.
> >
> >
> > *Am I supposed to get a blank page ?*
>
> Yes.  You can ignore that URL unless you need to do remote EJB calls over
> HTTP.  If you do need that, that end point will effectively allow you to
> use OpenEJB's binary protocol layered over HTTP.  To use it you point EJB
> clients to that endpoint when constructing the InitialContext and then they
> will open a socket to that URL, send the appropriate HTTP headers and then
> immediately switch to binary communication.
>
> It doesn't have any relationship to Struts, HTML, REST or any kind of text
> or human readable/consumable information or UI.
>
>
> -David
>
>