M : M mapping EJBs
Hi,
I have managed to set up a many to many relationship in my ejb-xml.jar and orion-ejb-jar.xml and this works just fine for this scenario...
many TASKINGs have many PERSONs
so the TASKING.ID and PERSON.ID are created in a new link table. I can update to this table no problem.
However, I now want to record further detail for each row in the PERSON_TASKING table so the columns would be
TASKING_ID, PERSON_ID, COMMENTS, AUTHORISED
anyone any idea of what I have to do or even start to try and get
a) the table created (automatically)
b) update the table when this has been done.
currently I can update the table by calling the appropriate setXXX method and passing in a collection of PERSONs.
Any advice would be helpful as I am completely stuck on this.
Conrad
In the absence of any reply, I came up with a sort of solution myself...
Manually created the link table with the same foreign keys as are created automatically, but also created the two additional columns required.
Created a data access object class to update and query the table directly.
This may help someone else in the future or for anyone to offer any comments.
Conrad
Similar Messages
-
Mapping ejb and database - primary key problem
I'm trying to map some ejb's to an existing database. Unfortunately, when I load the db schema into deploytool, the table I'm interested in is not available because it doesn't have any primary key defined.
Is it impossible to map an ejb to a db table without primary key ?
Is it a sun-specific feature, or can I expect the same behaviour from other application servers vendors ?
Thanks for the help.Hi Maxime,
In J2EE RI 1.4, you can't map beans to tables w/o primary keys. I don't know, how other other products treat this issue.
Regards,
-- markus. -
Unable to deploy EJB: ...Expected role in mapping - WL9.2 on XP
Message Driven Bean deployment - getting error below - I thought the mapping was defined in weblogic-ejb-xml.jar?
[i][i][i]Caused by: java.lang.AssertionError: Expected role in mapping at weblogic.ejb.container.internal.RuntimeHelper.getRunAsPrincipalFromRoleMapping(RuntimeHelper.java:301)
at weblogic.ejb.container.deployer.BeanInfoImpl.calculateRunAsPrincipal(BeanInfoImpl.java:866)
at weblogic.ejb.container.deployer.BeanInfoImpl.prepare(BeanInfoImpl.java:816)
at weblogic.ejb.container.deployer.MessageDrivenBeanInfoImpl.prepare(MessageDrivenBeanInfoImpl.java:866)
at weblogic.ejb.container.deployer.EJBDeployer.setupBeanInfos(EJBDeployer.java:946)
... 25 more
Unable to deploy EJB: EjbFileRequest from EjbFileRequest.jar:
Expected role in mapping
<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>
<message-driven>
<ejb-name>EjbFileRequest</ejb-name>
<ejb-class>EjbFileRequest</ejb-class>
<transaction-type>Container</transaction-type>
<activation-config>
<activation-config-property>
<activation-config-property-name>destinationType</activation-config-property-name>
<activation-config-property-value>javax.jms.Queue</activation-config-property-value>
</activation-config-property>
</activation-config>
<security-identity>
<run-as>
<role-name>EJBFileRequestRole</role-name>
</run-as>
</security-identity>
</message-driven>
</enterprise-beans>
</ejb-jar>
<weblogic-ejb-jar
xmlns="http://www.bea.com/ns/weblogic/90" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd">
<weblogic-enterprise-bean>
<ejb-name>EjbFileRequest</ejb-name>
<message-driven-descriptor>
<destination-jndi-name>jms/TrinityFRQ</destination-jndi-name>
</message-driven-descriptor>
</weblogic-enterprise-bean>
<security-role-assignment>
<role-name>EJBFileRequestRole</role-name>
<principal-name>trinityejbuser</principal-name>
</security-role-assignment>
</weblogic-ejb-jar>Did you ever figure out what was wrong here? I have the same setup and the same problem.
-
Physical table name - abstract table name mapping in CMP Bean
Hello,
I am using a EJB 2.x bean deployed on a SJSAS 9 server. EJB has problem associating the EJB to the actual table
Details are as follows:
EJB name: AccountCMP
Actual tablename : account
Error
ejb store called
IM: postInvokeentity3.AccountBean145996470_ConcreteImpl@d6be89
EJB5071: Some remote or transactional roll back exception occurred
com.sun.jdo.api.persistence.support.JDODataStoreException: JDO76400: Got a JDBC SQLException while executing the SQL statement:
insert into "ACCOUNTCMP"("DESCRIPTION", "ACCOUNTNAME", "BALANCE", "ACCID") values ( ?, ?, ?, ?).
Please examine the SQLException for more information.
NestedException: java.sql.SQLException: ORA-00942: table or view does not exist
FailedObjectArray: [entity3.AccountBean145996470_JDOState@5332ca]
Please note that the insert statement has the ejb-name (I think so, as my CMP EJB is called ACCOUNTCMP) instead of the actual tablename (account).
I do have the account.dbschema file and sun-cmp-mappings.xml in the NB 5.5 project, but the mappings.xml file is not included in the jar by NB. Is that expected, or an problem.
sun-cmp-mappings.xml
<sun-cmp-mappings>
<sun-cmp-mapping>
<schema>account</schema>
<entity-mapping>
<ejb-name>AccountCMP</ejb-name>
<table-name>account</table-name>
<cmp-field-mapping>
ejb-jar.xml
<enterprise-beans>
<entity>
<ejb-name>AccountCMP</ejb-name>
<local-home>entity3.AccountLocalHome</local-home>
<local>entity3.AccountLocal</local>
<ejb-class>entity3.AccountBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>entity3.AccountPK</prim-key-class>
<reentrant>false</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>account</abstract-schema-name> Thank you for your help.Hello,
I found out the issue. sun-cmp-mappings.xml file is mandatory, and dont know why, netbeans excludes this file from the jar. I had to edit project.properties file to negate this exclusion.
Another problem was that my table did not have a primary key (and hence by schema file did not have it also). CMP bean code generator did not like this.
Once I fixed these two problems, my CMP started working fine.
Thank you all -
Error: Unresolved ejb-link :
I want to call a session bean from a servlet.while deploying i am getting the error
Error: Unresolved <ejb-link>:
I am using Netbeans 6.0 IDE. here i am posting my code.
Calling code in servlet :
Context ctx = new InitialContext();
Object objref = ctx.lookup("java:comp/env/ejb/Etrack");
testBean=(MyHome)PortableRemoteObject.narrow(objref,MyHome.class);
web.xml :
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 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/web-app_2_5.xsd">
<servlet>
<servlet-name>MyClientServlet</servlet-name>
<servlet-class>MyClientServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MyClientServlet</servlet-name>
<url-pattern>/MyClientServlet</url-pattern>
</servlet-mapping>
<ejb-local-ref>
<ejb-ref-name>ejb/Etrack</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>MyHome</local-home>
<local>MyRemote</local>
<ejb-link>Etrack</ejb-link>
</ejb-local-ref>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
My ejb-jar.xml :
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
<ejb-jar>
<enterprise-beans>
<session>
<display-name>Etrack Bean</display-name>
<ejb-name>Etrack</ejb-name>
<local-home>MyHome</local-home>
<local>MyRemote</local>
<ejb-class>MyEjbClass</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>ejb/Etrack</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home>MyHome</local-home>
<local>MyRemote</local>
<ejb-link>Etrack</ejb-link>
</ejb-local-ref>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>Etrack</ejb-name>
<method-intf>Local</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
My sun-ejb-jar.xml :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 8.1 EJB 2.1//EN" "http://www.sun.com/software/appserver/dtds/sun-ejb-jar_2_1-1.dtd">
<sun-ejb-jar>
<enterprise-beans>
<ejb>
<ejb-name>Etrack</ejb-name>
<stateless-session-descriptor>
<bean-pool>
<steady-pool-size>10</steady-pool-size>
<resize-quantity>10</resize-quantity>
<max-pool-size>100</max-pool-size>
<pool-idle-timeout-in-seconds>600</pool-idle-timeout-in-seconds>
</bean-pool>
</stateless-session-descriptor>
<jndi-name>ejb/Etrack</jndi-name>
<pass-by-reference>true</pass-by-reference>
<ejb-ref>
<ejb-name>Etrack</ejb-name>
<ejb-ref-name>ejb/Etrack</ejb-ref-name>
<jndi-name>ejb/Etrack</jndi-name>
</ejb-ref>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
Can anyone help me in resolving this issue.It will be a great help for me.Thanks in advanceYou could always try removing the ejb-link, and see if the container can inject a reference in the runtime environment (accessible using jndi java:comp/env/ejb/Etrack).
If it doesn't, check these:
1) http://www.redhat.com/docs/manuals/rhaps/jonas-guide/ch-beans-ejbref.html
2) the ejb 2.0 spec, which the original poster was using (although this is the same in 2.1 and 3.0), states the folowing:
+20.3.2 Application Assembler’s responsibilities+
The Application Assembler can use the ejb-link element in the deployment descriptor to link an*
EJB reference to a target enterprise bean.*
The Application Assembler specifies the link between two enterprise beans as follows:*
+• The Application Assembler uses the optional ejb-link element of the ejb-ref or+
ejb-local-ref element of the referencing enterprise bean. The value of the ejb-link*
element is the name of the target enterprise bean. (It is the name defined in the ejb-name element*
of the target enterprise bean.) The target enterprise bean can be in any ejb-jar file in the*
same J2EE application as the referencing application component.*
+• Alternatively, to avoid the need to rename enterprise beans to have unique names within an+
entire J2EE application, the Application Assembler may use the following syntax in the*
ejb-link element of the referencing application component. The Application Assembler*
specifies the path name of the ejb-jar file containing the referenced enterprise bean and*
appends the ejb-name of the target bean separated from the path name by # . The path name*
is relative to the referencing application component jar file. In this manner, multiple beans with*
the same ejb-name may be uniquely identified when the Application Assembler cannot*
change ejb-names.*
+• The Application Assembler must ensure that the target enterprise bean is type-compatible with+
the declared EJB reference. This means that the target enterprise bean must be of the type indicated*
in the ejb-ref-type element, and that the home and component interfaces of the target*
enterprise bean must be Java type-compatible with the interfaces declared in the EJB*
reference.*
The following illustrates an ejb-link in the deployment descriptor.*
+...+
*+<enterprise-beans>+*
*+<session>+*
+...+
*+<ejb-name>EmployeeService</ejb-name>+*
*+<ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class>+*
+...+
*+<ejb-ref>+*
*+<ejb-ref-name>ejb/EmplRecord</ejb-ref-name>+*
*+<ejb-ref-type>Entity</ejb-ref-type>+*
*+<home>com.wombat.empl.EmployeeRecordHome</home>+*
*+<remote>com.wombat.empl.EmployeeRecord</remote>+*
*+<ejb-link>EmployeeRecord</ejb-link>+*
*+</ejb-ref>+*
+...+
*+</session>+*
+...+
*+<entity>+*
*+<ejb-name>EmployeeRecord</ejb-name>+*
*+<home>com.wombat.empl.EmployeeRecordHome</home>+*
*+<remote>com.wombat.empl.EmployeeRecord</remote>+*
+...+
*+</entity>+*
+...+
*+</enterprise-beans>+*
+...+
The Application Assembler uses the ejb-link element to indicate that the EJB reference “Empl-*
Record” declared in the EmployeeService enterprise bean has been linked to the EmployeeRecord*
enterprise bean.</stro
The following example illustrates using the ejb-link element to indicate an enterprise bean reference*
to the ProductEJB enterprise bean that is in the same J2EE application unit but in a different ejb-jar*
file.*
*+<entity>+*
+...+
*+<ejb-name>OrderEJB</ejb-name>+*
*+<ejb-class>com.wombat.orders.OrderBean</ejb-class>+*
+...+
*+<ejb-ref>+*
*+<ejb-ref-name>ejb/Product</ejb-ref-name>+*
*+<ejb-ref-type>Entity</ejb-ref-type>+*
*+<home>com.acme.orders.ProductHome</home>+*
*+<remote>com.acme.orders.Product</remote>+*
*+<ejb-link>../products/product.jar#ProductEJB</ejb-link>+*
*+</ejb-ref>+*
+...+
*+</entity>+* -
Broken orion-ejb-jar.dtd?
I use the Ant task <xmlvalidate> in an EJB project to check the EJB XML deployment descriptors against their DTDs. Checking the (Sun-specified) "ejb-jar.xml" is fine. JDeveloper creates the OC4J specific deployment descriptor "orion-ejb-jar.xml" with a reference to the DTD located at "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd". Now this DTD seems to be broken.
Firstly, the DTD seems to have an invalid syntax. I'm not a DTD expert but Ant complains about lines 279-281 of that DTD :
279: isolation (commited | serializable | uncommited | repeatable_reads)
280: CDATA #IMPLIED
281: locking-mode (pessimistic | optimistic | read-only | old_pessimistic)
286: max-tx-retries CDATA #IMPLIED
287: update-changed-fields-only (true | false) "true"
There seems to be an attribut missing altogether at line 280 (see line 286) so I deleted that line. Then for lines 279 and 281, Ant complained about missing quotes - apparently, such an "enum" needs to have a "default value" (as in line 287), so I manually added such a value for each line.
The final error was in the "orion-ejb-jar.xml" (created by JDeveloper itself). Here is a piece of that:
<orion-ejb-jar>
<enterprise-beans>
<session-deployment max-instances="-1" name="DiscountCalculator"/>
I assume that the "max-instances" attribute sets the number of EJB instances in the OC4J pool to "unlimited". However, according to the DTD, session beans don't have such a "max-instances" attribute (lines 10-21):
<!-- Deployment info for a session bean. -->
ELEMENT session-deployment (env-entry-mapping*, ejb-ref-mapping*, resource-ref-mapping*)
ATTLIST session-deployment call-timeout CDATA #IMPLIED
copy-by-value CDATA #IMPLIED
location CDATA #IMPLIED
max-tx-retries CDATA #IMPLIED
name CDATA #IMPLIED
persistence-filename CDATA #IMPLIED
timeout CDATA #IMPLIED
wrapper CDATA #IMPLIED
replication CDATA #IMPLIED
>
So I copied and pasted the instances attribute from the entity bean section.
How come the DTD is broken? Even the 9.0.3 OC4J docs (http://download-east.oracle.com/docs/cd/A97688_08/generic.903/a97677/dtdxml.htm#620714) talk about all sorts of features (such as the "max-instances" attribute for session beans) and still points to the DTD "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd" that doesn't have these features at all.Karsten,
In case you are still on it, I stumbled upon this some time ago, too. My best guess is that they miss entire phrase, which I put in bold:
....mmited | repeatable_reads ) "commited"
disable-wrapper-cache CDATA #IMPLIED
locking-mode ( pesim...
(There is a line break between '"commited"' and 'disable-wrapper-cache'. 'commited', 'uncommited' must be MISSPELLED exactly as above.)
Btw, max-instances and min-instances are in the DTD that ships with 9.0.3 (jarred in oc4j.jar). This DTD, however, is still broken in the way that you found (it won't even XML-validate). How do they go around this? go figure! Oracle documentation? we all know ...
Best regards,
bjk -
Invalid element 'servlet-mapping' in content of 'web-app'
Hello, JDev gurus!
When compling, JDev 9.0.2.822 produce following error
"oracle.xml.parser.v2.XMLParseException: Invalid element 'servlet-mapping' in content of 'web-app', expected elements '[taglib, resource-ref, security-constraint, login-config, security-role, env-entry, ejb-ref]'."
on line <%@ taglib uri="http://xmlns.oracle.com/bibeans" prefix="orabi" %>
This line was added automatically from component palette.
How can I resolve this error?Hi,
Did you change something into your web.xml file?
Look at your web.xml. You must preserve the order given by the error message:
Servlet-mapping
session-config
mime-mapping
ejb-ref
Jamil -
EJB-QL and date/time types
Hi,
as far as I understand, EJB-QL does not support date/time values.
Does anybody know how to work around this limitation?
Using long values containing milliseconds is not an alternative, because the database stores
date/time values.
I need to compare these date/time values to input parameters in finder methods.
Suggestions?
Bye the way, is there any reason for this limitation in EJB-QL, or did they simply forget to include
date/time types to the spec?
Greetings
ChristianGreetings,
Hi,
as far as I understand, EJB-QL does not support
date/time values. Actually, it does - EJB QL supports all types supported by a bean's abstract schema (IOW: available types for CMP/CMR fields). However, therein also lies the crutch - EJB QL is for querying beans, not the resource to which they map (EJB QL's similarity to SQL is purely for convenience; an Entity Bean, it should be remembered, may represent entities in any persistent store, not just RDBMSes). Therefore, you should be thinking in terms of Java types, not SQL ones... The specification, however, does place "restrictions" (ie. minimally required [vendor] support), on their use which should be limited to long millisecond values (by which a Date object performs an equals comparison... ;).
Does anybody know how to work around this limitation?Depends on what you're attempting. If you're using a Date as an argument to a finder, eg:
findByDateInRange( java.util.Date start, java.util.Date end )then this shouldn't pose a problem where your EJB QL would look like:
SELECT OBJECT(a) FROM MyBeanSchema AS a WHERE a.myDate BETWEEN ?1 AND ?2Presuming the bean MyBean contains a CMP field of type java.util.Date called 'myDate'. If, however, you must use a literal date then you will have to use a long literal unless your vendor supports otherwise. However, it might be worth noting that EJB QL must still be mapped to the underlying resource QL (eg. SQL), and so a more intelligble value (one that meets the resource's format requirements ;), could be used in the actual rQL statement.
Using long values containing milliseconds is not an
alternative, because the database stores
date/time values.I'm guessing you mean here something like "04/23/2002" and "13:13:35", etc. This, however, is not how the database actually stores the data - input/output formats such as these are supported for the convenience of us 'nuerically-challenged' humans (similar to internet hostnames vs. TCP/IP addresses ;) - nor do Java Date/Calendar/Timestamp types store them this way.
I need to compare these date/time values to input
parameters in finder methods.
Suggestions?Ah, yes. Well then... refer back to the above. :)
Bye the way, is there any reason for this limitation
in EJB-QL, or did they simply forget to include
date/time types to the spec?The EJB QL does not explicitly support any specific types beyond those "supported by an EJB's abstract schema", which is pretty much any Java type that can represent a compatible resource type. The reason for the noted "restriction" on date/time types, however, is (likely) due to the way the associated Java classes (not to mention the back-end resource), handle/represent these data internally and this gives the vendor an easily achievable minimal level of compliance for supporting these types.
I hope this helps.
ChristianRegards,
Tony "Vee Schade" Cook -
Access to uup ejb deployed in a shared library
Hello,
I use WLP 10.3.2 and i have deployed an EAR shared library with an ejb uup.
In the ear shared library, we have deploy the uup ejb, the ProfilUser.usr files and the p13n-profile-config.xml.
Could you tell me why in the jndi-name there are the suffix /app/ejb ???!!
p13n-profile-config.xml
<property-adapter>
<name>profilCdnAdapter</name>
<description>profile adapter to use attributes stored in LDAP</description>
<property-mapping>ProfilUser</property-mapping>
<ejb-jndi>portail-uup-user.jar#ProfilUser</ejb-jndi>
<adapter-property>
<name>profilUserCacheName</name>
<value>profilUserCache</value>
</adapter-property>
</property-adapter>
Error stacktrace :
Caused by: javax.naming.NameNotFoundException: While trying to look up /app/ejb//app/ejb/portail-uup-user.jar#ProfilUser/home in /app/ejb/p13n_ejb.jar#UserProfileManager.; remaining name '/app/ejb//app/ejb/portail-uup-user/jar#ProfilUser/home'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:144)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:393)
at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:45)
at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:130)
at javax.naming.InitialContext.lookup(InitialContext.java:392)Check this is correct <ejb-jndi>portail-uup-user.jar#ProfilUser</ejb-jndi>
In portail-uup-user.jar see if you have ejb-name as ProfilUser in ejb-jar.xml it should match. -
Referencing EJB on remote server AND using deployment descriptor
We're using Weblogic 6.1sp2 under Windows 2000.
We have a web application on server A and several EJBs running on server B -
some of these may in the future be moved to different servers.
We would like to ensure that this only requires reconfiguring the deployment
descriptors.
In our web app, we access the EJB's like this:
AccountHome accHome = (AccountHome) (new
InitialContext()).lookup("java:comp/env/ejb/AccountHome")
- we then map ejb/AccountHome to the JNDI name in the weblogic.xml file in
the web app - the JNDI name will usually (but not always) be the class name
of the implementing class, e.g. system.billing.accounting.AccountHome
However, to make this work when the EJB is on server B, we must put a
jndi.properties file in the server A classpath containing
java.naming.provider.url=t3://server_b:7001/
to point to server B.
Now, this makes ALL JNDI lookups on server A go to server B - this is not
what we want. Especially not in the case where some EJB's move to server C -
B and C may be in separate clusters and will not be clustering the JNDI
tree. Also, other web applications on the server will need to go to
different servers.
Alternatively, we could specify a property set in the InitialContext
constructor with a provider url. But in that case, the mapping from
web.xml/weblogic.xml is apparently not applied - or rather, if we look up
"java:comp/env/ejb/AccountHome", weblogic maps it to
"system.billing.accounting.AccountHome" and then tries to look it up on the
local machine, server A.
If we look up "system.billing.accounting.AccountHome", it does correctly
look it up on the server specified in the provider url and finds the entry.
However, this would mean that we would have to specify the exact jndi name.
In addition, we would have to hard-code the server name for each lookup.
An alternative would be to "copy" the JNDI entries from server B to server A
(or to some other shared, global JNDI registry). But these would need to be
kept in sync - especially since server B is really a cluster, where
different servers may come online at different times and register their EJBs
as clusterable, so the stubs would need to be continously updated.
My best idea is to bypass the whole web.xml/weblogic.xml mapping scheme and
just add our own config file with stuff like
<mappings>
<map entry="java:comp/env/ejb/AccountHome">
<jndi-properties>
java.naming.provider.url=t3://server_b:7001/
java.naming.security.principal=jndiuser
java.naming.security.credentials=mysecretpassword
</jndi.properties>
<jndi-name>sysmte.billing.accounting.AccountHome</jndi-name>
</map>
</mappings>
We then need to wrap all the lookups in our own lookup mechanism which first
checks the config file to find any mappings.
However, this seems like reinventing the wheel and will also confuse most
deployment tools etc.
Does anybody have any suggestions where we
1. Don't put a jndi.properties file in the server classpath
2. Lookup ejb's using "java:comp/env/ejb/SomeEJB" - not the JNDI name.
3. Don't hardcode the server names in the application - but potentially
in the deployment descriptor.
4. Can look up different EJB's on different machines
Niels HarremoësThere is an article on dev2dev that may explain what you are seeing...
http://dev2dev.bea.com/articlesnews/discussion/thread.jsp?thread=142
HTH
dwfa
"Niels Ull Harremoës" <[email protected]> wrote in message
news:[email protected]...
It turns out that we can make it work by entering the url of the server in
the weblogic.xml entry - e.g. instead of having
<reference-descriptor>
<ejb-reference-description>
<ejb-ref-name>ejb/AccountHome</ejb-ref-name>
<jndi-name>system.billing.accounting.AccountHome</jndi-name>
</ejb-reference-description>
</reference-descriptor>
we enter
<reference-descriptor>
<ejb-reference-description>
<ejb-ref-name>ejb/AccountHome</ejb-ref-name>
<jndi-name>t3://server_b:7001/system.billing.accounting.AccountHome</jndi-na
me>
</ejb-reference-description>
</reference-descriptor>
However, we are unsure on whether this will establish a new JNDIconnection
to server_b on every lookup? And it's not documented anywhere?
Does anybody have any other suggestions?
"Niels Ull Harremoës" <[email protected]> wrote in message
news:[email protected]...
We're using Weblogic 6.1sp2 under Windows 2000.
We have a web application on server A and several EJBs running on serverB -
some of these may in the future be moved to different servers.
We would like to ensure that this only requires reconfiguring thedeployment
descriptors.
In our web app, we access the EJB's like this:
AccountHome accHome = (AccountHome) (new
InitialContext()).lookup("java:comp/env/ejb/AccountHome")
- we then map ejb/AccountHome to the JNDI name in the weblogic.xml file
in
the web app - the JNDI name will usually (but not always) be the classname
of the implementing class, e.g. system.billing.accounting.AccountHome
However, to make this work when the EJB is on server B, we must put a
jndi.properties file in the server A classpath containing
java.naming.provider.url=t3://server_b:7001/
to point to server B.
Now, this makes ALL JNDI lookups on server A go to server B - this is
not
what we want. Especially not in the case where some EJB's move to serverC -
B and C may be in separate clusters and will not be clustering the JNDI
tree. Also, other web applications on the server will need to go to
different servers.
Alternatively, we could specify a property set in the InitialContext
constructor with a provider url. But in that case, the mapping from
web.xml/weblogic.xml is apparently not applied - or rather, if we look
up
"java:comp/env/ejb/AccountHome", weblogic maps it to
"system.billing.accounting.AccountHome" and then tries to look it up onthe
local machine, server A.
If we look up "system.billing.accounting.AccountHome", it does correctly
look it up on the server specified in the provider url and finds theentry.
However, this would mean that we would have to specify the exact jndiname.
In addition, we would have to hard-code the server name for each lookup.
An alternative would be to "copy" the JNDI entries from server B to
server
A
(or to some other shared, global JNDI registry). But these would need tobe
kept in sync - especially since server B is really a cluster, where
different servers may come online at different times and register theirEJBs
as clusterable, so the stubs would need to be continously updated.
My best idea is to bypass the whole web.xml/weblogic.xml mapping schemeand
just add our own config file with stuff like
<mappings>
<map entry="java:comp/env/ejb/AccountHome">
<jndi-properties>
java.naming.provider.url=t3://server_b:7001/
java.naming.security.principal=jndiuser
java.naming.security.credentials=mysecretpassword
</jndi.properties>
<jndi-name>sysmte.billing.accounting.AccountHome</jndi-name>
</map>
</mappings>
We then need to wrap all the lookups in our own lookup mechanism whichfirst
checks the config file to find any mappings.
However, this seems like reinventing the wheel and will also confuse
most
deployment tools etc.
Does anybody have any suggestions where we
1. Don't put a jndi.properties file in the server classpath
2. Lookup ejb's using "java:comp/env/ejb/SomeEJB" - not the JNDIname.
3. Don't hardcode the server names in the application - butpotentially
in the deployment descriptor.
4. Can look up different EJB's on different machines
Niels Harremoës -
Error when calling ejb.create() call
Hi Folks,
I am trying to create a simple CMP bean with J2EE1.4 but when I call ejb.create I get the following exception :-
Exception in thread "main" java.rmi.ServerException: RemoteException occurred in
server thread; nested exception is:
java.rmi.RemoteException
at com.sun.corba.se.internal.iiop.ShutdownUtilDelegate.mapSystemExceptio
n(Unknown Source)
at javax.rmi.CORBA.Util.mapSystemException(Unknown Source)
at com.titan.customer._CustomerHomeRemote_Stub.create(Unknown Source)
at Client.main(Client.java:20)
Caused by: java.rmi.RemoteException
at com.sun.enterprise.iiop.POAProtocolMgr.mapException(POAProtocolMgr.ja
va:195)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:73
9)
at com.titan.customer.CustomerBean_986018080_ConcreteImpl_RemoteHomeImpl
.create(CustomerBean_986018080_ConcreteImpl_RemoteHomeImpl.java:38)
at com.titan.customer._CustomerBean_986018080_ConcreteImpl_RemoteHomeImp
l_Tie._invoke(Unknown Source)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispa
tchToServant(CorbaServerRequestDispatcherImpl.java:648)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispa
tch(CorbaServerRequestDispatcherImpl.java:191)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest
Request(CorbaMessageMediatorImpl.java:1655)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest
(CorbaMessageMediatorImpl.java:1514)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(C
orbaMessageMediatorImpl.java:896)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.call
back(RequestMessage_1_2.java:172)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest
(CorbaMessageMediatorImpl.java:668)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatc
h(SocketOrChannelConnectionImpl.java:352)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.read(So
cketOrChannelConnectionImpl.java:261)
at com.sun.corba.ee.impl.transport.ReaderThreadImpl.doWork(ReaderThreadI
mpl.java:73)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.
run(ThreadPoolImpl.java:382)
Bean code :-
package com.titan.customer;
import javax.ejb.EntityContext;
public abstract class CustomerBean implements javax.ejb.EntityBean {
public Integer ejbCreate(Integer id) {
setId(id);
return id;
public void ejbPostCreate() {
//abstract methods
public abstract Integer getId();
public abstract void setId(Integer Id);
public abstract String getLastName();
public abstract void setLastName(String lastName );
public abstract String getFirstName();
public abstract void setFirstName(String firstName);
public void setEntityContext(EntityContext ec) {}
public void unsetEntityContext() {}
public void ejbLoad() {}
public void ejbStore() {}
public void ejbActivate() {}
public void ejbPassivate() {}
public void ejbRemove() {}
ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="2.1" 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">
<display-name>CustomerBean</display-name>
<enterprise-beans>
<entity>
<ejb-name>CustomerBean</ejb-name>
<home>com.titan.customer.CustomerHomeRemote</home>
<remote>com.titan.customer.CustomerRemote</remote>
<ejb-class>com.titan.customer.CustomerBean</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>CustomerBean</abstract-schema-name>
<cmp-field>
<description>no description</description>
<field-name>firstName</field-name>
</cmp-field>
<cmp-field>
<description>no description</description>
<field-name>id</field-name>
</cmp-field>
<cmp-field>
<description>no description</description>
<field-name>lastName</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
<security-identity>
<use-caller-identity/>
</security-identity>
</entity>
</enterprise-beans>
</ejb-jar>
sun cmp mapping
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-cmp-mappings PUBLIC "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 OR Mapping //EN" "http://www.sun.com/software/sunone/appserver/dtds/sun-cmp-mapping.dtd">
<sun-cmp-mappings>
<sun-cmp-mapping>
<schema>CustomerBean_jar</schema>
<entity-mapping>
<ejb-name>CustomerBean</ejb-name>
<table-name>CUSTOMERBEAN</table-name>
<cmp-field-mapping>
<field-name>firstName</field-name>
<column-name>CUSTOMERBEAN.FIRSTNAME</column-name>
</cmp-field-mapping>
<cmp-field-mapping>
<field-name>id</field-name>
<column-name>CUSTOMERBEAN.ID</column-name>
</cmp-field-mapping>
<cmp-field-mapping>
<field-name>lastName</field-name>
<column-name>CUSTOMERBEAN.LASTNAME</column-name>
</cmp-field-mapping>
</entity-mapping>
</sun-cmp-mapping>
</sun-cmp-mappings>
sun-ejb-jar.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 8.0 EJB 2.1//EN" "http://www.sun.com/software/sunone/appserver/dtds/sun-ejb-jar_2_1-0.dtd">
<sun-ejb-jar>
<enterprise-beans>
<name>CustomerBean</name>
<unique-id>579688304</unique-id>
<ejb>
<ejb-name>CustomerBean</ejb-name>
<jndi-name>CustomerBean</jndi-name>
</ejb>
<pm-descriptors/>
<cmp-resource>
<jndi-name>jdbc/Vineeth</jndi-name>
<create-tables-at-deploy>true</create-tables-at-deploy>
<drop-tables-at-undeploy>true</drop-tables-at-undeploy>
<schema-generator-properties>
<property>
<name>use-unique-table-names</name>
<value>true</value>
</property>
<property>
<name>java-to-database</name>
<value>true</value>
</property>
</schema-generator-properties>
</cmp-resource>
</enterprise-beans>
</sun-ejb-jar>
Can someone please help me out with this...this is a bit urgent..
ThanksIt seems that u need a ejbPostCreate with the same parameters as ejbCreate:
public Integer ejbCreate(Integer id) {
setId(id);
return id;
public void ejbPostCreate(Integer id) {
} -
Problem deploying EJB entity bean
Hi all!
I'm trying to deploy an CMP entity bean with composite primary key.
My environment is Oracle 8i (8.1.7) on W2K Professional and I'm using JDK 1.3.1_02.
The error I get is:
Compiling Stubs...done
Generating Jar File...done
Loading EJB Jar file and Comm Stubs Jar file...done
Generating EJBHome and EJBObject on the server...
An exception occurred during code generation: null
I don't understand what am I doing wrong...
Any help will be highly appreciated.
[Could anyone point me out sample code for CMP entity beans with composite primary key?]
Apologies for the length of the POST, just trying to pass as much info as I can...
The table is the following:
CREATE TABLE GPS_HIST (
gps_date_of_fix VARCHAR2(40) NOT NULL,
gps_time_of_fix VARCHAR2(40) NOT NULL,
issi NUMBER(10) NOT NULL,
gps_condition NUMBER(5),
gps_latitude VARCHAR2(40),
gps_longitude VARCHAR2(40),
gps_speed_knt NUMBER(10),
constraint gps_hist_pk primary key (gps_date_of_fix, gps_time_of_fix, issi))
TABLESPACE AVLDATA
PCTFREE 10 PCTUSED 40
INITRANS 1 MAXTRANS 255
STORAGE (
INITIAL 128K NEXT 128K PCTINCREASE 0
MINEXTENTS 1 MAXEXTENTS 4096)
NOCACHE;
The primary key class is the following:
package gps;
public class GPSEntryPK implements java.io.Serializable
public int ISSI;
public String gpsTimeOfFix;
public String gpsDateOfFix;
public GPSEntryPK() {}
public GPSEntryPK (String gpsDateOfFix, String gpsTimeOfFix, int ISSI)
this.gpsDateOfFix = gpsDateOfFix;
this.gpsTimeOfFix = gpsTimeOfFix;
this.ISSI = ISSI;
public String getGPSDateOfFix()
return this.gpsDateOfFix;
public String getGPSTimeOfFix()
return this.gpsTimeOfFix;
public int getISSI()
return this.ISSI;
public boolean equals(Object obj) {
if ((obj instanceof GPSEntryPK) &&
(this.ISSI == ((GPSEntryPK)obj).ISSI) &&
(this.gpsTimeOfFix.equals(((GPSEntryPK)obj).gpsTimeOfFix)) &&
(this.gpsDateOfFix.equals(((GPSEntryPK)obj).gpsDateOfFix)))
return true;
return false;
public int hashCode() {
return (this.gpsTimeOfFix.concat(this.gpsDateOfFix)).hashCode() * this.ISSI;
The bean implemantation (part of it) is as follows:
public void setEntityContext(EntityContext ctx)
this.ctx = ctx;
Properties props = ctx.getEnvironment();
public void unsetEntityContext()
this.ctx = null;
public GPSEntryPK ejbCreate(String gpsDateOfFix, String gpsTimeOfFix, int ISSI, int gpsCondition,
String gpsLatitude, String gpsLongitude, double gpsSpeedKnt)
throws CreateException, RemoteException
try {
setGPSDateOfFix(gpsDateOfFix);
setGPSTimeOfFix(gpsTimeOfFix);
setISSI(ISSI);
setGPSCondition(gpsCondition);
setGPSLatitude(gpsLatitude);
setGPSLongitude(gpsLongitude);
setGPSSpeedKnt(gpsSpeedKnt);
} catch (java.rmi.RemoteException e) {
throw new CreateException();
return null;
public GPSEntryPK ejbFindByPrimaryKey(GPSEntryPK pk) throws RemoteException, FinderException {
return null;
public void ejbPostCreate(String gpsDateOfFix, String gpsTimeOfFix, int ISSI, int gpsCondition,
String gpsLatitude, String gpsLongitude, double gpsSpeedKnt)
throws CreateException
// get primarykey
GPSEntryPK pk = (GPSEntryPK)ctx.getPrimaryKey();
public void ejbActivate() {}
public void ejbPassivate() {}
public void ejbRemove() {}
public void ejbLoad()
// You can get to the primary key
GPSEntryPK pk = (GPSEntryPK)ctx.getPrimaryKey();
public void ejbStore(){}
The descriptors are the following:
"gpsentry.xml"
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems Inc.//DTD Enterprise JavaBeans 1.1//EN" "ejb-jar.dtd">
<ejb-jar>
<enterprise-beans>
<entity>
<description>no description</description>
<ejb-name>GPSEntry</ejb-name>
<home>gps.GPSEntryHome</home>
<remote>gps.GPSEntry</remote>
<ejb-class>gpsServer.GPSEntryBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>gps.GPSEntryPK</prim-key-class>
<reentrant>False</reentrant>
<cmp-field><field-name>gpsDateOfFix</field-name></cmp-field>
<cmp-field><field-name>gpsTimeOfFix</field-name></cmp-field>
<cmp-field><field-name>ISSI</field-name></cmp-field>
<env-entry>
<env-entry-name>realmName</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>gps.realm</env-entry-value>
</env-entry>
<env-entry>
<env-entry-name>GPSEntryBean.databaseURL</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>jdbc:oracle:kprb:</env-entry-value>
</env-entry>
<env-entry>
<env-entry-name>GPSEntryBean.JDBCDriverName</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>oracle.jdbc.driver.OracleDriver</env-entry-value>
</env-entry>
</entity>
</enterprise-beans>
</ejb-jar>
"oracle_gpsentry.xml"
<?xml version="1.0"?>
<!DOCTYPE oracle-descriptor PUBLIC "-//Oracle Corporation.//DTD Oracle 1.1//EN" "oracle-ejb-jar.dtd">
<oracle-descriptor>
<mappings>
<ejb-mapping>
<ejb-name>GPSEntry</ejb-name>
<jndi-name>test/gpsentry</jndi-name>
</ejb-mapping>
</mappings>
<persistence-provider>
<description> specifies a type of persistence manager </description>
<persistence-name>psi-ri</persistence-name>
<persistence-deployer>oracle.aurora.ejb.persistence.ocmp.OcmpEntityDeployer</persistence-deployer>
</persistence-provider>
<persistence-descriptor>
<description> This specifies a particular type of persistence manager to be used for a bean. param is where you would put bean specific persistence info in the format of params. The deployment process just passes what's in the param to the persistence deployer. For the baby persistence, we do parse the persistence-mapping but for other persistence backend we don't do anything with the params </description>
<ejb-name>customerbean</ejb-name>
<persistence-name>psi-ri</persistence-name>
<psi-ri>
<schema>AVLMIS</schema>
<table>gps_hist</table>
<attr-mapping>
<field-name>gpsDateOfFix</field-name>
<column-name>gps_date_of_fix</column-name>
</attr-mapping>
<attr-mapping>
<field-name>gpsTimeOfFix</field-name>
<column-name>gps_time_of_fix</column-name>
</attr-mapping>
<attr-mapping>
<field-name>ISSI</field-name>
<column-name>issi</column-name>
</attr-mapping>
<attr-mapping>
<field-name>gpsCondition</field-name>
<column-name>gps_condition</column-name>
</attr-mapping>
<attr-mapping>
<field-name>gpsLatitude</field-name>
<column-name>gps_latitude</column-name>
</attr-mapping>
<attr-mapping>
<field-name>gpsLongitude</field-name>
<column-name>gps_longitude</column-name>
</attr-mapping>
<attr-mapping>
<field-name>gpsSpeedKnt</field-name>
<column-name>gps_speed_knt</column-name>
</attr-mapping>
</psi-ri>
</persistence-descriptor>
</oracle-descriptor>
Thanks in advance.Hi Nikos,
I obviously don't know what your entire situation is, but you may not
be aware that Oracle's DBMS embedded EJB container does not work well,
and as a result, Oracle decided to replace it with an external EJB
container which is part of a product called "Oracle Containers for
J2EE" (otherwise known as "OC4J"). The "other" forum (the J2EE forum)
deals mainly with OC4J.
As far as I know, Oracle recommends doing your EJB related work with
OC4J and not with the embedded EJB container.
Good Luck,
Avi. That's correct
Java code, implementing data bound logic, can still run in the database as Java stored procedures/packages/functions/triggers
while J2EE componentsdeployed in middle-tier implement business logic. Java in database enable the database to be an active participant to your deployment platform
in 9iDB R2 you will even be able to call-out Web client (using HTTP Client), EJB client (using oc4jclient.jar) or Web Service client
(using SOAP libraries)
Kuassi -
Wl5.1 ejb security checking is backwards
In 5.1 for ejb security checking you seem to check for users first,
then groups.
ie:
at weblogic.security.acl.CachingRealm.getUser(CachingRealm.java:1057)
at
weblogic.ejb.internal.SecurityRoleMapping.lookupPrincipal(SecurityRoleeMapping.java:236)
I dont have a code, but from the stack I can see you first calling
getUser, if its null, then calling getGroup.
I think in 4.51 you checked groups first (I dont have the stack since
its long gone, but I didnt have the sql im getting generated in 4.5.1).
Since most people map ejbs to groups (mapping directly to users is
inflexible), I think it would make sense from a performance perspective
to check groups first, then look for users.
Also, for compatibility sake, I would think such a change should be
noted in the release notes.
let me know if you agree, Ill open a case with support.
-JoelIn 5.1 for ejb security checking you seem to check for users first,
then groups.
ie:
at weblogic.security.acl.CachingRealm.getUser(CachingRealm.java:1057)
at
weblogic.ejb.internal.SecurityRoleMapping.lookupPrincipal(SecurityRoleeMapping.java:236)
I dont have a code, but from the stack I can see you first calling
getUser, if its null, then calling getGroup.
I think in 4.51 you checked groups first (I dont have the stack since
its long gone, but I didnt have the sql im getting generated in 4.5.1).
Since most people map ejbs to groups (mapping directly to users is
inflexible), I think it would make sense from a performance perspective
to check groups first, then look for users.
Also, for compatibility sake, I would think such a change should be
noted in the release notes.
let me know if you agree, Ill open a case with support.
-Joel -
Problem with mapping the Entity beans onto database tables
Hi,
I got a problem with mapping the Entity beans onto database tables. Here are what I did:
First Step:
asant capture-schema
Second Step:
capture-schema -driver com.pointbase.jdbc.jdbcUniversalDriver -dburl jdbc:pointbase:server://localhost/sun-appserv-samples -username pbPublic -password pbpublic -table APPLICANT -table APPLICANTSKILL -table CUSTOMER -table LOCATION -table job -table JOBSKILL -table SKILL -out build/agency.dbschema
The first step was fine. But, in the second step, I got the error message as follow:
using dburl:jdbc:pointbase:server://localhost/sun-appserv-samples
using username:pbPublic
using password:pbpublic
using driver:com.pointbase.jdbc.jdbcUniversalDriver
using schemaname:null
using output file:build/agency.dbschema
JDO71100: Failed to find a class. Verify that the class is available on your CLASSPATH
java.lang.ClassNotFoundException: com.pointbase.jdbc.jdbcUniversalDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at com.sun.forte4j.modules.dbmodel.jdbcimpl.ConnectionProvider.<init>(Co
nnectionProvider.java:38)
at com.sun.jdo.api.persistence.mapping.ejb.CaptureSchema.main(CaptureSch
ema.java:130)
at com.sun.jdo.spi.persistence.support.ejb.util.CaptureSchemaWrapper.mai
n(CaptureSchemaWrapper.java:29)
Thanks for your help!You need to add the pbclient.jar or some similar name like that, in the CalssPath.
-
ie. Is this valid?
<query>
<description>Find data between dates</description>
<query-method>
<method-name>findMetricsByDate</method-name>
<method-params>
<method-param>java.sql.Timestamp</method-param>
</method-params>
<method-params>
<method-param>java.sql.Timestamp</method-param>
</method-params>
</query-method>
<result-type-mapping>Local</result-type-mapping>
<ejb-ql>
SELECT OBJECT (o) FROM MetricResults AS o WHERE MetricResults.date > ?1 AND MetricResults.date < ?2
</ejb-ql>
</query>No. Not with current EJB 2.0 CMP specs at least. Later revisions are supposed to fix this, but for now, this seriously limits the usefulness of EJB-QL.
.P.
Maybe you are looking for
-
URGENT: Please help me with my corrupted files!
Hi all, I desperately need help. On my Mac Mini running Yosemite 'Disk Utility' is telling me that the Mac's internal HDD is faulty and needs to be replaced and that's fine because I'll buy a new HDD, BUT I need to copy off some important .PDF files
-
What DNS servers are best for someone who is remote/traveling. What about search domains?
-
Pro Oracle Application Express - Book
I thought this book was being released at the end of June? It appears as though now it's just a pre order and it doesn't ship until September? Chad
-
I am unable to set up email. I am using PSE 13 and windows 7 pro
-
My iPad Mini isn't able to download songs
I just got my iPad Mini a few days ago and I am able to buy a song but when it finishes downloading I go to the music app and it isn't there.... Anything I can do?