You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by mauro2java2011 <ma...@gmail.com> on 2014/01/03 17:19:53 UTC

call ejb remote not work. help me

HI .i have tried to call a ejb remote deployed on tomee from a tomcat7 plain.
>From the servlet deployed into tomcat plain i have:

@WebServlet(name = "ProvatestejbRemoto", urlPatterns = {"/prova"})
public class ProvatestejbRemoto extends HttpServlet {

    private TestBeanRemote myBean = null;

   
  
    @PostConstruct
    public void inizializzaEjb(){
  try {
            Properties p = new Properties();
            p.put("java.naming.factory.initial",
"org.apache.openejb.client.RemoteInitialContextFactory");
            p.put("java.naming.provider.url",
"http://localhost:8080/tomee/ejb");
// user and pass optional
//p.put("java.naming.security.principal", "myuser");// i not use the
security.
//p.put("java.naming.security.credentials", "mypass");// i not use the
security.

            InitialContext ctx = new InitialContext(p);

            myBean = (TestBeanRemote)
ctx.lookup("java:global/ejbsutomee/TestBean");
//theproject    name of the war deployed on tomee  is ejbsutomee.war

        } catch (Exception e) {
          //  e.printStackTrace(out);
        }   
    }
    
    
    protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();

       

        try {
            /* TODO output your page here. You may use following sample
code. */
            out.println("<!DOCTYPE html>");
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet ProvatestejbRemoto</title>");
            out.println("</head>");
            out.println("<body>");
            out.println("
Servlet ProvatestejbRemoto at " + request.getContextPath() + "
");
            out.println("the ejb remote says: " + myBean.hello());

            out.println("</body>");
            out.println("</html>");
        } finally {
            out.close();
        }
    }
}

-----------------
i have put the interface into my client project and i have put into the
calsspath the openejbclient.jar
but when i run the project client i get eroor :

HTTP Status 500 - Error instantiating servlet class srv.ProvatestejbRemoto

type Exception report

message Error instantiating servlet class srv.ProvatestejbRemoto

description The server encountered an internal error that prevented it from
fulfilling this request.

exception

javax.servlet.ServletException: Error instantiating servlet class
srv.ProvatestejbRemoto

org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)

org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)

org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)

org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	java.lang.Thread.run(Thread.java:724)

root cause

java.lang.NoClassDefFoundError: javax/ejb/EJBHome
	java.lang.Class.forName0(Native Method)
	java.lang.Class.forName(Class.java:270)
	com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:63)
	javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
	javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
	javax.naming.InitialContext.init(InitialContext.java:242)
	javax.naming.InitialContext.<init>(InitialContext.java:216)
	srv.ProvatestejbRemoto.inizializzaEjb(ProvatestejbRemoto.java:41)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:606)

org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)

org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)

org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)

org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	java.lang.Thread.run(Thread.java:724)

root cause

java.lang.ClassNotFoundException: javax.ejb.EJBHome

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)

org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
	java.lang.Class.forName0(Native Method)
	java.lang.Class.forName(Class.java:270)
	com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:63)
	javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
	javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
	javax.naming.InitialContext.init(InitialContext.java:242)
	javax.naming.InitialContext.<init>(InitialContext.java:216)
	srv.ProvatestejbRemoto.inizializzaEjb(ProvatestejbRemoto.java:41)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:606)

org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)

org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)

org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)

org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)

java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	java.lang.Thread.run(Thread.java:724)

note The full stack trace of the root cause is available in the Apache
Tomcat/7.0.41 logs.
Apache Tomcat/7.0.41







--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
i have tried with   http://localhost:8080/tomee/ejb  for get the
InitialContext of JNDI

i have also added the file ejb-jar-xml at war file  with 


<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns = "http://java.sun.com/xml/ns/javaee" 
         version = "3.1"
         xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" 
         xsi:schemaLocation = "http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd">

</ejb-jar>


but i get: 

run:
gen 07, 2014 10:26:59 AM org.apache.openejb.client.EventLogger log
INFO:
RemoteInitialContextCreated{providerUri=http://localhost:8080/tomee/ejb}
gen 07, 2014 10:27:01 AM mauro.clienttomee.MioClientTomee main
SEVERE: null
javax.naming.NameNotFoundException: global/ejbsutomee/TestBean does not
exist in the system.  Check that the app was successfully deployed.
	at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:319)
	at javax.naming.InitialContext.lookup(InitialContext.java:411)
	at mauro.clienttomee.MioClientTomee.main(MioClientTomee.java:36)

BUILD SUCCESSFUL (total time: 2 seconds)



--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4666994.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
i have packadge the ejb int oa war.
So how i have to override the name like propose above?
The ejb it is into a sample war not into a jar file
i think that i have to wirte into web.xml or create a ejb-jar.ml .
IANd int othe web.inf dir or int othe class/meta-inf dir?
or into root of web application /META_INF/ejb-jar-xml?

please i not use the xml configuration. i use annotation. 




--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667159.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
i publish also the JNDI tree af tomee  view from the remote tomcat client.

Servlet Servlet2 at /tomcat_ejb_client_tomee
contesto remoto=javax.naming.InitialContext@cab854 java.lang.String .

org.apache.openejb.core.ivm.naming.BusinessRemoteReference
EJBMauroEARRemoteimplRemote

javax.naming.Context global

javax.naming.Context EARMauro

javax.naming.Context EARMauro-ejb

org.apache.openejb.core.ivm.naming.BusinessRemoteReference
EJBMauroEARRemoteimpl!mauro.ejb.EJBMauroEARRemote

javax.naming.Context openejb

javax.naming.Context openejb

org.apache.openejb.core.ivm.naming.BusinessRemoteReference
User!org.apache.openejb.assembler.util.User

--------------------------------------------------------

JNDI Context:
  .=
 
EJBMauroEARRemoteimplRemote=proxy=org.apache.openejb.client.StatelessEJBObjectHandler@e06ce
  global=
  global/EARMauro=
  global/EARMauro/EARMauro-ejb=
 
global/EARMauro/EARMauro-ejb/EJBMauroEARRemoteimpl!mauro.ejb.EJBMauroEARRemote=proxy=org.apache.openejb.client.StatelessEJBObjectHandler@e0f0ad
  global/Ejbsutomee=
 
global/Ejbsutomee/Mauroejb!mauro.ejb.MauroInterfacciaejb=proxy=org.apache.openejb.client.StatelessEJBObjectHandler@1d8f162
  global/openejb=
  global/openejb/openejb=
 
global/openejb/openejb/ConfigurationInfo!org.apache.openejb.assembler.classic.cmd.ConfigurationInfo=ERROR:
Cannot lookup
'/global/openejb/openejb/ConfigurationInfo!org.apache.openejb.assembler.classic.cmd.ConfigurationInfo'.
 
global/openejb/openejb/Deployer!org.apache.openejb.assembler.Deployer=ERROR:
Cannot lookup
'/global/openejb/openejb/Deployer!org.apache.openejb.assembler.Deployer'.
  global/openejb/openejb/User!org.apache.openejb.assembler.util.User=ERROR:
Cannot lookup
'/global/openejb/openejb/User!org.apache.openejb.assembler.util.User'.
 
MauroejbRemote=proxy=org.apache.openejb.client.StatelessEJBObjectHandler@1cf662f
  MEJB=proxy=org.apache.openejb.client.StatelessEJBHomeHandler@13dd208
  openejb=
  openejb/ConfigurationInfoBusinessRemote=ERROR: Cannot lookup
'/openejb/ConfigurationInfoBusinessRemote'.
  openejb/DeployerBusinessRemote=ERROR: Cannot lookup
'/openejb/DeployerBusinessRemote'.
  openejb/UserBusinessRemote=ERROR: Cannot lookup
'/openejb/UserBusinessRemote'.

-------------------------------
so i think it is ok

mauro



--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667227.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
FINALLY IT WORK ALSO WIN7 but only with ear file and a application.xml file
and deployed int oapps idr of tomee and not  from webapps. 

*hi ALL . I post how i have deployed my ejb into tomee for call it from
another tomcat plain .*

*SERVER-SIDE (TOMEE) *

1) i have enable the apps directory for deploy ear fiels into apps dir of
tomee
2) i have packaged the appliaction into a ear file and i have pasted into
apps dir
3) the ear file containt: 

