ejb

Cannot use dependency jboss-javaee-6.0 in my Maven project

只愿长相守 提交于 2020-01-23 11:45:10
问题 I have set up a maven project with JBoss 7.1.1 and I want to use JavaEE libraries. In the root pom.xml I have set: <repositories> <repository> <id>jboss</id> <url>https://repository.jboss.org/nexus/content/groups/public/</url> </repository> </repositories> I have this in the root pom.xml and and in the ejb maven module´s pom.xml: <dependency> <groupId>org.jboss.spec</groupId> <artifactId>jboss-javaee-6.0</artifactId> <version>3.0.2.Final</version> <scope>provided</scope> <type>pom</type> <

@EJB inject from different jar

僤鯓⒐⒋嵵緔 提交于 2020-01-23 08:07:49
问题 I'm trying to inject a bean located in a different jar file then the bean i'm trying to inject it into. Both beans are just basic @Stateless beans with local and remote interfaces. If i use the normal injection @EJB IBean injectedBean; or @EJB IBeanLocal injectedBean; i get a NullPointerException when deploying the application. If i use: @EJB(mappedName="Bean") IBean injectedBean; or @EJB(mappedName="Bean") IBeanLocal injectedBean; everything works and JBoss throws no deployment errors. I

package javax.ejb does not exist inspite of jar file in classpath

蓝咒 提交于 2020-01-23 08:04:53
问题 I'm trying to compile a java program using command javac -d build src/*.java -verbose It returns me the following: src\Currency.java:5: package javax.ejb does not exist import javax.ejb.*; ^ src\Currency.java:7: cannot find symbol symbol: class EJBObject public interface Currency extends EJBObject { ^ I'm using jdk1.6.0_35. CLASSPATH contains C:\wls1036_dev\modules\ which contains javax.ejb.jar What could possibly be the problem? 回答1: I faced the same problem . You need to add javaee5.jar to

EJB3 Glassfish JNDI lookup

风格不统一 提交于 2020-01-23 07:21:09
问题 I am using Glassfish-bundled Eclipse IDE. I wrote a simple EJB application. but it doesn't work. @Stateless @Remote(CalculatorRemote.class) @Local(CalculatorLocal.class) public class Calculator implements CalculatorRemote, CalculatorLocal { @Override public String sayHello(String name) { System.out.println("ejb:"+name); return null; } } ---- @Remote public interface CalculatorRemote { public String sayHello(String name); } ------- @Local public interface CalculatorLocal { public String

how to implement a cache in ejb 3.0?

为君一笑 提交于 2020-01-22 15:38:51
问题 I have a customer who's stuck in an EJB 3.0 environment. No @Singleton, no bean-managed concurrency :-( Considering thread management and synchronization is forbidden by the ejb specification, how to implement a cache? In essence, I want an non-synchronized object cache for some costly operations. 回答1: The restriction of using static field and synchronization is stated in EJB 3.0 spec chapter 21.1.2. It also explains why. • An enterprise bean must not use read/write static fields. Using read

Wildfly DuplicateServiceException

扶醉桌前 提交于 2020-01-21 04:19:26
问题 I have created simple EAR application using Maven archetype: wildfly-javaee7-webapp-ear-blank-archetype/8.2.0.Final http://s17.postimg.org/cy8zbpiu7/Zrzut_ekranu_z_2015_02_13_23_15_10.png My log from starting wildFly: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0 23:08:04,244 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final 23:08:04,690 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final 23:08:04,787 INFO [org

java面试题及答案

限于喜欢 提交于 2020-01-19 03:54:25
1、作用域public,private,protected,以及不写时的区别 答:区别如下: 作用域 当前类 同一package 子孙类 其他package public √ √ √ √ protected √ √ √ × friendly √ √ × × private √ × × × 不写时默认为friendly 2、ArrayList和Vector的区别,HashMap和Hashtable的区别 答:就ArrayList与Vector主要从二方面来说. 一.同步性:Vector是线程安全的,也就是说是同步的,而ArrayList是线程序不安全的,不是同步的 二.数据增长:当需要增长时,Vector默认增长为原来一培,而ArrayList却是原来的一半 就HashMap与HashTable主要从三方面来说。 一.历史原因:Hashtable是基于陈旧的Dictionary类的,HashMap是Java 1.2引进的Map接口的一个实现 二.同步性:Hashtable是线程安全的,也就是说是同步的,而HashMap是线程序不安全的,不是同步的 三.值:只有HashMap可以让你将空值作为一个表的条目的key或value 3、char型变量中能不能存贮一个中文汉字?为什么? 答:是能够定义成为一个中文的,因为java中以unicode编码,一个char占16个字节

I can not call @NamedQueries

蓝咒 提交于 2020-01-17 12:39:59
问题 I'm new in the JSP/EL/EJB WORLD so take it in count please... heheh My question is a continuation of a PREVIOUS Q? so in the comments/answers of the question above is recommended to use customerFacade.findByUserName(String userName), but the problem is that I can't do use of such @NamedQuery. My code is as Follow: CustomerFacade package Session; //imports ** @Stateless public class CustomerFacade extends AbstractFacade<Customer> { @PersistenceContext(unitName = "OnlineStorePU") private

I can not call @NamedQueries

拜拜、爱过 提交于 2020-01-17 12:39:12
问题 I'm new in the JSP/EL/EJB WORLD so take it in count please... heheh My question is a continuation of a PREVIOUS Q? so in the comments/answers of the question above is recommended to use customerFacade.findByUserName(String userName), but the problem is that I can't do use of such @NamedQuery. My code is as Follow: CustomerFacade package Session; //imports ** @Stateless public class CustomerFacade extends AbstractFacade<Customer> { @PersistenceContext(unitName = "OnlineStorePU") private

wildfly-swarm jpa/dadatasources yaml.xml

穿精又带淫゛_ 提交于 2020-01-17 07:38:07
问题 I have a question.I am integrating EJB, JAX-RS, CDI, JPA, and data sources. When I integrate these into wildfly-swarm, there are some problems that can not work properly. yaml.xml: datasources: jdbc-drivers: com.mysql: driver-class-name: com.mysql.jdbc.Driver xa-datasource-class-name: com.mysql.jdbc.jdbc2.optional.MysqlXADataSource driver-module-name: com.mysql data-sources: PicketlinkDS: driver-name: com.mysql connection-url: jdbc:mysql://localhost:3306/testjpa user-name: root password: