[EJB3] - SqlResultMapping not working
by Craig Uss
Craig Uss [https://community.jboss.org/people/craigmuss] created the discussion
"SqlResultMapping not working"
To view the discussion, visit: https://community.jboss.org/message/728678#728678
--------------------------------------------------------------
I am trying to use @SqlResultMapping with one of my queries:
query = this
.getEntityManager()
.createNativeQuery(
"SELECT DISTINCT proj.*, mess.trigger_date"
+ "FROM ci_project as proj LEFT JOIN ci_project_message as mess "
+ "on proj.message_no = mess.message_no "
+ "WHERE proj.survey_contact = :userId",
"surveyManagement").setParameter("userId", userId);
I made a SqlResultMapping for this query:
@SqlResultSetMapping(name = "surveyManagement", entities = {
@EntityResult(entityClass = CiProject.class),
@EntityResult(entityClass = CiProjectMessage.class, discriminatorColumn = "MESSAGE_NO", fields = { @FieldResult(name = "triggerDate", column = "trigger_date") }) })
I am getting the following error when I try to execute this query:
Caused by: org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.loader.Loader.doList(Loader.java:2236)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2130)
at org.hibernate.loader.Loader.list(Loader.java:2125)
at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1724)
at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:94)
... 252 more
Caused by: java.sql.SQLException: Column 'MESSAGE1_4_1_' not found.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ResultSetImpl.findColumn(ResultSetImpl.java:1144)
at com.mysql.jdbc.ResultSetImpl.getInt(ResultSetImpl.java:2815)
at org.jboss.resource.adapter.jdbc.WrappedResultSet.getInt(WrappedResultSet.java:698)
at org.hibernate.type.IntegerType.get(IntegerType.java:51)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:184)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:173)
at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:1120)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:587)
at org.hibernate.loader.Loader.doQuery(Loader.java:723)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:258)
at org.hibernate.loader.Loader.doList(Loader.java:2233)
... 259 more
10:41:29,794 SEVERE [lifecycle] JSF1054: (Phase ID: RENDER_RESPONSE 6, View ID: /subViews/surveysList.xhtml) Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@1c7728e]
I am new to using SqlResultMapping annotation. Any advice or point in the right direction will be greatly appreciated!
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/728678#728678]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 11 months
[jBPM] - How to trigger an external signal event with a web service
by Francois MARTIN
Francois MARTIN [https://community.jboss.org/people/nujib] created the discussion
"How to trigger an external signal event with a web service"
To view the discussion, visit: https://community.jboss.org/message/728668#728668
--------------------------------------------------------------
Hello,
I am really new to Java and Jbpm so my questions may sound stupid. I designed a simple Process which looks like this :
and what I'd like to do is to trigger the signal event using a web service. I have a main function initializing the knowledgeBase and starting my process just like the HelloWorld example. I just moved the initialiation step to another class called ProcessManager which holds a static ksession variable. Here is the aborescence of my project :
My configuration is the following :
- jBPM 5.2
- Eclipse Helios SR2 3.6.2
- Tomcat 6 with Axis 2
I already manage to create a webservice and integrate it into tomcat so that I can use SoapUI to make a call a get the result in the eclipse console.
I tried to trigger the signal event by inserting the following piece of code into the exposed method of my WS :
ProcessManager.ksession.signalEvent("receptionRetourOperat", 1);
The problem is that the ksession that is initialized in my main function is null when making the WS call. I guess the two executions (WS call and main) are done in a different context so that I can't get the initialized ksession variable from my WS call. My questions are the following :
- Is it possible to make the WS access the ksession variable from the main function ?
- Does it make sense to have only one jBPM session and to create a process instance at each WS call ?
Thanks.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/728668#728668]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 11 months
[jBPM] - Re: Designer loading problem in drools-guvnor
by renez
renez [https://community.jboss.org/people/renez] created the discussion
"Re: Designer loading problem in drools-guvnor"
To view the discussion, visit: https://community.jboss.org/message/721414#721414
--------------------------------------------------------------
Hello,
I'm having this problem today, too. I'm using jbpm 5.2 installed by installer on Ubuntu Linux 10.04 with openjdk-6. In Guvnor I can create a BPmn 2.0 process. But when I try to open the File just get a screen "Please wait while loading". In server.log I can find.
18:21:25,182 INFO [stdout] (http--0.0.0.0-8080-5) INFO 04-03 18:21:25,181 (NilAuthenticator.java:authenticate:35)
All users are guests.
18:22:47,125 INFO [stdout] (http--0.0.0.0-8080-6) (null: -1, -1): Premature end of file.
18:22:47,799 INFO [org.jbpm.designer.server.EditorHandler] (http--0.0.0.0-8080-6) The diagram editor is running in development mode. Javascript will be served uncompressed
18:22:47,801 INFO [org.jbpm.designer.server.EditorHandler] (http--0.0.0.0-8080-6) Performing diagram information pre-processing steps.
18:22:48,208 INFO [stdout] (http--0.0.0.0-8080-7) INFO 04-03 18:22:48,206 (NilAuthenticator.java:authenticate:35)
All users are guests.
18:22:48,494 INFO [stdout] (http--0.0.0.0-8080-7) INFO 04-03 18:22:48,493 (NilAuthenticator.java:authenticate:35)
All users are guests.
18:22:48,560 INFO [stdout] (http--0.0.0.0-8080-7) INFO 04-03 18:22:48,559 (NilAuthenticator.java:authenticate:35)
All users are guests.
18:22:48,698 INFO [stdout] (http--0.0.0.0-8080-7) INFO 04-03 18:22:48,697 (NilAuthenticator.java:authenticate:35)
All users are guests.
18:22:48,739 INFO [stdout] (http--0.0.0.0-8080-7) INFO 04-03 18:22:48,738 (NilAuthenticator.java:authenticate:35)
All users are guests.
18:22:48,772 INFO [org.jbpm.designer.web.preprocessing.impl.JbpmPreprocessingUnit] (http--0.0.0.0-8080-6) Successfully deleted file :/opt/jboss/jbpm-5.2/jboss-as-7.0.2.Final/standalone/tmp/vfs/temp5fa1d605b1619162/designer.war-74ced14e8e0c620f/stencilsets/bpmn2.0jbpm/bpmn2.0jbpm.json
18:22:48,773 INFO [org.jbpm.designer.web.preprocessing.impl.JbpmPreprocessingUnit] (http--0.0.0.0-8080-6) Created file:/opt/jboss/jbpm-5.2/jboss-as-7.0.2.Final/standalone/tmp/vfs/temp5fa1d605b1619162/designer.war-74ced14e8e0c620f/stencilsets/bpmn2.0jbpm/bpmn2.0jbpm.json
18:22:48,818 INFO [org.jbpm.designer.web.preprocessing.impl.JbpmPreprocessingUnit] (http--0.0.0.0-8080-6) Created file:/opt/jboss/jbpm-5.2/jboss-as-7.0.2.Final/standalone/tmp/vfs/temp5fa1d605b1619162/designer.war-74ced14e8e0c620f/stencilsets/bpmn2.0jbpm/view/activity/workitems/Log.svg
18:22:48,829 INFO [org.jbpm.designer.web.preprocessing.impl.JbpmPreprocessingUnit] (http--0.0.0.0-8080-6) Created file:/opt/jboss/jbpm-5.2/jboss-as-7.0.2.Final/standalone/tmp/vfs/temp5fa1d605b1619162/designer.war-74ced14e8e0c620f/stencilsets/bpmn2.0jbpm/view/activity/workitems/Email.svg
18:23:10,604 INFO [stdout] (http--0.0.0.0-8080-7) INFO 04-03 18:23:10,603 (NilAuthenticator.java:authenticate:35)
All users are guests.
18:23:10,660 INFO [stdout] (http--0.0.0.0-8080-7) (null: -1, -1): Premature end of file.
Like mika suggested I changed the umlauts and the special charkters. The strang thing is, that everyting works fine on my local developer system with win xp.
Does somebody have a suggestion? Hints a greatly appriciated!
René
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/721414#721414]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 11 months
[EJB3] - EJB is null Please Help
by Manolescu Sebastian
Manolescu Sebastian [https://community.jboss.org/people/mano_seba] created the discussion
"EJB is null Please Help"
To view the discussion, visit: https://community.jboss.org/message/728650#728650
--------------------------------------------------------------
Hello,
I try to use TestNG but the @EJB is null, but it's not a detailed error :(( . I use arquillian but I doubt that this is the problem in this case, I've made other tests just like this whit different services but the EJ is not null, only 4 out 0f 10 services are null. :0
In the surfire reports it shows:
SubscriptionSaveTest(com.project.scr.prj.service.SubscriptionServiceTest) Time elapsed: 0.015 sec <<< FAILURE!
java.lang.NullPointerException
at com.project.scr.prj.service.SubscriptionServiceTest.SubscriptionSaveTest(SubscriptionServiceTest.java:98)
The test looks like
public class SubscriptionServiceTest {
private final String TEST_VALUE = "test";
private final Date TEST_DATE = new Date();
private final Long TEST_LONG = 3l;
@Deployment
public static WebArchive createTestArchive() {
return ShrinkWrap.create( WebArchive.class,"test.war").addPackages(true,"org.joda.time").addPackages(true, "javax.jcr").addClasses(com.mysql.jdbc.log.Log.class,com.project.scr.prj.model.Subscription.class).addPackage("org.slf4j").addPackage("org.slf4j.spi").addPackage("org.slf4j.helpers").addAsWebInfResource("test-persistence.xml", "classes/META-INF/persistence.xml").addAsWebInfResource("beans.xml", "META-INF/beans.xml");
}
@EJB(name ="subscriptionService")
private SubscriptionService subscriptionService;
@BeforeTest
@UsingScript("import.sql")
public void setUp()
{}
public Subscription FillSubscription(){
System.out.println("TEST"+subscriptionService); // in the console shows null
}
Sorry for my bad english :)
Best Regards
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/728650#728650]
Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 11 months
[jBPM] - jBPM 5.2 transaction issues in JBoss 5.1
by Bane Cavlin
Bane Cavlin [https://community.jboss.org/people/bcavlin] created the discussion
"jBPM 5.2 transaction issues in JBoss 5.1"
To view the discussion, visit: https://community.jboss.org/message/728311#728311
--------------------------------------------------------------
Hi,
I was wondering if anyone else had these issues using JBoss 5.1 and jBPM 5.2. I am receiving these errors when tring jBPM service (please note that service works, but these errors are reported):
1. java.sql.SQLException: You cannot set autocommit during a managed transaction!
2. [CachedConnectionManager] Closing a connection for you. Please close them yourself: org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6
3. org.jbpm.persistence.processinstance.ProcessInstanceInfo @PreUpdate public void update is never fired in JBoss
Also, please note that JUnit tests that I have using same code and same data (with exception of who provides transaction) works just fine.
Any help or suggestion is appriciated.
Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/728311#728311]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 11 months