[EJB 3.0] - Problems with Local SessionBeans
by elster
I'am using Local SessionBeans with Object Arguments.
For Example:
@Stateless
@Local(BiManager.class)
@LocalBinding(jndiBinding="BiManager")
public class UserManagerBean implements UserManager {
public void registerUser(Object newUserData){
...
I get a error message (IllegalArgumentException....)
When i am changing "Object newUserData" to "String newUserData" then i get a correct configurated Code, which is running on the deploy folder.
On the other hand, when i change the code from LocalBean to RemoteBean then the code is not running. So my conclusion is that i can use primitive datatypes only on LocalBeans and with RemoteBeans i can handle object types. is this a bug or feature. Am I doing smth wrong?
Thanks for your replies.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978724#3978724
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978724
19 years, 8 months
[Installation, Configuration & Deployment] - Find the path to my deployed .ear file
by asdf09
Hello all,
I'm a newbie and am trying to programatically find the filesystem path to the its .ear file, without to explicitly specify it. (I deploy myapp.ear in the jboss/server/default/deploy directory, but I don't want to have to configure it)
I found a way (a hack) to do it like this:
String rootPath = getClass().getResource("/").getFile();
This points to the dir where the Tomcat deployer has deployed the app: jboss/server/default/tmp/deploy/tmp123myapp.ear-contents/myapp-webservice-exp.war . Then I create a File object and have the dir.
File earDir = new File(rootPath).getParentFile();
This URL-hack is certainly very deployment- and JBoss-specific and I was looking for a more-elegant solution. Perhaps the Java Management API (JSR-77) or the Java Deployment API (JSR-88) would help me? Any hints or code would be very appreciated!
Rusi
PS: My actual goal is to list all classes in my application that implement a given interface. I was surprised to see that this was not possible using Reflection. The only solution seems to be to brute-force search in the application's .ear file (or in the deployer's temp-dir) and to compare all classes with the interface using Class.isAssignableFrom().
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978722#3978722
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978722
19 years, 8 months
[EJB 3.0] - Re: ejbql - problem with like and named parameter
by r_mun
Hi, Adam
I have faced the same problem. You have probably found the sollution youself.
Just for the protocol I'll add my sollution to this problem so that others could use it.
The query I formed was like
SELECT distinct object(o) FROM Rental o WHERE lower (o.description) LIKE lower('%:fullTextSearch%')
later in the code an attribute was set via (q is a an EJB3 Query object)
q.setParameter("fullTextSearch", aSubStringToSearchFor);
After playing with parameters and code I finally did the following changes that fixed the issue.
SELECT distinct object(o) FROM Rental o WHERE lower (o.description) LIKE lower(:fullTextSearch)
and the attribute setter like
q.setParameter("fullTextSearch", "%" + aSubStringToSearchFor + "%");
The problem is obviously that Hibernate is not capable of setting a parameter within single-quoted statements.
Regards,
Roman Muntyanu
http://www.yukon.cv.ua
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3978721#3978721
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3978721
19 years, 8 months