dir: META-INF/application.xml
dit lib //with a jar that contain the interfaces and other classes that bot
the ejb and web application can use .
a ejb.jar (in my case it is :EARMauro-ejb.jar
a war file(in my case it is:EARMAuro-war.war

*the application-xml war it containt: 


<?xml version="1.0" encoding="UTF-8"?>
<application version="6" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/application_6.xsd">
  <display-name>EARMauro</display-name>
  <module>
    <web>
      <web-uri>EARMauro-war.war</web-uri>
      <context-root>/EARMauro-war</context-root>
    </web>
  </module>
  <module>
    <ejb>EARMauro-ejb.jar</ejb>
  </module>
</application>*

i publish also image of my apps dir of tomee and inside the ear file 

<http://openejb.979440.n4.nabble.com/file/n4667226/the_application_xml_file.jpg> 

<http://openejb.979440.n4.nabble.com/file/n4667226/my_directory_apps_of_tomee.jpg> 
<http://openejb.979440.n4.nabble.com/file/n4667226/insideEARMAuro.jpg> 


-----------------
into CLIENT:SIDE : another tomcat plain instance.
i have created a web application for call the remote ejb on tomee .


i have put into the plain tomcat/lib the file javaee-api-6.0-5-tomcat.jar
and into the web-inf/lib of the web application of tomcat plain the file
openejb-client.jar and the jar file with the remote interfaces of ejb
deployed to tomee.


from a servlet inside the war client file i have called the remote ejb:

 protected void processRequest(HttpServletRequest request,
HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
       EJBMauroEARRemote eARRemote=null;
       
          InitialContext ctx = null;
          try {
          
           
             Properties p = new Properties();
            p.put("java.naming.factory.initial",
"org.apache.openejb.client.RemoteInitialContextFactory");
            p.put("java.naming.provider.url",
"http://127.0.0.1:8080/tomee/ejb");
// user and pass optional

//p.put("java.naming.security.principal", "myuser");
//p.put("java.naming.security.credentials", "mypass");
            ctx = new InitialContext(p);
            
       eARRemote=    
(EJBMauroEARRemote)ctx.lookup("global/EARMauro/EARMauro-ejb/EJBMauroEARRemoteimpl!mauro.ejb.EJBMauroEARRemote");
            /* TODO output your page here. You may use following sample
code. */
            out.println("<!DOCTYPE html>");
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet ServletEjb</title>");            
            out.println("</head>");
            out.println("<body>");
            out.println("
Servlet ServletEjb at " + request.getContextPath() + "
");
           out.println("Ejbremoto:"+eARRemote.commenta("prova chiamata da
tomcat a tomee"));
             out.println("</body>");
             out.println("<br/>");
             
             
            out.println("</body>");
            out.println("</html>");
        } catch (NamingException ex) {
           // Logger.getLogger(ServletEjb.class.getName()).log(Level.SEVERE,
null, ex);
            ex.printStackTrace(out);
        } finally {            
            out.close();
        }
    }


*and finally it work also with win7.*

i hope that the post help all persons that get erros from call the remote
ejb with win7.
I think that it is enable only form apps dir and not from webapps dir .





--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667226.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
response inline/below,


On Thu, Jan 16, 2014 at 8:00 AM, mauro2java2011 <ma...@gmail.com>wrote:

> I have successfully  with pachadged into a ear and the file application.xml
> that list the modules that contains.
>
> The call at name jndi that init with global/
> now it works with win7 .
>

can you reply with your code changes (and any other details) that is
working on win7? that may help others to respond to your other questions
below.



>
> But   how i can use with only war file without ear ?
> I have to put a ejb-jar.xml inside tge war ?
>
> I have to pachadge the ejb
>  into a jar or simple into war with ejb-jar.xml ?
>
> Whi with win7 the default name of ejb not work when deployed?
>
> But at deploy time from  console i read  the output that list the jndi
> names
> .
>
> Tomee it is a very interessant server and  many peapke use it with win7 .
> It is egnalatwd on jira?
>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667196.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>



On Thu, Jan 16, 2014 at 8:00 AM, mauro2java2011 <ma...@gmail.com>wrote:

> I have successfully  with pachadged into a ear and the file application.xml
> that list the modules that contains.
>
> The call at name jndi that init with global/
> now it works with win7 .
>
> But   how i can use with only war file without ear ?
> I have to put a ejb-jar.xml inside tge war ?
>
> I have to pachadge the ejb
>  into a jar or simple into war with ejb-jar.xml ?
>
> Whi with win7 the default name of ejb not work when deployed?
>
> But at deploy time from  console i read  the output that list the jndi
> names
> .
>
> Tomee it is a very interessant server and  many peapke use it with win7 .
> It is egnalatwd on jira?
>
>
>
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667196.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
I have successfully  with pachadged into a ear and the file application.xml
that list the modules that contains. 

The call at name jndi that init with global/
now it works with win7 .

But   how i can use with only war file without ear ? 
I have to put a ejb-jar.xml inside tge war ? 

I have to pachadge the ejb 
 into a jar or simple into war with ejb-jar.xml ? 

Whi with win7 the default name of ejb not work when deployed? 

But at deploy time from  console i read  the output that list the jndi names
.

Tomee it is a very interessant server and  many peapke use it with win7 .
It is egnalatwd on jira? 











--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667196.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
The URL to José topic

http://openejb.979440.n4.nabble.com/JNDI-Lookup-in-Windows-td4666860.html

On Jan 14, 2014 5:48 AM, "mauro2java2011" <ma...@gmail.com> wrote:
>
> Thanks for reporting that not only I had that problem with win7 and tomee
.
> I tried the link to the thread JOSE 'but can not find it.
>
> --
> View this message in context:
http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667158.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
Hello. You've solved long ago a problem with primefaces upload that I had
encountered with myfaces.
 
Thanks for reporting that not only I had that problem with win7 and tomee .
I tried the link to the thread JOSE 'but can not find it.
I tried to deploy the same EJB on glassfish on win 7.
Then I tried to call remote ejb from a servlet deployed into tomcat plain.
And it works in win7!

SO i think That it is a relative thing at Tome. Because if i call a remote
ejb installed on glassfsih it works.

Or at about JDK installed?

I have also tried with tomee 1.6.0 and 1.5.1 and 1.5.2 . But same result .

Mauro





--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667158.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
i have also  installed netbeans version development  int oubuntu .
It as a system for tomee integration .

When i create a persistence .xml it automatically create a resource.xml file
for example

<?xml version="1.0" encoding="UTF-8"?>
<resources>
  <Resource id="JNDIpippo" type="javax.sql.DataSource">#Sat Jan 11 12:22:03
CET 2014
jdbcDriver=org.apache.derby.jdbc.ClientDriver
password=app
userName=app
*jdbcUrl=jdbc\:derby\://localhost\:1527/sample*
</Resource>
</resources>

I have noted that  the url dor example after the word hdbc inset a \ and not
a / 

SO think the problem for the call ejb remote can are relative a difference
from path separators of sistem???

That into
context.lookup("java:global\\namemodoule\\nameofEJB!nameofinterface");





--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667160.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by Romain Manni-Bucau <rm...@gmail.com>.
yes but it has no link with the OS
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014/1/13 Howard W. Smith, Jr. <sm...@gmail.com>:
> see below...
>
> On Mon, Jan 13, 2014 at 12:50 PM, Howard W. Smith, Jr. <
> smithh032772@gmail.com> wrote:
>
>> Romain, do you remember that something like this was recently discussed on
>> this list. I think it was Jose' that had the same (or similar) issue. it
>> worked for him on linux but not on windows7. will have to search the list
>> for what finally resolved it for him.
>>
>>
> Re: JNDI Lookup in Windows
>
> On Mon, Dec 23, 2013 at 5:50 PM, José Luis Cetina <ma...@gmail.com>
>  wrote:
>
>> I override the applicationName for the ear (application.xml) and the module
>> name for the ejb module (in ejb-jar.xml), and now with my own values (not
>> default) the ejb can be found!!    :)
>>
>>
>> Then i use the java:global[/*application name*]/*module name*/*enterprise
>> bean name*[/*interface name*]
>>
>>
>> Then:
>> ctx.lookup("java:global/MyApplicationName/MyModuleName/
>> UsersFacade!com.mypackage.ejbs.UsersFacadeLocal");
>>
>> Done.
>>
>> I dont know why with didnt work with the default values.
>>
>> Thanks.
>>

Re: call ejb remote not work. help me

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
see below...

On Mon, Jan 13, 2014 at 12:50 PM, Howard W. Smith, Jr. <
smithh032772@gmail.com> wrote:

> Romain, do you remember that something like this was recently discussed on
> this list. I think it was Jose' that had the same (or similar) issue. it
> worked for him on linux but not on windows7. will have to search the list
> for what finally resolved it for him.
>
>
Re: JNDI Lookup in Windows

On Mon, Dec 23, 2013 at 5:50 PM, José Luis Cetina <ma...@gmail.com>
 wrote:

> I override the applicationName for the ear (application.xml) and the module
> name for the ejb module (in ejb-jar.xml), and now with my own values (not
> default) the ejb can be found!!    :)
>
>
> Then i use the java:global[/*application name*]/*module name*/*enterprise
> bean name*[/*interface name*]
>
>
> Then:
> ctx.lookup("java:global/MyApplicationName/MyModuleName/
> UsersFacade!com.mypackage.ejbs.UsersFacadeLocal");
>
> Done.
>
> I dont know why with didnt work with the default values.
>
> Thanks.
>

Re: call ejb remote not work. help me

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
Romain, do you remember that something like this was recently discussed on
this list. I think it was Jose' that had the same (or similar) issue. it
worked for him on linux but not on windows7. will have to search the list
for what finally resolved it for him.

On Mon, Jan 13, 2014 at 11:29 AM, mauro2java2011
<ma...@gmail.com>wrote:

> IT is with win7 that not work .*

Re: call ejb remote not work. help me

Posted by Romain Manni-Bucau <rm...@gmail.com>.
FYI I tested under windows XP so maybe a firewall issue.
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014/1/13 mauro2java2011 <ma...@gmail.com>:
> *finally it work.
>
> I have tried with ubuntu and it work well !!!!!!
>
> IT is with win7 that not work .*
>
> It is a problem of firewall?
> I not think because it is called from localhost or 127.0.0.1
>
>  Tank you very much for your very long support with that problem.
> Mauro
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667144.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
*finally it work.

I have tried with ubuntu and it work well !!!!!!

IT is with win7 that not work .*

It is a problem of firewall? 
I not think because it is called from localhost or 127.0.0.1

 Tank you very much for your very long support with that problem.
Mauro




--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667144.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by Romain Manni-Bucau <rm...@gmail.com>.
well I assure you I made it working yesterday this way. list jndi is
highly dependent on the provider and I wouldn't rely on it.

If you handle to reproduce it (maybe with ant just letting us running
ant tomcat && ant tomee then just doing a GET on an url?) we could
check what's your issue.
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014/1/13 mauro2java2011 <ma...@gmail.com>:
> escuse me but not work .
> I have tried to list all jndi into a servelt that is deployed on tomee with
> the same war that contain the EJB .(i.e. server side ) .
> I get :
>
>
> Servlet Servlet2 at /Ejbsutomee
> contesto remoto=javax.naming.InitialContext@9a4b70 java.lang.String .
>
> javax.naming.Context openejb
>
> org.apache.openejb.core.ivm.naming.BusinessRemoteReference
> UserBusinessRemote
>
> org.apache.openejb.core.ivm.naming.BusinessRemoteReference
> DeployerBusinessRemote
>
> org.apache.openejb.core.ivm.naming.BusinessRemoteReference
> ConfigurationInfoBusinessRemote
>
> javax.naming.Context global
>
> javax.naming.Context openejb
>
> javax.naming.Context openejb
>
> org.apache.openejb.core.ivm.naming.BusinessRemoteReference
> User!org.apache.openejb.assembler.util.User
>
> org.apache.openejb.core.ivm.naming.BusinessRemoteReference
> Deployer!org.apache.openejb.assembler.Deployer
>
> org.apache.openejb.core.ivm.naming.BusinessRemoteReference
> ConfigurationInfo!org.apache.openejb.assembler.classic.cmd.ConfigurationInfo
>
> javax.naming.Context Ejbsutomee
>
> org.apache.openejb.core.ivm.naming.BusinessRemoteReference
> Mauroejb!mauro.ejb.MauroInterfacciaejb
>
> org.apache.openejb.core.ivm.naming.ObjectReference MEJB
>
> org.apache.openejb.core.ivm.naming.BusinessRemoteReference MauroejbRemote
>
> --------------------------------------------------------------------------
>
> but if i deploy the same servlet at tomcat client and i run it i get only:
>
> Servlet Servlet2 at /tomcat_ejb_client_tomee
> contesto remoto=javax.naming.InitialContext@122d9c java.lang.String .
>
> javax.naming.Context openejb
>
> org.apache.openejb.core.ivm.naming.BusinessRemoteReference
> UserBusinessRemote
>
>
> --------------------------------------------------------------------------------------
>
> the method tha i used for print on screen the jndi tree  context it is:
>
> private static final void listContext(Context ctx ,String indent,PrintWriter
> out){
> try{
>     NamingEnumeration  list=ctx.listBindings("");
>     while(list.hasMore()){
>     Binding item =(Binding)list.next();
>     String className= item.getClassName();
>     String name= item.getName();
>     out.println(""+indent+className+" "+name);
>
>      //MIA
>     out.println("<br/><br/>");
>     Object o=item.getObject();
>     if(o instanceof javax.naming.Context){
>
>     listContext((Context)o, indent+" ", out);}
>     }
>
> }
> catch(NamingException ex){
>     ex.printStackTrace(out);
> }
> }
>
> ----------------------------------
>
> i have also  try into tomee the servlet from ejb-examples -
> i have deployed with the same war into the server side with ejb
>
> /**
>  *
>  * Licensed to the Apache Software Foundation (ASF) under one or more
>  * contributor license agreements. See the NOTICE file distributed with this
>  * work for additional information regarding copyright ownership. The ASF
>  * licenses this file to You under the Apache License, Version 2.0 (the
>  * "License"); you may not use this file except in compliance with the
> License.
>  * You may obtain a copy of the License at
>  *
>  * http://www.apache.org/licenses/LICENSE-2.0
>  *
>  * Unless required by applicable law or agreed to in writing, software
>  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
>  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
>  * License for the specific language governing permissions and limitations
> under
>  * the License.
>  */
> package org.superbiz.servlet;
>
> import javax.naming.Context;
> import javax.naming.InitialContext;
> import javax.naming.NameClassPair;
> import javax.naming.NamingException;
> import javax.servlet.ServletException;
> import javax.servlet.ServletOutputStream;
> import javax.servlet.http.HttpServlet;
> import javax.servlet.http.HttpServletRequest;
> import javax.servlet.http.HttpServletResponse;
> import java.io.IOException;
> import java.util.Collections;
> import java.util.Map;
> import java.util.TreeMap;
>
> public class JndiServlet extends HttpServlet {
>
>     protected void doGet(HttpServletRequest request, HttpServletResponse
> response) throws ServletException, IOException {
>         response.setContentType("text/plain");
>         ServletOutputStream out = response.getOutputStream();
>
>         Map<String, Object> bindings = new TreeMap<String,
> Object>(String.CASE_INSENSITIVE_ORDER);
>         try {
>             Context context = (Context) new
> InitialContext().lookup("java:comp/");
>             addBindings("", bindings, context);
>         } catch (NamingException e) {
>             throw new ServletException(e);
>         }
>
>         out.println("JNDI Context:");
>         for (Map.Entry<String, Object> entry : bindings.entrySet()) {
>             if (entry.getValue() != null) {
>                 out.println("  " + entry.getKey() + "=" + entry.getValue());
>             } else {
>                 out.println("  " + entry.getKey());
>             }
>         }
>     }
>
>     private void addBindings(String path, Map<String, Object> bindings,
> Context context) {
>         try {
>             for (NameClassPair pair : Collections.list(context.list(""))) {
>                 String name = pair.getName();
>                 String className = pair.getClassName();
>                 if
> ("org.apache.naming.resources.FileDirContext$FileResource".equals(className))
> {
>                     bindings.put(path + name, "<file>");
>                 } else {
>                     try {
>                         Object value = context.lookup(name);
>                         if (value instanceof Context) {
>                             Context nextedContext = (Context) value;
>                             bindings.put(path + name, "");
>                             addBindings(path + name + "/", bindings,
> nextedContext);
>                         } else {
>                             bindings.put(path + name, value);
>                         }
>                     } catch (NamingException e) {
>                         // lookup failed
>                         bindings.put(path + name, "ERROR: " +
> e.getMessage());
>                     }
>                 }
>             }
>         } catch (NamingException e) {
>             bindings.put(path, "ERROR: list bindings threw an exception: " +
> e.getMessage());
>         }
>     }
> }
>
>
> ---------------------------
> i get:
>
> JNDI Context:
>   BeanManager=org.apache.webbeans.container.InjectableBeanManager@23a8ef
>   ComponentName=Ejbsutomee
>   env=
>   env/comp=
>   env/comp/BeanManager=ERROR: Name "Resource/comp/BeanManager" not found.
>   env/comp/ComponentName=Ejbsutomee
>
> env/comp/TransactionManager=org.apache.geronimo.transaction.manager.GeronimoTransactionManager@192d7d0
>
> env/comp/TransactionSynchronizationRegistry=org.apache.geronimo.transaction.manager.GeronimoTransactionManager@192d7d0
>   env/comp/Validator=ERROR: Name "Resource/comp/Validator" not found.
>   env/comp/ValidatorFactory=ERROR: Name "Resource/comp/ValidatorFactory" not
> found.
>   env/module=
>   env/module/ModuleName=Ejbsutomee
>   HandleDelegate=ERROR: No HandleDelegate registered with the OpenEJB system
>   ORB=ERROR: No ORB registered with the OpenEJB system
>   Resources=
>   Resources/index.jsp=<file>
>   Resources/META-INF=
>   Resources/META-INF/context.xml=<file>
>   Resources/META-INF/MANIFEST.MF=<file>
>   Resources/WEB-INF=
>   Resources/WEB-INF/classes=
>   Resources/WEB-INF/classes/.netbeans_automatic_build=<file>
>   Resources/WEB-INF/classes/.netbeans_update_resources=<file>
>   Resources/WEB-INF/classes/mauro=
>   Resources/WEB-INF/classes/mauro/ejb=
>   Resources/WEB-INF/classes/mauro/ejb/Mauroejb.class=<file>
>   Resources/WEB-INF/classes/mauro/ejb/MauroInterfacciaejb.class=<file>
>   Resources/WEB-INF/classes/mauro/srv=
>   Resources/WEB-INF/classes/mauro/srv/Servlet2.class=<file>
>   Resources/WEB-INF/classes/org=
>   Resources/WEB-INF/classes/org/superbiz=
>   Resources/WEB-INF/classes/org/superbiz/servlet=
>   Resources/WEB-INF/classes/org/superbiz/servlet/JndiServlet.class=<file>
>   Resources/WEB-INF/web.xml=<file>
>
> TransactionManager=org.apache.geronimo.transaction.manager.GeronimoTransactionManager@192d7d0
>
> TransactionSynchronizationRegistry=org.apache.geronimo.transaction.manager.GeronimoTransactionManager@192d7d0
>
> UserTransaction=org.apache.geronimo.transaction.manager.GeronimoTransactionManager@192d7d0
>   Validator=org.apache.bval.jsr303.ClassValidator@1201ad7
>   ValidatorFactory=org.apache.bval.jsr303.ApacheValidatorFactory@c25346
>
> ---------------
> but  i have looked the java:comp/ on tomee and i have get the resul above.
>
> but i have noted:
>
> JNDI Context:
>   BeanManager=org.apache.webbeans.container.InjectableBeanManager@23a8ef
>   ComponentName=Ejbsutomee
>   env=
>   env/comp=
>   env/comp/BeanManager=ERROR: Name "Resource/comp/BeanManager" not found.
>   env/comp/ComponentName=Ejbsutomee
>
> env/comp/TransactionManager=org.apache.geronimo.transaction.manager.GeronimoTransactionManager@192d7d0
>
> env/comp/TransactionSynchronizationRegistry=org.apache.geronimo.transaction.manager.GeronimoTransactionManager@192d7d0
>  * env/comp/Validator=ERROR: Name "Resource/comp/Validator" not found.
>   env/comp/ValidatorFactory=ERROR: Name "Resource/comp/ValidatorFactory" not
> found.
>   env/module=
>   env/module/ModuleName=Ejbsutomee
>   HandleDelegate=ERROR: No HandleDelegate registered with the OpenEJB system
>   ORB=ERROR: No ORB registered with the OpenEJB system*
>
> .....
> no ORB registred??
> -----------------------------------------
>
> last i have into the tomee to list the context: java:global/
>
> and i have get (from the servlet deployed on tomee and not into tomcat
> client)
>
> JNDI Context:
>   Ejbsutomee=
>
> Ejbsutomee/Mauroejb=proxy=mauro.ejb.MauroInterfacciaejb;deployment=Mauroejb;pk=null
>
> Ejbsutomee/Mauroejb!mauro.ejb.MauroInterfacciaejb=proxy=mauro.ejb.MauroInterfacciaejb;deployment=Mauroejb;pk=null
>   moviefun=
>
> moviefun/MoviesBean=proxy=org.superbiz.moviefun.MoviesBean;deployment=MoviesBean;pk=null
>
> moviefun/MoviesBean!org.superbiz.moviefun.MoviesBean=proxy=org.superbiz.moviefun.MoviesBean;deployment=MoviesBean;pk=null
>   movies-complete=
>   openejb=
>
> openejb/MEJB=proxy=javax.management.j2ee.Management;deployment=MEJB;pk=null
>
> openejb/MEJB!javax.management.j2ee.ManagementHome=proxy=javax.management.j2ee.Management;deployment=MEJB;pk=null
>   openejb/openejb=
>
> openejb/openejb/ConfigurationInfo=proxy=org.apache.openejb.assembler.classic.cmd.ConfigurationInfo;deployment=openejb/ConfigurationInfo;pk=null
>
> openejb/openejb/ConfigurationInfo!org.apache.openejb.assembler.classic.cmd.ConfigurationInfo=proxy=org.apache.openejb.assembler.classic.cmd.ConfigurationInfo;deployment=openejb/ConfigurationInfo;pk=null
>
> openejb/openejb/Deployer=proxy=org.apache.openejb.assembler.Deployer;deployment=openejb/Deployer;pk=null
>
> openejb/openejb/Deployer!org.apache.openejb.assembler.Deployer=proxy=org.apache.openejb.assembler.Deployer;deployment=openejb/Deployer;pk=null
>
> openejb/openejb/User=proxy=org.apache.openejb.assembler.util.User;deployment=openejb/User;pk=null
>
> openejb/openejb/User!org.apache.openejb.assembler.util.User=proxy=org.apache.openejb.assembler.util.User;deployment=openejb/User;pk=null
>   simple-singleton=
>
> simple-singleton/ComponentRegistry=proxy=org.superbiz.registry.ComponentRegistry;deployment=ComponentRegistry;pk=null
>
> simple-singleton/ComponentRegistry!org.superbiz.registry.ComponentRegistry=proxy=org.superbiz.registry.ComponentRegistry;deployment=ComponentRegistry;pk=null
>
> simple-singleton/PropertyRegistry=proxy=org.superbiz.registry.PropertyRegistry;deployment=PropertyRegistry;pk=null
>
> simple-singleton/PropertyRegistry!org.superbiz.registry.PropertyRegistry=proxy=org.superbiz.registry.PropertyRegistry;deployment=PropertyRegistry;pk=null
>
> ...................................
>
>
>
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667138.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
escuse me but not work .
I have tried to list all jndi into a servelt that is deployed on tomee with
the same war that contain the EJB .(i.e. server side ) .
I get :


Servlet Servlet2 at /Ejbsutomee
contesto remoto=javax.naming.InitialContext@9a4b70 java.lang.String .

javax.naming.Context openejb

org.apache.openejb.core.ivm.naming.BusinessRemoteReference
UserBusinessRemote

org.apache.openejb.core.ivm.naming.BusinessRemoteReference
DeployerBusinessRemote

org.apache.openejb.core.ivm.naming.BusinessRemoteReference
ConfigurationInfoBusinessRemote

javax.naming.Context global

javax.naming.Context openejb

javax.naming.Context openejb

org.apache.openejb.core.ivm.naming.BusinessRemoteReference
User!org.apache.openejb.assembler.util.User

org.apache.openejb.core.ivm.naming.BusinessRemoteReference
Deployer!org.apache.openejb.assembler.Deployer

org.apache.openejb.core.ivm.naming.BusinessRemoteReference
ConfigurationInfo!org.apache.openejb.assembler.classic.cmd.ConfigurationInfo

javax.naming.Context Ejbsutomee

org.apache.openejb.core.ivm.naming.BusinessRemoteReference
Mauroejb!mauro.ejb.MauroInterfacciaejb

org.apache.openejb.core.ivm.naming.ObjectReference MEJB

org.apache.openejb.core.ivm.naming.BusinessRemoteReference MauroejbRemote

--------------------------------------------------------------------------

but if i deploy the same servlet at tomcat client and i run it i get only:

Servlet Servlet2 at /tomcat_ejb_client_tomee
contesto remoto=javax.naming.InitialContext@122d9c java.lang.String .

javax.naming.Context openejb

org.apache.openejb.core.ivm.naming.BusinessRemoteReference
UserBusinessRemote


--------------------------------------------------------------------------------------

the method tha i used for print on screen the jndi tree  context it is:

private static final void listContext(Context ctx ,String indent,PrintWriter
out){
try{
    NamingEnumeration  list=ctx.listBindings("");
    while(list.hasMore()){
    Binding item =(Binding)list.next();
    String className= item.getClassName();
    String name= item.getName();
    out.println(""+indent+className+" "+name);
  
     //MIA 
    out.println("<br/><br/>");
    Object o=item.getObject();
    if(o instanceof javax.naming.Context){
    
    listContext((Context)o, indent+" ", out);}
    }

}
catch(NamingException ex){
    ex.printStackTrace(out);
}
}

----------------------------------

i have also  try into tomee the servlet from ejb-examples -
i have deployed with the same war into the server side with ejb

/**
 *
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements. See the NOTICE file distributed with this
 * work for additional information regarding copyright ownership. The ASF
 * licenses this file to You under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance with the
License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
under
 * the License.
 */
package org.superbiz.servlet;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NameClassPair;
import javax.naming.NamingException;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import java.util.TreeMap;

public class JndiServlet extends HttpServlet {

    protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
        response.setContentType("text/plain");
        ServletOutputStream out = response.getOutputStream();

        Map<String, Object> bindings = new TreeMap<String,
Object>(String.CASE_INSENSITIVE_ORDER);
        try {
            Context context = (Context) new
InitialContext().lookup("java:comp/");
            addBindings("", bindings, context);
        } catch (NamingException e) {
            throw new ServletException(e);
        }

        out.println("JNDI Context:");
        for (Map.Entry<String, Object> entry : bindings.entrySet()) {
            if (entry.getValue() != null) {
                out.println("  " + entry.getKey() + "=" + entry.getValue());
            } else {
                out.println("  " + entry.getKey());
            }
        }
    }

    private void addBindings(String path, Map<String, Object> bindings,
Context context) {
        try {
            for (NameClassPair pair : Collections.list(context.list(""))) {
                String name = pair.getName();
                String className = pair.getClassName();
                if
("org.apache.naming.resources.FileDirContext$FileResource".equals(className))
{
                    bindings.put(path + name, "<file>");
                } else {
                    try {
                        Object value = context.lookup(name);
                        if (value instanceof Context) {
                            Context nextedContext = (Context) value;
                            bindings.put(path + name, "");
                            addBindings(path + name + "/", bindings,
nextedContext);
                        } else {
                            bindings.put(path + name, value);
                        }
                    } catch (NamingException e) {
                        // lookup failed
                        bindings.put(path + name, "ERROR: " +
e.getMessage());
                    }
                }
            }
        } catch (NamingException e) {
            bindings.put(path, "ERROR: list bindings threw an exception: " +
e.getMessage());
        }
    }
}


---------------------------
i get:

JNDI Context:
  BeanManager=org.apache.webbeans.container.InjectableBeanManager@23a8ef
  ComponentName=Ejbsutomee
  env=
  env/comp=
  env/comp/BeanManager=ERROR: Name "Resource/comp/BeanManager" not found.
  env/comp/ComponentName=Ejbsutomee
 
env/comp/TransactionManager=org.apache.geronimo.transaction.manager.GeronimoTransactionManager@192d7d0
 
env/comp/TransactionSynchronizationRegistry=org.apache.geronimo.transaction.manager.GeronimoTransactionManager@192d7d0
  env/comp/Validator=ERROR: Name "Resource/comp/Validator" not found.
  env/comp/ValidatorFactory=ERROR: Name "Resource/comp/ValidatorFactory" not
found.
  env/module=
  env/module/ModuleName=Ejbsutomee
  HandleDelegate=ERROR: No HandleDelegate registered with the OpenEJB system
  ORB=ERROR: No ORB registered with the OpenEJB system
  Resources=
  Resources/index.jsp=<file>
  Resources/META-INF=
  Resources/META-INF/context.xml=<file>
  Resources/META-INF/MANIFEST.MF=<file>
  Resources/WEB-INF=
  Resources/WEB-INF/classes=
  Resources/WEB-INF/classes/.netbeans_automatic_build=<file>
  Resources/WEB-INF/classes/.netbeans_update_resources=<file>
  Resources/WEB-INF/classes/mauro=
  Resources/WEB-INF/classes/mauro/ejb=
  Resources/WEB-INF/classes/mauro/ejb/Mauroejb.class=<file>
  Resources/WEB-INF/classes/mauro/ejb/MauroInterfacciaejb.class=<file>
  Resources/WEB-INF/classes/mauro/srv=
  Resources/WEB-INF/classes/mauro/srv/Servlet2.class=<file>
  Resources/WEB-INF/classes/org=
  Resources/WEB-INF/classes/org/superbiz=
  Resources/WEB-INF/classes/org/superbiz/servlet=
  Resources/WEB-INF/classes/org/superbiz/servlet/JndiServlet.class=<file>
  Resources/WEB-INF/web.xml=<file>
 
TransactionManager=org.apache.geronimo.transaction.manager.GeronimoTransactionManager@192d7d0
 
TransactionSynchronizationRegistry=org.apache.geronimo.transaction.manager.GeronimoTransactionManager@192d7d0
 
UserTransaction=org.apache.geronimo.transaction.manager.GeronimoTransactionManager@192d7d0
  Validator=org.apache.bval.jsr303.ClassValidator@1201ad7
  ValidatorFactory=org.apache.bval.jsr303.ApacheValidatorFactory@c25346

---------------
but  i have looked the java:comp/ on tomee and i have get the resul above.

but i have noted:

JNDI Context:
  BeanManager=org.apache.webbeans.container.InjectableBeanManager@23a8ef
  ComponentName=Ejbsutomee
  env=
  env/comp=
  env/comp/BeanManager=ERROR: Name "Resource/comp/BeanManager" not found.
  env/comp/ComponentName=Ejbsutomee
 
env/comp/TransactionManager=org.apache.geronimo.transaction.manager.GeronimoTransactionManager@192d7d0
 
env/comp/TransactionSynchronizationRegistry=org.apache.geronimo.transaction.manager.GeronimoTransactionManager@192d7d0
 * env/comp/Validator=ERROR: Name "Resource/comp/Validator" not found.
  env/comp/ValidatorFactory=ERROR: Name "Resource/comp/ValidatorFactory" not
found.
  env/module=
  env/module/ModuleName=Ejbsutomee
  HandleDelegate=ERROR: No HandleDelegate registered with the OpenEJB system
  ORB=ERROR: No ORB registered with the OpenEJB system*

.....
no ORB registred??
-----------------------------------------

last i have into the tomee to list the context: java:global/

and i have get (from the servlet deployed on tomee and not into tomcat
client) 

JNDI Context:
  Ejbsutomee=
 
Ejbsutomee/Mauroejb=proxy=mauro.ejb.MauroInterfacciaejb;deployment=Mauroejb;pk=null
 
Ejbsutomee/Mauroejb!mauro.ejb.MauroInterfacciaejb=proxy=mauro.ejb.MauroInterfacciaejb;deployment=Mauroejb;pk=null
  moviefun=
 
moviefun/MoviesBean=proxy=org.superbiz.moviefun.MoviesBean;deployment=MoviesBean;pk=null
 
moviefun/MoviesBean!org.superbiz.moviefun.MoviesBean=proxy=org.superbiz.moviefun.MoviesBean;deployment=MoviesBean;pk=null
  movies-complete=
  openejb=
 
openejb/MEJB=proxy=javax.management.j2ee.Management;deployment=MEJB;pk=null
 
openejb/MEJB!javax.management.j2ee.ManagementHome=proxy=javax.management.j2ee.Management;deployment=MEJB;pk=null
  openejb/openejb=
 
openejb/openejb/ConfigurationInfo=proxy=org.apache.openejb.assembler.classic.cmd.ConfigurationInfo;deployment=openejb/ConfigurationInfo;pk=null
 
openejb/openejb/ConfigurationInfo!org.apache.openejb.assembler.classic.cmd.ConfigurationInfo=proxy=org.apache.openejb.assembler.classic.cmd.ConfigurationInfo;deployment=openejb/ConfigurationInfo;pk=null
 
openejb/openejb/Deployer=proxy=org.apache.openejb.assembler.Deployer;deployment=openejb/Deployer;pk=null
 
openejb/openejb/Deployer!org.apache.openejb.assembler.Deployer=proxy=org.apache.openejb.assembler.Deployer;deployment=openejb/Deployer;pk=null
 
openejb/openejb/User=proxy=org.apache.openejb.assembler.util.User;deployment=openejb/User;pk=null
 
openejb/openejb/User!org.apache.openejb.assembler.util.User=proxy=org.apache.openejb.assembler.util.User;deployment=openejb/User;pk=null
  simple-singleton=
 
simple-singleton/ComponentRegistry=proxy=org.superbiz.registry.ComponentRegistry;deployment=ComponentRegistry;pk=null
 
simple-singleton/ComponentRegistry!org.superbiz.registry.ComponentRegistry=proxy=org.superbiz.registry.ComponentRegistry;deployment=ComponentRegistry;pk=null
 
simple-singleton/PropertyRegistry=proxy=org.superbiz.registry.PropertyRegistry;deployment=PropertyRegistry;pk=null
 
simple-singleton/PropertyRegistry!org.superbiz.registry.PropertyRegistry=proxy=org.superbiz.registry.PropertyRegistry;deployment=PropertyRegistry;pk=null

...................................







--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667138.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
last i have investiged :

i  tried from tomcat client with the servlet following:


----------------------
/**
 *
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements. See the NOTICE file distributed with this
 * work for additional information regarding copyright ownership. The ASF
 * licenses this file to You under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance with the
License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
under
 * the License.
 */
package org.superbiz.servlet;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NameClassPair;
import javax.naming.NamingException;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Collections;
import java.util.Map;
import java.util.Properties;
import java.util.TreeMap;

public class JndiServlet extends HttpServlet {

    protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
        response.setContentType("text/plain");
        ServletOutputStream out = response.getOutputStream();

        Map<String, Object> bindings = new TreeMap<String,
Object>(String.CASE_INSENSITIVE_ORDER);
        try {


            Context context;
            Properties p = new Properties();
            p.put("java.naming.factory.initial",
"org.apache.openejb.client.RemoteInitialContextFactory");
            p.put("java.naming.provider.url",
"http://127.0.0.1:8080/tomee/ejb");
// user and pass optional

//p.put("java.naming.security.principal", "myuser");
//p.put("java.naming.security.credentials", "mypass");
            context = new InitialContext(p);

         
            addBindings("", bindings, context);
        } catch (NamingException e) {
            throw new ServletException(e);
        }

        out.println("JNDI Context:");
        for (Map.Entry<String, Object> entry : bindings.entrySet()) {
            if (entry.getValue() != null) {
                out.println("  " + entry.getKey() + "=" + entry.getValue());
            } else {
                out.println("  " + entry.getKey());
            }
        }
    }

    private void addBindings(String path, Map<String, Object> bindings,
Context context) {
        try {
            for (NameClassPair pair : Collections.list(context.list(""))) {
                String name = pair.getName();
                String className = pair.getClassName();
                if
("org.apache.naming.resources.FileDirContext$FileResource".equals(className))
{
                    bindings.put(path + name, "<file>");
                } else {
                    try {
                        Object value = context.lookup(name);
                        if (value instanceof Context) {
                            Context nextedContext = (Context) value;
                            bindings.put(path + name, "");
                            addBindings(path + name + "/", bindings,
nextedContext);
                        } else {
                            bindings.put(path + name, value);
                        }
                    } catch (NamingException e) {
                        // lookup failed
                        bindings.put(path + name, "ERROR: " +
e.getMessage());
                    }
                }
            }
        } catch (NamingException e) {
            bindings.put(path, "ERROR: list bindings threw an exception: " +
e.getMessage());
        }
    }
}
---------------------------------------
i have the followin result:

JNDI Context:
  .=
  global=
  global/Ejbsutomee=
 
global/Ejbsutomee/Mauroejb!mauro.ejb.MauroInterfacciaejb=proxy=org.apache.openejb.client.StatelessEJBObjectHandler@27538
  global/openejb=
  global/openejb/openejb=
 
global/openejb/openejb/ConfigurationInfo!org.apache.openejb.assembler.classic.cmd.ConfigurationInfo=ERROR:
Cannot lookup
'/global/openejb/openejb/ConfigurationInfo!org.apache.openejb.assembler.classic.cmd.ConfigurationInfo'.
 
global/openejb/openejb/Deployer!org.apache.openejb.assembler.Deployer=ERROR:
Cannot lookup
'/global/openejb/openejb/Deployer!org.apache.openejb.assembler.Deployer'.
  global/openejb/openejb/User!org.apache.openejb.assembler.util.User=ERROR:
Cannot lookup
'/global/openejb/openejb/User!org.apache.openejb.assembler.util.User'.
 
MauroejbRemote=proxy=org.apache.openejb.client.StatelessEJBObjectHandler@15dc721
  MEJB=proxy=org.apache.openejb.client.StatelessEJBHomeHandler@1bc59aa
  openejb=
  openejb/ConfigurationInfoBusinessRemote=ERROR: Cannot lookup
'/openejb*/ConfigurationInfoBusinessRemote'.
  openejb/DeployerBusinessRemote=ERROR: Cannot lookup
'/openejb/DeployerBusinessRemote'.
  openejb/UserBusinessRemote=ERROR: Cannot lookup
'/openejb/UserBusinessRemote'.*



--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667140.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by Romain Manni-Bucau <rm...@gmail.com>.
well in fact it works from tomcat, if you name is
java:global/foo/bar!myintf just lookup global/foo/bar!myintf
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014/1/13 mauro2java2011 <ma...@gmail.com>:
> Sorry.
> I have tried without the part java:
>
> I have put from the word global
>
> but i get the same exception.
>
> But it is deployed .
> And whi from the standalone client it work?
>
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667134.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
Sorry. 
I have tried without the part java: 

I have put from the word global

but i get the same exception.

But it is deployed .
And whi from the standalone client it work? 





--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667134.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by Romain Manni-Bucau <rm...@gmail.com>.
ok think I know what I missed, you looked up with java:global/...
name, in tomcat you just need to remove java: and start from global.

Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014/1/11 mauro2java2011 <ma...@gmail.com>:
> escuse me but i not have istancied any SelectorContext  .
> Where it is the problem?
> I have pasted the code for get the InitialContest with the properties like
> examples into tomee site.
> And on standalone app it work .
>
> I have also put the api itno tomcat/lib and openejb-client.jar into
> web-inf/lib
>
> i not know like resolve. Escuse me
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667107.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
escuse me but i not have istancied any SelectorContext  .
Where it is the problem?
I have pasted the code for get the InitialContest with the properties like
examples into tomee site. 
And on standalone app it work .

I have also put the api itno tomcat/lib and openejb-client.jar into
web-inf/lib

i not know like resolve. Escuse me 




--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667107.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by Romain Manni-Bucau <rm...@gmail.com>.
if you set properties using remote initial context to the initial
context you use you shouldn't go through SelectorContext
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014/1/10 mauro2java2011 <ma...@gmail.com>:
> i have tried putting just put api in tomcat/lib
>
>  escuse me  but  now when i run i get
>
>  the following exception (from log of tomcat)
>
> INFO: Undeploying context [/tomcat7_a_tomee-call-ejb]
> gen 10, 2014 7:03:46 PM org.apache.catalina.startup.HostConfig
> deployDescriptor
> INFO: Deploying configuration descriptor
> /home/utente_javaee7/.netbeans/7.4/apache-tomcat-7.0.41.0_base/conf/Catalina/localhost/tomcat7_a_tomee-call-ejb.xml
> gen 10, 2014 7:07:05 PM srv.ProvatestejbRemoto callremote
> *INFO: -----try to connect to remote JNDI at http://localhost:8080/tomee/ejb
> ------------
> gen 10, 2014 7:07:05 PM org.apache.openejb.client.EventLogger log
> INFO:
> RemoteInitialContextCreated{providerUri=http://localhost:8080/tomee/ejb}
> gen 10, 2014 7:07:05 PM srv.ProvatestejbRemoto callremote
> INFO: the name of NAmingCOntext is:
> gen 10, 2014 7:07:05 PM srv.ProvatestejbRemoto callremote
> INFO: --------try to retrive the BEan Remote
> :java:global/ejbsutomee/TestBean!test.TestBeanRemote ----------
> gen 10, 2014 7:07:05 PM srv.ProvatestejbRemoto processRequest*
>
> *SEVERE: e+ avvenuto un errorejavax.naming.NameNotFoundException: Name
> [global/ejbsutomee/TestBean!test.TestBeanRemote] is not bound in this
> Context. Unable to find [global].
> javax.ejb.EJBException: javax.naming.NameNotFoundException: Name
> [global/ejbsutomee/TestBean!test.TestBeanRemote] is not bound in this
> Context. Unable to find [global].*
>
>         at srv.ProvatestejbRemoto.callremote(ProvatestejbRemoto.java:62)
>         at srv.ProvatestejbRemoto.processRequest(ProvatestejbRemoto.java:84)
>         at srv.ProvatestejbRemoto.doGet(ProvatestejbRemoto.java:111)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>         at
> org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
>         at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>         at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>         at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
>         at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
>         at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
>         at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
>         at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>         at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
>         at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>         at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
>         at
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
>         at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
>         at
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
>         at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>         at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>         at java.lang.Thread.run(Thread.java:724)
> Caused by: javax.naming.NameNotFoundException: Name
> [global/ejbsutomee/TestBean!test.TestBeanRemote] is not bound in this
> Context. Unable to find [global].
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:820)
>         at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
>         at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158)
>         at javax.naming.InitialContext.lookup(InitialContext.java:411)
>         at srv.ProvatestejbRemoto.callremote(ProvatestejbRemoto.java:50)
>         ... 23 more
>
> ..............................................................................................
> *but from the standalone client i get the response correct:
>
> run:
> gen 10, 2014 7:04:47 PM org.apache.openejb.client.EventLogger log
> INFO:
> RemoteInitialContextCreated{providerUri=http://127.0.0.1:8080/ejbsutomee/ejb}
> result from EJB:From test.TestBean@11c5197
> BUILD SUCCESSFUL (total time: 13 seconds)*
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667103.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
i have tried putting just put api in tomcat/lib 

 escuse me  but  now when i run i get 

 the following exception (from log of tomcat)

INFO: Undeploying context [/tomcat7_a_tomee-call-ejb]
gen 10, 2014 7:03:46 PM org.apache.catalina.startup.HostConfig
deployDescriptor
INFO: Deploying configuration descriptor
/home/utente_javaee7/.netbeans/7.4/apache-tomcat-7.0.41.0_base/conf/Catalina/localhost/tomcat7_a_tomee-call-ejb.xml
gen 10, 2014 7:07:05 PM srv.ProvatestejbRemoto callremote
*INFO: -----try to connect to remote JNDI at http://localhost:8080/tomee/ejb
------------
gen 10, 2014 7:07:05 PM org.apache.openejb.client.EventLogger log
INFO:
RemoteInitialContextCreated{providerUri=http://localhost:8080/tomee/ejb}
gen 10, 2014 7:07:05 PM srv.ProvatestejbRemoto callremote
INFO: the name of NAmingCOntext is:
gen 10, 2014 7:07:05 PM srv.ProvatestejbRemoto callremote
INFO: --------try to retrive the BEan Remote
:java:global/ejbsutomee/TestBean!test.TestBeanRemote ----------
gen 10, 2014 7:07:05 PM srv.ProvatestejbRemoto processRequest*

*SEVERE: e+ avvenuto un errorejavax.naming.NameNotFoundException: Name
[global/ejbsutomee/TestBean!test.TestBeanRemote] is not bound in this
Context. Unable to find [global].
javax.ejb.EJBException: javax.naming.NameNotFoundException: Name
[global/ejbsutomee/TestBean!test.TestBeanRemote] is not bound in this
Context. Unable to find [global].*

	at srv.ProvatestejbRemoto.callremote(ProvatestejbRemoto.java:62)
	at srv.ProvatestejbRemoto.processRequest(ProvatestejbRemoto.java:84)
	at srv.ProvatestejbRemoto.doGet(ProvatestejbRemoto.java:111)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
	at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
	at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
	at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:724)
Caused by: javax.naming.NameNotFoundException: Name
[global/ejbsutomee/TestBean!test.TestBeanRemote] is not bound in this
Context. Unable to find [global].
	at org.apache.naming.NamingContext.lookup(NamingContext.java:820)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:168)
	at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158)
	at javax.naming.InitialContext.lookup(InitialContext.java:411)
	at srv.ProvatestejbRemoto.callremote(ProvatestejbRemoto.java:50)
	... 23 more

..............................................................................................
*but from the standalone client i get the response correct:

run:
gen 10, 2014 7:04:47 PM org.apache.openejb.client.EventLogger log
INFO:
RemoteInitialContextCreated{providerUri=http://127.0.0.1:8080/ejbsutomee/ejb}
result from EJB:From test.TestBean@11c5197
BUILD SUCCESSFUL (total time: 13 seconds)*




--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667103.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
i have added into tomcat/lib 

openejb-client-4.6.0.jar 
javaee-api-6.0-5-tomcat.jar


but i get:

javax.naming.NameNotFoundException: Name
[global/ejbsutomee/TestBean!test.TestBeanRemote] is not bound in this
Context. Unable to find [global].

but from standalone client the name
[global/ejbsutomee/TestBean!test.TestBeanRemote] it works!!





--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667017.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by Romain Manni-Bucau <rm...@gmail.com>.
hmm, you mix deployment I think, maybe start from a clean envrt and
just put api in tomcat/lib
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014/1/7 mauro2java2011 <ma...@gmail.com>:
> the last exception that i get after added jard to tomcat/lib:
>
> javax.naming.NoInitialContextException: Cannot instantiate class:
> org.apache.openejb.client.RemoteInitialContextFactory [Root exception is
> java.lang.ClassNotFoundException:
> org.apache.openejb.client.RemoteInitialContextFactory]
> Ejb nulllo
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667018.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
the last exception that i get after added jard to tomcat/lib:

javax.naming.NoInitialContextException: Cannot instantiate class:
org.apache.openejb.client.RemoteInitialContextFactory [Root exception is
java.lang.ClassNotFoundException:
org.apache.openejb.client.RemoteInitialContextFactory]
Ejb nulllo




--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667018.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by Romain Manni-Bucau <rm...@gmail.com>.
try putting javaee-api in tomcat/lib please
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014/1/7 mauro2java2011 <ma...@gmail.com>:
> tank you from client standalone now it works!!!!!
>
> But it not work from another plain tomcat7 .
>
> I past on pastebin the code from the servlet deployed in tomcat7 tt call te
> ejb remote deployed on tomee.
>
> ON te web-inf/lib of web application client i ave added:
>
> javaee-api-6.0-5-tomcat.jar
> openejb-client-4.6.0.jar
>
> read the scode of servlet and the error : at pastebin.
> http://pastebin.com/C0w31xqT <http://pastebin.com/C0w31xqT>
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667010.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
tank you from client standalone now it works!!!!!

But it not work from another plain tomcat7 .

I past on pastebin the code from the servlet deployed in tomcat7 tt call te
ejb remote deployed on tomee.

ON te web-inf/lib of web application client i ave added: 

javaee-api-6.0-5-tomcat.jar
openejb-client-4.6.0.jar

read the scode of servlet and the error : at pastebin. 
http://pastebin.com/C0w31xqT <http://pastebin.com/C0w31xqT>  




--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667010.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
whi from the client standalone it work and i not get the exception
java.lang.ClassNotFoundException: javax.ejb.EJBHome and from a tomcat plain
i get the following exception??????



gen 07, 2014 5:52:09 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [Servlet2] in context with path
[/tomcat7_a_tomee-call-ejb] threw exception [Servlet execution threw an
exception] with root cause
java.lang.ClassNotFoundException: javax.ejb.EJBHome
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:270)
	at
com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:63)
	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
	at javax.naming.InitialContext.init(InitialContext.java:242)
	at javax.naming.InitialContext.<init>(InitialContext.java:216)
	at test.Servlet2.processRequest(Servlet2.java:49)
	at test.Servlet2.doGet(Servlet2.java:85)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
	at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
	at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
	at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
	at
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
	at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:724)




