H everyone.
finally in the evening I have managed to get this work. there are still some
issues open, but now I have beans visible in jndiview via pattern
ear/bean/local(remote) so everything works fine.
this might have been an packaging issue, now I have one ear deployed with
ejb.jar inside
You should have posted the exception stacktrace that you are seeing. That will
help in identifying the exact issue.
Most likely you are looking up the bean using a wrong jndi-name. You will have
to look at the JNDIView through your jmx-console to see what exactly is the
jndi-name of your bean.
Hi
thanks for your quick response.
actually I have already managed, somehow to get part of this work,
unfortunately another error came up.
removing remotebinding gives same error
package beans;
import javax.ejb.Stateless;
import javax.ejb.Remote;
import
yanlong11 wrote :
| after removing binding, jndi view gives following:
| +- testBean (class: org.jnp.interfaces.NamingContext)
| | +- remote (proxy: $Proxy129 implements interface beans.test,interface
org.jboss.ejb3.JBossProxy)
|
|
If you have removed the @RemoteBinding
Hi
trouble is now not Naming, but ClassCastException! it was great hint I have not
known, about looking at JNDI console to see real namings.
testBean bean = (testBean)obj; // this line always fails and causes exception
any idea about this?
thanks a lot
yanlong
View the original post :
Hi yanlong11,
with coding
| @Remote(test.class)
|
you say, that the remote interface/type should be test.
So you need to
| test bean = (test)obj;
|
in you client.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4120425#4120425
Reply to the post :
but test.java is
| public interface test {
| public String hello();
| }
|
does that mean, that I have to rewrite code differently?
thanks
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4120427#4120427
Reply to the post :
Hi !
first of all: I would suggest you annotate the remote interface test with
@Remote(), not the bean.
next: let the bean class implement the interface.
third: I think you cannot cast the lookup result directly to the bean interface.
I always used this:
InitialContext initialContext = new
:( I must be doing something wrong.
I even made very base interface (Calculator.java) like in the example but I am
always getting the same error. Class Cast Exception.
please give me a hint what I am doing wrong. below all important code. (I had
rather included it.)
thanks in advance
yanlong11,
There are various reasons why a ClassCastException error will occur. Please
post the entire exception stacktrace and also the contents of the JNDI tree.
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4120509#4120509
Reply to the post :
16:53:10,284 ERROR [STDERR] java.lang.ClassCastException: $Proxy91
16:53:10,284 ERROR [STDERR] at
org.apache.jsp.index_jsp._jspService(index_jsp.java:79)
16:53:10,284 ERROR [STDERR] at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
16:53:10,284 ERROR [STDERR] at
Going by this JNDI tree, your code should be:
Hello bean = (Hello) ctx.lookup(HelloBean/remote);
| bean.hello();
Now if this fails with a ClassCastException : $ProxyXX then you will have to
tell us how you have packaged your application. Are you deploying the ejbs in a
jar and the jsp in a
I still had class-cast exc even with code you provided.
below output from loader-rep as suggested in article you gave link to.
I am loading these dynamically with intellij idea IDE
thanks
yanlong
book.HelloBean Information
Repository cache version:
book.HelloBean(11be075)[EMAIL PROTECTED]
Still does not work and same exception. I reminded myself about 2 options.
1. can the cause be, that I have changes default ports? (in configuration)
2. if this would be packaging issue, what is correct way to package jsp
application (web.war) that is using ejb beans?
In books and tutorials I
Hi,
did you try to package both of your archives in one ear?
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4120724#4120724
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4120724
15 matches
Mail list logo