[EJB/JBoss] - EJB2 -> EBJ3 in JBoss 4.0.4 not working with EJB2 jar
by mdhuyn
Hi,
I have an EJB2 jar file that deploys fine using the 'default' configuration on JBoss 4.0.4.GA.
I deploy this same jar file in JBoss 4.0.4.GA using the 'all' configuration with EJB3 and JBossWS and I get exception below. I don't know what could be the illegal arguments mentioned. All the Local/Home/Remote/etc. interfaces are included and specified in the ejb-jar.xml file, so I don't understand this error?
Is there something very basic that I'm missing? I thought EJB2 could co-exist with EJB3.
We'll eventually upgrade to EJB3, but I need to verify our upgrade to JBossWS works beforehand.
Any help appreciated. Thanks.
17:52:57,561 WARN [verifier] EJB spec violation:
| Bean : XXXtBean
| Section: 12.2.2
| Warning: The class must implement, directly or indirectly, the javax.ejb.EntityBean interface.
|
| 17:52:57,561 WARN [verifier] EJB spec violation:
| Bean : XXXtBean
| Section: 22.2
| Warning: The bean provider must specify the fully-qualified name of the enterprise bean's local home interface, if any,
| in the <local-home> element.
| Info : Class not found on 'com.appserver.local.XXXHome': Unexpected error during load of: com.appserver.local.XXXHome, msg=Illegal field modifiers in class com/appserver/local/XXXHome: 0x2
|
| 17:52:57,571 WARN [verifier] EJB spec violation:
| Bean : XXXBean
| Section: 22.2
| Warning: The bean provider must specify the fully-qualified name of the enterprise bean's local interface, if any, in the <local> element.
| Info : Class not found on 'com.appserver.local.XXXLocal': Unexpected error during l
| oad of: com.appserver.local.XXXLocal, msg=Illegal field modifiers in class com/appserver/local/XXXLocal: 0x2
|
| 17:52:57,571 WARN [verifier] EJB spec violation:
| Bean : XXXBean
| Section: 12.2.1
| Warning: The Bean Provider must provide a remote interface and a remote home interface or a local interface and a local
| home interface for the bean.
|
| ...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966516#3966516
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966516
19 years, 8 months
[EJB 3.0] - Re: get Object field in MS SQL
by ccharpentier
Hi,
I managed to crete my image field in MS SQL to get file larger than 8Ko
I create a Blob in my entity
| package com.edieyes.oma.entities;
|
| import java.io.InputStream;
| import java.sql.Blob;
| import java.sql.Date;
|
| import javax.persistence.Basic;
| import javax.persistence.Entity;
| import javax.persistence.FetchType;
| import javax.persistence.GeneratedValue;
| import javax.persistence.Id;
| import javax.persistence.Lob;
| import javax.persistence.Table;
|
| import org.hibernate.annotations.Type;
|
| @Entity
| @Table(name="FichierOma")
| public class FichierOma {
|
| Integer id;
| String numCommande;
| String numJob;
| String idClient;
| Date insertDate;
| Blob fichierOma;
| /**
| * @return Returns the fichierOma.
| */
| @Lob @Basic(fetch = FetchType.EAGER)
| public Blob getFichierOma() {
| return fichierOma;
| }
| /**
| * @param fichierOma The fichierOma to set.
| */
| public void setFichierOma(Blob fichierOma) {
| this.fichierOma = fichierOma;
| }
|
| /**
| * @return Returns the id.
| */
| @Id
| @GeneratedValue
| public Integer getId() {
| return id;
| }
| /**
| * @param id The id to set.
| */
| public void setId(Integer id) {
| this.id = id;
| }
| /**
| * @return Returns the idClient.
| */
| public String getIdClient() {
| return idClient;
| }
| /**
| * @param idClient The idClient to set.
| */
| public void setIdClient(String idClient) {
| this.idClient = idClient;
| }
| /**
| * @return Returns the insertDate.
| */
| public Date getInsertDate() {
| return insertDate;
| }
| /**
| * @param insertDate The insertDate to set.
| */
| public void setInsertDate(Date insertDate) {
| this.insertDate = insertDate;
| }
| /**
| * @return Returns the numCommande.
| */
| public String getNumCommande() {
| return numCommande;
| }
| /**
| * @param numCommande The numCommande to set.
| */
| public void setNumCommande(String numCommande) {
| this.numCommande = numCommande;
| }
| /**
| * @return Returns the numJob.
| */
| public String getNumJob() {
| return numJob;
| }
| /**
| * @param numJob The numJob to set.
| */
| public void setNumJob(String numJob) {
| this.numJob = numJob;
| }
|
| }
|
and I get in my SQL SERVER
id : int
idClient : varchar(255)
fichierOma : image
insertDate : datetime
numCommande : varchar(255)
numJob : varchar(255)
but now I ve got another problem
when I want to insert an entity I get this error message
| javax.ejb.EJBException: java.lang.IllegalStateException: Blobs may not be access
| ed after serialization
| at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.ja
| va:69)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
| at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java
| :197)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
| java:101)
| at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInt
| erceptor.java:76)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
| java:101)
| at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(Stateles
| sInstanceInterceptor.java:62)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
| java:101)
| at org.jboss.aspects.security.AuthenticationInterceptor.invoke(Authentic
| ationInterceptor.java:78)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
| java:101)
| at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterce
| ptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
| java:101)
| at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(Asynchrono
| usInterceptor.java:106)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
| java:101)
| at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessCo
| ntainer.java:227)
| at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.
| java:59)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
| java:101)
| at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteP
| roxy.java:102)
| at $Proxy169.addfile(Unknown Source)
| at com.edieyes.oma.servlet.Test2Servlet.createUsers(Test2Servlet.java:96
| )
| at com.edieyes.oma.servlet.Test2Servlet.doPost(Test2Servlet.java:68)
| at com.edieyes.oma.servlet.Test2Servlet.doGet(Test2Servlet.java:63)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
| icationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
| ilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
| lter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
| icationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
| ilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
| alve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
| alve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
| yAssociationValve.java:175)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
| e.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
| ava:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
| ava:105)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
| ve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
| a:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
| :869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.p
| rocessConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpo
| int.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWor
| kerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
| Caused by: java.lang.IllegalStateException: Blobs may not be accessed after seri
| alization
| at org.hibernate.lob.SerializableBlob.getWrappedBlob(SerializableBlob.ja
| va:23)
| at org.hibernate.type.BlobType.set(BlobType.java:38)
| at org.hibernate.type.BlobType.nullSafeSet(BlobType.java:117)
| at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(Abst
| ractEntityPersister.java:1910)
| at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(Abst
| ractEntityPersister.java:1887)
| at org.hibernate.persister.entity.AbstractEntityPersister$1.bindValues(A
| bstractEntityPersister.java:2038)
| at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(Abstr
| actReturningDelegate.java:32)
| at org.hibernate.persister.entity.AbstractEntityPersister.insert(Abstrac
| tEntityPersister.java:2044)
| at org.hibernate.persister.entity.AbstractEntityPersister.insert(Abstrac
| tEntityPersister.java:2481)
| at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentit
| yInsertAction.java:47)
| at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:248)
| at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplic
| ate(AbstractSaveEventListener.java:290)
| at org.hibernate.event.def.AbstractSaveEventListener.performSave(Abstrac
| tSaveEventListener.java:180)
| at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId
| (AbstractSaveEventListener.java:108)
| at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient
| (DefaultPersistEventListener.java:131)
| at org.hibernate.event.def.DefaultPersistEventListener.onPersist(Default
| PersistEventListener.java:87)
| at org.hibernate.event.def.DefaultPersistEventListener.onPersist(Default
| PersistEventListener.java:38)
| at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:620)
| at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:594)
| at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:598)
| at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityMan
| agerImpl.java:186)
| at org.jboss.ejb3.entity.TransactionScopedEntityManager.persist(Transact
| ionScopedEntityManager.java:175)
| at com.edieyes.oma.bean.OmaBean.addfile(OmaBean.java:27)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
| java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
| sorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
| java:112)
| at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationCo
| ntextImpl.java:166)
| at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3Int
| erceptorsInterceptor.java:63)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
| java:101)
| at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invok
| e(TransactionScopedEntityManagerInterceptor.java:54)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
| java:101)
| at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsI
| nterceptor.java:47)
| at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.
| java:101)
| at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
|
|
here the code of my servlet
| import java.io.File;
| import java.io.FileInputStream;
| import java.io.IOException;
| import java.io.InputStream;
| import java.io.PrintWriter;
| import java.sql.Date;
| import java.sql.ResultSet;
| import java.util.Iterator;
|
| import javax.naming.Context;
| import javax.naming.InitialContext;
| import javax.naming.NamingException;
| import javax.servlet.ServletConfig;
| import javax.servlet.ServletException;
| import javax.servlet.http.HttpServlet;
| import javax.servlet.http.HttpServletRequest;
| import javax.servlet.http.HttpServletResponse;
|
| import com.edieyes.oma.bean.Oma;
| import com.edieyes.oma.entities.FichierOma;
|
|
|
|
| public class Test2Servlet extends HttpServlet {
|
| /**
| *
| */
| private static final long serialVersionUID = 1L;
| private Oma usersService;
|
| public void init(ServletConfig config) throws ServletException {
| System.out.println("*******INIT*****");
| try {
| Context ctx = new InitialContext();
| ///usersService = (RemoteUsers) ctx.lookup(RemoteUsers.class.getName());
| usersService = (Oma) ctx.lookup("OmaBean/remote");
|
|
| } catch (NamingException e) {
| System.out.println("**EXCEPTION 1 *");
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
| }
|
|
|
| protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
| doPost(req,resp);
| }
|
| protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
| createUsers(req,resp);
|
| }
| private void createUsers(HttpServletRequest req, HttpServletResponse resp)
| throws ServletException, IOException
| {
| resp.setContentType("text/html");
| PrintWriter htout = resp.getWriter();
| htout.println("<body><table>");
| htout.println("<tr><th>Id</th><th>Id Client</th><th>numero de commande</th><th>Job</th><th></th></tr>");
|
| System.out.println("***************");
| System.out.println("createUsers");
|
| File file = new File("D:\\Projets\\workspace\\test\\data.dat");
| int fileLength = (int) file.length();
| InputStream value = null;
| FileInputStream fileinp = null;
|
| System.out.println("Inserting data ...\n");
|
| try {
| fileinp = new FileInputStream(file);
| value = (InputStream) fileinp;
| } catch (Exception e) {
| System.out.println(e.getMessage());
|
| }
| usersService.addfile( "Edieyes9","df","moi",new Date(new java.util.Date().getTime()),org.hibernate.Hibernate.createBlob(value,fileLength));
|
|
|
| System.out.println(usersService.findall());
|
|
| }
|
|
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966500#3966500
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966500
19 years, 8 months
[JBoss Messaging] - Re: RC3 stable? which jdk? ad on: mssql-persistence-service.
by ovidiu.feodorov@jboss.com
Josef(a)logistikpur.com wrote :
| 1.
| we run jboss-4.0.4.GA (install: jboss-4.0.4.GA-Patch1-installer.jar default) under jdk1.5.0_07 (jdk-1_5_0_07-windows-i586-p.exe; build 1.5.0._07-b03) . is this the right jdk?
We test both with JDK 1.4 and JDK 1.5, so you should be fine with jdk 1.5, at least as far as Messaging is concerned.
Josef(a)logistikpur.com wrote :
| 2.
| is it a good idea to use jboss-messaging-1.0.1.CR3 in a production environment?
|
I would advise waiting until 1.0.1.GA is out. If everything goes fine, we should release CR5 by the end of the week, and then wait for another week for feedback, and then release the GA, if no issues are reported. We try to keep JIRA up-to-date, it's a good resource to use if you want to find out what's going on: http://jira.jboss.org/jira/browse/JBMESSAGING?report=com.atlassian.jira.p...
Josef(a)logistikpur.com wrote :
| 3.
| what content will have the destinations-service.xml in a production environment?
|
Currently it contains some tests destinations and the DLQ. It should stay the same. You can add your own destinations there, but you can also use a different deployment descriptor for those.
Josef(a)logistikpur.com wrote :
| 4.
| when will the first jboss-messaging-x.y production release be available?
|
That would be 1.0.0.GA. It was released in March. If you mean next production release, see the answer to 2. above.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966499#3966499
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966499
19 years, 8 months