--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667016.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by Romain Manni-Bucau <rm...@gmail.com>.
remotely you want to use the remote interface, other names are only local
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014/1/7 mauro2java2011 <ma...@gmail.com>:
> I dont have still tried .
> But whi  i have to add tge !nameofinterface with the global name of ejb?
> When i have  drployed i have read the name gloval without interface.
>
> Java:global/nameofprohect/nameejbimplementation
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667000.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
I dont have still tried .
But whi  i have to add tge !nameofinterface with the global name of ejb? 
When i have  drployed i have read the name gloval without interface.

Java:global/nameofprohect/nameejbimplementation



--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4667000.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by Romain Manni-Bucau <rm...@gmail.com>.
to lookup it remotely use java:global/ejbsutomee/TestBean!test.TestBeanRemote
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014/1/7 mauro2java2011 <ma...@gmail.com>:
> go at pastebin
>
> http://pastebin.com/V9sg6kEd
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4666998.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
go at pastebin

http://pastebin.com/V9sg6kEd




--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4666998.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by Romain Manni-Bucau <rm...@gmail.com>.
please share your log (maybe use pastebin or github gist to paste it)
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014/1/7 mauro2java2011 <ma...@gmail.com>:
> r file i have :
>
> //the interface
>
> package test;
>
> import javax.ejb.Remote;
>
> /**
>  *
>  * @author utente_javaee7
>  */
> @Remote
> public interface TestBeanRemote {
>    String hello();
> }
>
> .........................
> //the implementation . i not have specified beanname or other stuff with
> annotation @Stateless
>
> package test;
>
> import javax.ejb.Stateless;
>
> /**
>  *
>  * @author utente_javaee7
>  */
> @Stateless
> public class TestBean implements TestBeanRemote {
>
>     @Override
>     public String hello() {
>         return "From " + this;
>     }
>
> }
>
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4666995.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
r file i have :

