Dasari Prasad created AS7-5606:
----------------------------------
Summary: NO EJB Receiver available
Key: AS7-5606
URL:
https://issues.jboss.org/browse/AS7-5606
Project: Application Server 7
Issue Type: Clarification
Components: EJB
Affects Versions: 7.1.1.Final
Environment: windows vista,oracle database,ant,jboss7.1.1[standalone]
Reporter: Dasari Prasad
Assignee: jaikiran pai
[i am trying deploy entity bean working well in jboss6.1.0 final on jboss7.1.1]
when deployed on server side no details about how bean naming is as in case of Session
Bean. simply says Deployed "SimpCMP.jar"
ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1">
<enterprise-beans>
<entity>
<ejb-name>STOREITEM</ejb-name>
<home>com.htc.javaee.ejbs.CMPHome</home>
<remote>com.htc.javaee.ejbs.CMPRemote</remote>
<ejb-class>com.htc.javaee.ejbs.CMPSimpleBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>false</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>StoreItems</abstract-schema-name>
<cmp-field><field-name>id</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
<cmp-field><field-name>section</field-name></cmp-field>
<cmp-field><field-name>qty</field-name></cmp-field>
<cmp-field><field-name>cost</field-name></cmp-field>
<primkey-field>id</primkey-field>
<query>
<query-method>
<method-name>findStoreItems</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>
<![CDATA[select Object(it) from StoreItems as it
where it.section=?1]]>
</ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>STOREITEM</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
jbosscmp-jdbc.xml
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE jbosscmp-jdbc PUBLIC
"-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN"
"http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">
<jbosscmp-jdbc >
<defaults>
<datasource>java:jboss/datasources/XAOracleDS</datasource>
<datasource-mapping>Oracle9i</datasource-mapping>
</defaults>
<enterprise-beans>
<entity>
<ejb-name>STOREITEM</ejb-name>
<table-name>STOREITEMS</table-name>
<cmp-field>
<field-name>id</field-name>
<column-name>STOREITEM_ID</column-name>
</cmp-field>
<cmp-field>
<field-name>name</field-name>
<column-name>STOREITEM_NAME</column-name>
</cmp-field>
<cmp-field>
<field-name>section</field-name>
<column-name>STOREITEM_SECTION</column-name>
</cmp-field>
<cmp-field>
<field-name>qty</field-name>
<column-name>STOREITEM_QTY</column-name>
</cmp-field>
<cmp-field>
<field-name>cost</field-name>
<column-name>STOREITEM_COST_PIECE</column-name>
</cmp-field>
</entity>
</enterprise-beans>
</jbosscmp-jdbc>
jboss-ejb3.xml
<?xml version="1.0"?>
<jboss:ejb-jar
xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee
http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd
http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"
version="3.1"
impl-version="2.0">
<enterprise-beans>
<entity>
<ejb-name>STOREITEM</ejb-name>
</entity>
</enterprise-beans>
</jboss:ejb-jar>
but when running
my client is
package com.htc.javaee.ejbs;
import javax.naming.InitialContext;
import javax.naming.Context;
import javax.rmi.PortableRemoteObject;
import java.util.List;
import java.util.Properties;
public class SimpCMPClient {
public static InitialContext getInitialContext() {
Properties props = new Properties();
InitialContext jndiCtx = null;
try {
props.put(Context.URL_PKG_PREFIXES,
"org.jboss.ejb.client.naming");
props.put("jboss.naming.client.ejb.context", true);
jndiCtx = new InitialContext(props);
}catch(Exception ex) {}
return jndiCtx;
}
public static final String DEPLOY_NAME =
"ejb:/simpCMP//STOREITEM!com.htc.javaee.ejbs.CMPHome";
public static void main(String[] args) {
System.out.println("\nBegin SimpCMPClient...\n");
try {
InitialContext ctx = getInitialContext();
Object obj = ctx.lookup(DEPLOY_NAME);
CMPHome home =
(CMPHome)PortableRemoteObject.narrow(obj,
CMPHome.class);
System.out.println("Creating SimpCMPBean\n");
CMPRemote demo = home.create(500, "Brake Drum", "I", 20,
4500.6);
System.out.println("Created bean is:" + demo.getInfo() +
"\n");
System.out.println("Finder Method");
demo = home.findByPrimaryKey(300);
System.out.println(demo.getInfo() + "\n");
demo.setQty(60);
System.out.println("Setter Method");
System.out.println(demo.getInfo() + "\n");
System.out.println("Multi Finder Method");
List<CMPRemote> list = home.findStoreItems("II");
System.out.println();
for(CMPRemote remote : list) {
System.out.println(remote.getInfo());
}
}catch(Exception e){
e.printStackTrace();
}
}
}
i am getting an error
[java]
[java] Begin SimpCMPClient...
[java]
[java] 2012-09-22 16:50:17,621 INFO org.jboss.ejb.client.<clinit>:42 - JBoss
EJB Client version 1.0.5.Final
[java] Creating SimpCMPBean
[java]
[java] java.lang.IllegalStateException: No EJB receiver available for handling
[appName:,modulename:simpCMP,distinctname:] combination for invocation context
org.jboss.ejb.client.EJBClientInvocationContext@31d6f2
[java] at
org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:584)
[java] at
org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:119)
[java] at
org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:181)
[java] at
org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:136)
[java] at
org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:121)
[java] at
org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:104)
[java] at $Proxy0.create(Unknown Source)
[java] at com.htc.javaee.ejbs.SimpCMPClient.main(Unknown Source)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:601)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
[java] at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
[java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:771)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
[java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
[java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:601)
[java] at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:390)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[java] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[java] at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[java] at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[java] at org.apache.tools.ant.Main.runBuild(Main.java:809)
[java] at org.apache.tools.ant.Main.startAnt(Main.java:217)
[java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
[java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
BUILD SUCCESSFUL
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira