java-ee

How to build a plugin architecture using CDI - I'm using Wildfly 10

99封情书 提交于 2019-12-13 03:47:58
问题 I want to build a JEE plugin based architecture. The main idea is do something similar to what eclipse is, but in the context of JEE. My goal is to have a minimum of modules as the core, and allow others modules extend its functionality. To this, I have implemented a test using 4 modules: gauges: Defines and implements a gaugesregistry service, also defines a gauge POJO. cashgauges: implements a gauge producer using CDI. this is a plugin mock. othergauges: implements a gauge producer using

Logback+SLF4J does no log in JavaEE 7 application

回眸只為那壹抹淺笑 提交于 2019-12-13 03:46:16
问题 I'm building a simple app and now i'm facing the "logging nightmare" on javaee application. I've done days of searches, hundreds of change/test but there's no way to make it run. My app is made of a simple EAR +-- /lib | +-- slf4j-api-1.7.25.jar | +-- logback-classic-1.2.3.jar | +-- logback-core-1.2.3.jar | +-- JAR (JPA/EJB/Producers/Interceptors) | +--src/main/resources | +-- logback.xml | +-- logback-test.xml | +-- WAR The libs are so loaded in the lib directory of the EAR file. my pom.xml

Can a startup singleton bean delay a J2EE container initialization?

眉间皱痕 提交于 2019-12-13 03:46:06
问题 According to the Java EE 6 Tutorial: The EJB container is responsible for determining when to initialize a singleton session bean instance unless the singleton session bean implementation class is annotated with the javax.ejb.Startup annotation. In this case, sometimes called eager initialization, the EJB container must initialize the singleton session bean upon application startup. The singleton session bean is initialized before the EJB container delivers client requests to any enterprise

MyBatis CDI + Container-Managed Transaction

假装没事ソ 提交于 2019-12-13 03:45:43
问题 I would like to use mybatis with container-managed transaction in my aplication. I use mybatis 3.4.2 and mybatis-cdi 1.0.0. My code works but at the moment I open and close sessions manually and I do not know how to inject either SqlSession or Mapper to my EJB. It seems that mybatis-cdi does not do its job properly in my case. That is my deployment structure: EAR +--- commons.jar (interfaces, POJOs) +--- ejb.jar (stateless EJBs + MyBatis mapper + session factory) +--- web.war (demo servlet

406 Error when consuming restFul webService in Spring MVC project. The webService works when returning a String but fails for other data types

耗尽温柔 提交于 2019-12-13 03:45:02
问题 This is a snippet my spring servlet. My pom file has the jackson dependencies added as well but I just can't figure out why I'm getting this 406. ... <mvc:annotation-driven/> <context:component-scan base-package="com.ourcalendar.*"/> <!-- Add JPA support --> <bean id="emf" class= "org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="loadTimeWeaver"> <bean class= "org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/> </property> </bean> <!

Two domain & their sub-domain are mapped to the same IP so how can i host my different application to the same tomcat server?

怎甘沉沦 提交于 2019-12-13 03:39:09
问题 I have two different domain & sub domain. For example :- Domain 1 :- example1.com IP :- XXX.XX.XX.201 Domain 2 :- example2.com IP :- XXX.XX.XX.202 (This is a virtual hosting on above IP addr XXX.XX.XX.201) I am also using sub-domains for the same like, Domain 1 :- test.example1.com IP :- XXX.XX.XX.201 Domain 2 :- test.example2.com IP :- XXX.XX.XX.202 (This is a virtual hosting on above IP addr XXX.XX.XX.201) I have to access the application in such way that if i access example.com it will

What are environment properties for Payara InitialContext from free standing Java Client

会有一股神秘感。 提交于 2019-12-13 03:38:26
问题 I've abandoned GlassFish 4-point-anything in favor of Payara41. Amazingly GF has unresolved JDBC and JMS Resources configuration bugs. See: Glassfish Admin Console throws java.lang.IllegalStateException when creating JDBC Pool Payara perfectly fixed the JMS configuration issues. So all I need are the environment properties my standalone Java Client needs to get an InitialContext(env) to lookup() those Resources. Note: InitalContext() doesn't work in a standalone. Only in an EJB Container that

Synchronization error when insertable = false in EclipseLink

倖福魔咒の 提交于 2019-12-13 03:36:46
问题 This my entity @Entity public class Order { ... @OneToMany (fetch = FetchType.LAZY) @JoinColumn(name="order_uuid", insertable = false, updatable = false) private List<Item> items; } When I create new Oder and save it in DB I get: Caused by: java.lang.IllegalStateException: During synchronization a new object was found through a relationship that was not marked cascade PERSIST: com.temp.Item@3cd8c5f. Could anyone explain the reason of this error (I did add insertable = false ) and how to fix

JBOSS Struts 2 application intrusions

≯℡__Kan透↙ 提交于 2019-12-13 03:34:10
问题 We have have a J2EE Struts 2 application. Recently we saw some intrusions are coming to our application which runs on port 80. The Jboss (version 4.2.0) error log gives this: the request doesn't contain a multipart/form-data or multipart/form-data stream, content type header is %{(#_='multipart/form-data').(#dm=@ognl.OgnlContext@DEFAULT_MEMBER_ACCESS).(#_memberAccess?(#_memberAccess=#dm):((#container=#context['com.opensymphony.xwork2.ActionContext.container']).(#ognlUtil=#container

Can't redeploy .WAR that uses Axis in Glassfish 3

ぐ巨炮叔叔 提交于 2019-12-13 03:24:34
问题 I have a J2EE web application that instantiates an Apache Axis SOAP client proxy as a Spring bean. When I deploy the application into a Glassfish 3 server for the first time, it succeeds. However, if I undeploy and redeploy the application, I get the following error (at the bottom of the Spring stacktrace): Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [com.foo.bar.FooServicePortType com.foo.bar.config