//the interface

package test;

import javax.ejb.Remote;

/**
 *
 * @author utente_javaee7
 */
@Remote
public interface TestBeanRemote {
   String hello(); 
}

.........................
//the implementation . i not have specified beanname or other stuff with
annotation @Stateless

package test;

import javax.ejb.Stateless;

/**
 *
 * @author utente_javaee7
 */
@Stateless
public class TestBean implements TestBeanRemote {

    @Override
    public String hello() {
        return "From " + this;
    }

}





--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4666995.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by Romain Manni-Bucau <rm...@gmail.com>.
hi

did you try with http://localhost:8080/tomee/ejb provider url?
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014/1/7 mauro2java2011 <ma...@gmail.com>:
> from the client standalone i get:
>
> run:
> gen 07, 2014 9:44:49 AM org.apache.openejb.client.EventLogger log
> INFO:
> RemoteInitialContextCreated{providerUri=http://127.0.0.1:8080/ejbsutomee/ejb}
> gen 07, 2014 9:44:50 AM mauro.clienttomee.MioClientTomee main
> SEVERE: null
> javax.naming.NameNotFoundException: global/ejbsutomee/TestBean does not
> exist in the system.  Check that the app was successfully deployed.
>         at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:319)   at
> org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:319)
>         at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:319)
> ming.Inava:411)
>
> but the war project with the remote ejb it is deployed into tomee from
> netbeans
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4666991.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
from the client standalone i get:

