[EJB 3.0] - Re: ant failed.
by samwan809
Yeah it works in half way now...getting there...
I just don't know what I have missing in the Client.java in order to run it with Junit. I searched google , but couldn't found definite/clear answer.
the following errors shown:
|
| calling_card_reg # ant test
| Buildfile: build.xml
|
| compile-test:
|
| test:
| [junit] Testsuite: com.ip6networks.calling_card_registration.test.Client
| [junit] Tests run: 1, Failures: 1, Errors: 0, Time elapsed: 0.011 sec
| [junit]
| [junit] Testcase: warning(junit.framework.TestSuite$1): FAILED
| [junit] No tests found in com.ip6networks.calling_card_registration.test.Client
| [junit] junit.framework.AssertionFailedError: No tests found in com.ip6networks.calling_card_registration.test.Client
| [junit]
| [junit]
| [junit] Test com.ip6networks.calling_card_registration.test.Client FAILED
|
| BUILD SUCCESSFUL
| Total time: 2 seconds
|
|
The source code for Client.java is shown below:
| package com.ip6networks.calling_card_registration.test;
|
| import com.ip6networks.calling_card_registration.test.Calculator;
| import com.ip6networks.calling_card_registration.test.CalculatorRemote;
| import com.ip6networks.calling_card_registration.test.ServiceLocator;
|
| public class Client
| {
| public static void main(String[] args) throws Exception
| {
| Calculator calculator = getSession();
| System.out.println("in Client class");
| System.out.println("1 + 1 = " + calculator.add(1, 1));
| System.out.println("1 - 1 = " + calculator.subtract(1, 1));
|
| }
|
| private static Calculator getSession() throws Exception {
| Calculator mgr = null;
| mgr = (Calculator) ServiceLocator.getInstance().getService("Calculator");
| if (mgr == null) {
| //throw new SystemErrorException("Unable to connect to service");
| throw new Exception("Unable to connect to service");
| } else {
| return mgr;
| }
| }
| }
|
|
Thanks very much.
Sam
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4244496#4244496
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4244496
17 years
[JBoss Messaging] - 5.1.0 CA and jboss messaging 2.0.0 beta 3 ---J2EE examples-
by jim_stoll
All,
Please tell me what i am doing wrong. All tries against J2EE MDB examples gave these ant messages. i am executing in a windows 2000 XP pro service pack 3 environment.
| C:\Java\jboss-messaging-2.0.0.BETA3\examples\javaee\mdb>ant deploy
| Buildfile: build.xml
|
| validate-jboss:
|
| profile.check:
|
| copy-profile:
| [mkdir] Created dir: C:\Java\jboss-5.1.0.GA\server\mdb-example-profile
| [copy] Copying 798 files to C:\Java\jboss-5.1.0.GA\server\mdb-example-profi
| le
| [copy] Copied 201 empty directories to 18 empty directories under C:\Java\j
| boss-5.1.0.GA\server\mdb-example-profile
|
| copy-resources:
|
| init:
|
| compile:
|
| jar:
|
| war:
|
| ear:
|
| deploy:
| [copy] Copying 3 files to C:\Java\jboss-5.1.0.GA\server\mdb-example-profile
| \deploy\messaging.sar
| [copy] Copying 1 file to C:\Java\jboss-5.1.0.GA\server\mdb-example-profile\
| deploy
|
| BUILD FAILED
| C:\Java\jboss-messaging-2.0.0.BETA3\examples\javaee\common\build.xml:140: Execut
| e failed: java.io.IOException: Cannot run program "sh" (in directory "C:\Java\jb
| oss-5.1.0.GA\bin"): CreateProcess error=2, The system cannot find the file speci
| fied
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4244494#4244494
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4244494
17 years
[EJB/JBoss] - JDBCCreateEntityCommand fails with mysql syntax error
by wavemaker
I'm trying to insert a row into simple table using ejb/jboss but keep getting this error and stuck for 2 days.
Executing SQL: SELECT COUNT(*) FROM testing WHERE
2009-07-18 19:06:49,718 ERROR [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.TestEJB] Error checking if entity exists
java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
jbosscmp-jdbc.xml
<enterprise-beans>
<ejb-name>TestEJB</ejb-name>
<table-name>testing</table-name>
<cmp-field>
<field-name>id</field-name>
<column-name>id</column-name>
</cmp-field>
<cmp-field>
<field-name>email</field-name>
<column-name>email</column-name>
</cmp-field>
<!--<entity-command name="mysql-get-generated-keys"/>-->
</enterprise-beans>
table 'testing' just has two fields viz. id and email. id being primary and auto-increment. (Though it's an auto-increment but I'm passing id value as well)
Following is the complete error. Not sure what I'm doing right. Any help would be greatly appreciated
2009-07-18 19:06:49,687 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.TestEJB] Executing SQL: SELECT COUNT(*) FROM testing WHERE
2009-07-18 19:06:49,718 ERROR [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.TestEJB] Error checking if entity exists
java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2921)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1570)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2978)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:930)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1024)
at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:211)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCInsertPKCreateCommand.beforeInsert(JDBCInsertPKCreateCommand.java:79)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractCreateCommand.execute(JDBCAbstractCreateCommand.java:137)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:572)
at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:222)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:219)
at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:612)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1113)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:189)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:180)
at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:119)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:110)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:146)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:130)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:508)
at org.jboss.ejb.Container.invoke(Container.java:894)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:344)
at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:118)
at $Proxy53.create(Unknown Source)
at com.qd.pr.common.business.TestSessionBean.CallTestBean(TestSessionBean.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:149)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:154)
at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:54)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:106)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:389)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:153)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
at org.jboss.ejb.Container.invoke(Container.java:873)
at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:415)
at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:88)
at $Proxy56.CallTestBean(Unknown Source)
at com.qd.pr.common.servlet.EJBTest.doGet(EJBTest.java:61)
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(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Unknown Source)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4244493#4244493
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4244493
17 years