ejb-3.0

Toplink Exception, whats wrong?

Hey, I've got an excpetion when I generate this EJB SQL Statement. Exception Description: Syntax error parsing the query [SELECT h FROM Busmodul h WHERE LOWER(h.modulNummer) LIKE :modulnummer AND h.einbauort.id = :einbauort_fk AND h.plattform.id = :plattform_fk ORDER BY TRIM(TRAILING '-' FROM CONCAT('0', h.modulNummer))], line 1, c...

Accessing the clients principal inside an ejb method.

Hello, I need to access the clients principal (username ) inside a ejb method. I don't want to add it as a parameter. Tryed adding them to Context object like ; prop.add(Context.SECURITY_AUTHENTICATION,"user") prop.add(Context.SECURITY_CREDENTIALS,"pass") but trying to access them inside the method like; @Resource private Sess...

What is the workflow for development using EJB3 with Eclipse Galileo and Glassfish v3?

I'm starting to learn EJB3 and I'm a bit lost when it comes to setting up Eclipse. I've got Glassfish v3 prelude downloaded and set up in Eclipse, but when I attempt to publish my EJB project to the server, I'm told that the server is incompatible with the EJB3 facet of the project. What would the proper steps be to create a new EJB3 pr...

Insert 'Text' field data type into MySQL using EJB 3

private String message = ""; public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } I am using EJB3 and MySQL 5.1 using Java. I want to insert paragraphs of texts into MySQL Database using Entity Bean. But, When I add, MySQL can accept only 255 characters. It shows m...

What exceptions are thrown by JPA in ejb containers?

I am developing an EJB application to run on glassfish v3. If I look at the javadoc for the EntityManager class it says that methods like find, persist etc throw exceptions derived from PersistenceException. However, in practice I notice that exceptions derived from org.eclipse.persistence.exceptions.DatabaseException can be thrown if so...

Classpath entry eclipse.fproj.jdt.libprov.osgi/jpt.jpa is marked for publish/export but is not exported on the project classpath

I'm trying to get a new Enterprise Application Project set up in Eclipse using Glassfish as my app server and I'm seeing the following warning: Classpath entry eclipse.fproj.jdt.libprov.osgi/jpt.jpa is marked for publish/export but is not exported on the project classpath. Classpath visibility within Eclipse and at runtime will differ. ...

How to add an Interbase connection pool to glassfish?

Hi, I am attempting to add an Interbase connection pool to GlassFish v3 to use EJB 3.1 in a project. The glassfish log appears to be connecting to my database properly, it spits out all my table names and indices. However, I get an error INFO: fetching database metadata SEVERE: could not complete schema update java.lang.NullPointerExc...

JBOSS 5.1 bean installing sequence

I am debugging my project and found that in my jboss log, the beans are loaded in this sequence: 14:30:01,015 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=EJB3-JPA2.jar,jar=EJB3-JPA2.jar,name=RecorderBean,service=EJB3 14:30:01,015 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=EJB3-JPA2.jar,jar=EJB3-JPA2.jar,name=...

Eclipse Galileo + Glassfish v3: JPADeployer NullPointerException on deploy

I've created a very simple "Enterprise Application" project with about 7 entity beans and one stateless session bean. I've also configured an instance of Glassfish v3 to run as my application server. Unfortunately, when I attempt to publish the EAR to Glassfish, I'm getting the following response: SEVERE: Exception while invoking class...

Is it okay to pass injected EntityManagers to EJB bean's helper classes and use it?

We have some JavaEE5 stateless EJB bean that passes the injected EntityManager to its helpers. Is this safe? It has worked well until now, but I found out some Oracle document that states its implementation of EntityManager is thread-safe. Now I wonder whether the reason we did not have issues until now, was only because the implement...

Is it possible to inject a list of beans implementing an interface using JEE

I wonder, if I can inject a list of (stateless) beans, that all implementing a special interface. For example I've a module contract public interface ResetService { void reset(MyContext context); } Than I've two modules, that are implementing this interface. And one module, that should call all implementations: @EJBs private List<...

How do i access EJB implementing remote interface in separate web application?

Hello, I am using Netbeans 6.8 and Glassfish v3.0. I created an ejb module and created entity classes from database and then created stateless session bean with remote interface. Say eg. @Remote public interface customerRemote{ public void add(String name, String address); public Customer find(Integer id); } @Stateless pub...

Problem running a simple EJB application

I am currently running a simple EJB application using a stateless Session Bean. I am working on NetBeans 6.8 with Personal Glassfish 3.0 and I have installed on my system both the Java EE and the Java SE. I don't know whether it is relevent but I am running Windows7 64-bit version. The Session Bean I implemented has just one method sayHe...

logback with EJB3.1

I am using logback/slf4j to handle logging in my application. Everything was working perfectly until I started using EJBs. Once I added a stateless EJB to my app, the logger started ignoring my logback.xml and stopped using my appenders. I switched to a programmatic logger configuration to see what was wrong and now I am getting the foll...

How to cache queries in EJB and return result efficient (performance POV)

I use JBoss EJB 3.0 implementation (JBoss 4.2.3 server) At the beginning I created native query all the time using construction like Query query = entityManager.createNativeQuery("select * from _table_"); Of couse it is not that efficient, I performed some tests and found out that it really takes a lot of time... Then I found a better...

Problem configuring application specific loggin glassfish v3

I am using java.util.logging in an EJB application running on glassfish v3. I can see the log messages in server.log but i don't seem to be able to configure the logging level in glassfish\domains\domain1\config\logging.properties. If I use: Logger logger = Logger.getLogger("com.foo"); To obtain the logger and log with: logger.info("...

Problem in creation MDB Queue connection at Jboss StartUp

I am not able to create a Queue connection in JBOSS4.2.3GA Version & Java1.5, as I am using MDB as per the below details. I am putting this MDB in a jar file(named utsJar.jar) and copied it in deploy folder of JBOSS, In the test env. this MDB works well but in another env. [ env settings and jboss/java ver is same ] it is throwing erro...

JBoss EJB Bean not bound

Hi, I have the following error Exception in thread "main" javax.naming.NameNotFoundException: CounterBean not bound trying to access an EJB JAR CounterBean.jar deployed on JBoss5 from a client application outside the Application Server. From the Jboss log, it looks like it does not have a global JNDI name? Is this ok? What have I ...

"detached entity passed to persist error" with JPA/EJB code

I am trying to run this basic JPA/EJB code: public static void main(String[] args){ UserBean user = new UserBean(); user.setId(1); user.setUserName("name1"); user.setPassword("passwd1"); em.persist(user); } I get this error: javax.ejb.EJBException: javax.persistence.PersistenceException:...

In @Table(name = "tableName") - make "tableName" a variable in JPA

I am using JPA and I need to make the "tableName" a variable. In a database, I have many tables, and my code needs to access the table where I specify it to read. @Entity @Table(name = "tableName") public class Database implements Serializable {...............} Any ideas? ...