run:
gen 07, 2014 9:44:49 AM org.apache.openejb.client.EventLogger log
INFO:
RemoteInitialContextCreated{providerUri=http://127.0.0.1:8080/ejbsutomee/ejb}
gen 07, 2014 9:44:50 AM mauro.clienttomee.MioClientTomee main
SEVERE: null
javax.naming.NameNotFoundException: global/ejbsutomee/TestBean does not
exist in the system.  Check that the app was successfully deployed.
	at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:319)	at
org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:319)
	at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:319)
ming.Inava:411)

but the war project with the remote ejb it is deployed into tomee from
netbeans




--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4666991.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by Romain Manni-Bucau <rm...@gmail.com>.
you should paste your error ;)

basically ee api + openejb-client should be enough
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014/1/3 mauro2java2011 <ma...@gmail.com>:
> Yes i have added the jars files.
> But now i have a problem of security.
> I not have put into properties  tge user and password.
> U have missed other  config or jars for  security?
>
> I have also trued witg a client standalone.
>
> I have added jeetomcat.jar and openejbclient.jar.
> But also i get error of security.
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4666959.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by mauro2java2011 <ma...@gmail.com>.
Yes i have added the jars files.
But now i have a problem of security.
I not have put into properties  tge user and password.
U have missed other  config or jars for  security? 

I have also trued witg a client standalone.

I have added jeetomcat.jar and openejbclient.jar.
But also i get error of security.




--
View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948p4666959.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: call ejb remote not work. help me

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

did you add missing class in tomcat? javaee-api and openejb-client maybe?
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014/1/3 mauro2java2011 <ma...@gmail.com>:
> HI .i have tried to call a ejb remote deployed on tomee from a tomcat7 plain.
> From the servlet deployed into tomcat plain i have:
>
> @WebServlet(name = "ProvatestejbRemoto", urlPatterns = {"/prova"})
> public class ProvatestejbRemoto extends HttpServlet {
>
>     private TestBeanRemote myBean = null;
>
>
>
>     @PostConstruct
>     public void inizializzaEjb(){
>   try {
>             Properties p = new Properties();
>             p.put("java.naming.factory.initial",
> "org.apache.openejb.client.RemoteInitialContextFactory");
>             p.put("java.naming.provider.url",
> "http://localhost:8080/tomee/ejb");
> // user and pass optional
> //p.put("java.naming.security.principal", "myuser");// i not use the
> security.
> //p.put("java.naming.security.credentials", "mypass");// i not use the
> security.
>
>             InitialContext ctx = new InitialContext(p);
>
>             myBean = (TestBeanRemote)
> ctx.lookup("java:global/ejbsutomee/TestBean");
> //theproject    name of the war deployed on tomee  is ejbsutomee.war
>
>         } catch (Exception e) {
>           //  e.printStackTrace(out);
>         }
>     }
>
>
>     protected void processRequest(HttpServletRequest request,
> HttpServletResponse response)
>             throws ServletException, IOException {
>         response.setContentType("text/html;charset=UTF-8");
>         PrintWriter out = response.getWriter();
>
>
>
>         try {
>             /* TODO output your page here. You may use following sample
> code. */
>             out.println("<!DOCTYPE html>");
>             out.println("<html>");
>             out.println("<head>");
>             out.println("<title>Servlet ProvatestejbRemoto</title>");
>             out.println("</head>");
>             out.println("<body>");
>             out.println("
> Servlet ProvatestejbRemoto at " + request.getContextPath() + "
> ");
>             out.println("the ejb remote says: " + myBean.hello());
>
>             out.println("</body>");
>             out.println("</html>");
>         } finally {
>             out.close();
>         }
>     }
> }
>
> -----------------
> i have put the interface into my client project and i have put into the
> calsspath the openejbclient.jar
> but when i run the project client i get eroor :
>
> HTTP Status 500 - Error instantiating servlet class srv.ProvatestejbRemoto
>
> type Exception report
>
> message Error instantiating servlet class srv.ProvatestejbRemoto
>
> description The server encountered an internal error that prevented it from
> fulfilling this request.
>
> exception
>
> javax.servlet.ServletException: Error instantiating servlet class
> srv.ProvatestejbRemoto
>
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>         org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
>         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
>
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
>
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
>
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>         java.lang.Thread.run(Thread.java:724)
>
> root cause
>
> java.lang.NoClassDefFoundError: javax/ejb/EJBHome
>         java.lang.Class.forName0(Native Method)
>         java.lang.Class.forName(Class.java:270)
>         com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:63)
>         javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
>         javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
>         javax.naming.InitialContext.init(InitialContext.java:242)
>         javax.naming.InitialContext.<init>(InitialContext.java:216)
>         srv.ProvatestejbRemoto.inizializzaEjb(ProvatestejbRemoto.java:41)
>         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         java.lang.reflect.Method.invoke(Method.java:606)
>
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>         org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
>         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
>
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
>
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
>
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>         java.lang.Thread.run(Thread.java:724)
>
> root cause
>
> java.lang.ClassNotFoundException: javax.ejb.EJBHome
>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
>
> org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
>         java.lang.Class.forName0(Native Method)
>         java.lang.Class.forName(Class.java:270)
>         com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:63)
>         javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:671)
>         javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307)
>         javax.naming.InitialContext.init(InitialContext.java:242)
>         javax.naming.InitialContext.<init>(InitialContext.java:216)
>         srv.ProvatestejbRemoto.inizializzaEjb(ProvatestejbRemoto.java:41)
>         sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         java.lang.reflect.Method.invoke(Method.java:606)
>
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
>
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>         org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
>         org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
>
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
>
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
>
> org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>         java.lang.Thread.run(Thread.java:724)
>
> note The full stack trace of the root cause is available in the Apache
> Tomcat/7.0.41 logs.
> Apache Tomcat/7.0.41
>
>
>
>
>
>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/call-ejb-remote-not-work-help-me-tp4666948.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.