java-ee

WebLogic, choosing the JDK

余生长醉 提交于 2019-12-23 21:46:51
问题 Regarding a Java EE application and WebLogic; I've noticed that I could change the Java VM (Sun JDK or JRockit) in different places: During creation of the WebLogic Domain Project classpath During creation of WebLogic Server Runtime Environment Other? Can you explain me what happens if I change one of the different settings? 回答1: The only real difference is that JRockit is specifically tuned to work with Weblogic so you'll see performance improvements. Memory settings will change when picking

Java EE 5 and Hibernate

落花浮王杯 提交于 2019-12-23 21:33:25
问题 Which version of Hibernate can I use with Java EE 5? Can I use the latest version? 回答1: See http://www.hibernate.org/, it says that newest 4.1.4 version can be used with Java EE 5. 回答2: Any. Neither JPA nor Hibernate restrict your choice of application server. They are independent. 来源: https://stackoverflow.com/questions/11441785/java-ee-5-and-hibernate

startup class in Weld

拈花ヽ惹草 提交于 2019-12-23 21:16:42
问题 I am trying to define a startup class for my application in Weld CDI with @Singleton and @Startup annotations (running on tomcat 7), but my PostConstruct method is never called. Here is my Startup class: import java.util.List; import java.util.logging.Logger; import javax.annotation.PostConstruct; import javax.ejb.Startup; import javax.inject.Inject; import javax.ejb.Singleton; import javax.persistence.EntityManager; import se.raindance.squid.core.domain.SquidSettings; @Singleton @Startup

How can I determine the J2ee application server type and version?

断了今生、忘了曾经 提交于 2019-12-23 21:02:43
问题 I need to detect information about the Application Server my EJBs are running in. The System.properties contain a lot of information about Java and the Operating system, but I need to know what type of application server and if possible even the version. Is there a way to get this information in an application independent way (JMX maybe) ? Alternatively, is there a WebSphere specific way of getting this information ? 回答1: Take a look through the WAS MBeans that are available. It looks like

Error when migrating web.xml from Java EE 5 to Java EE 6

♀尐吖头ヾ 提交于 2019-12-23 20:52:58
问题 I am experiencing problems with my app since I migrated web.xml from Java-EE-5 to Java-EE-6. Here is the stacktrace I get when I deploy my app: 24 août 2011 14:10:45 org.apache.catalina.startup.HostConfig deployDescriptor GRAVE: Erreur lors du déploiement du descripteur de configuration ROOT.xml java.lang.IllegalAccessError: class javax.xml.parsers.SecuritySupport12 cannot access its superclass javax.xml.parsers.SecuritySupport at java.lang.ClassLoader.defineClass1(Native Method) at java.lang

Open new thread in Tomcat

喜夏-厌秋 提交于 2019-12-23 20:14:19
问题 I'm just asking theoretical question. I' have an operation which takes some period of time which is performed in some Servlet doGet/doPost method or inside of Spring MVC controller . is is good idea to open new background thread an perform it there? Won't it cause performance issue? Would I get some befits if I were using jBoss JMS system in this case? 回答1: It's OK (Tomcat is not a JavaEE container). Since you mention Spring MVC, I will suggest using @Async on the method you want to execute -

How to read logback configuration file from system environment in tomcat 7

↘锁芯ラ 提交于 2019-12-23 20:05:19
问题 Let me tell the story first: We have 2 j2ee web applications AAA and BBB, and we want to put them in the same server. Right now they both have the logback.xml in their class path, which is in /src/main/resources for the maven project. We want to put all the configuration files in a directory, such as ${app_home}, and let the web applications to find their configuration files by themselves. Like we put AAA_logback.xml and BBB_logback.xml into ${app_home}, and let the web application to find

How do I correctly use SNAPSHOTS dependencies with EARs and EJBs

半城伤御伤魂 提交于 2019-12-23 19:24:37
问题 I am trying to build an EJB in an EAR. My EJB has dependencies on SNAPSHOTS. So when I build the EAR my structure looks like this: my-ear-1.0.0-SNAPSHOT.ear + META-INF - application.xml - MANIFEST.MF - my-ejb-1.0.0-SNAPSHOT.jar - third-party-lib-1.0.0-SNAPSHOT.jar However, when using the maven-ejb-plugin to generate its MANIFEST.MF: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ejb-plugin</artifactId> <version>2.3</version> <configuration> <archive> <manifest>

How to prefer JARs from Weblogic domain over those from weblogic system

半世苍凉 提交于 2019-12-23 18:43:50
问题 I am using Weblogic Server 12.1.1 and copied some JARs to my domain's lib folder. One of the JARs is a org.apache.commons.io jar. Now I have the problem that Weblogic itself comes with a different version of commons-io in its system classpath and so I get NoSuchMethodErrors . Is there any way to configure Weblogic to prefer the libs from domain over those from Weblogic system? The Filtering Classloader works only on those JARs provided with the application ( WEB-INF/lib ). 回答1: If you need to

ASP.NET doesn't have Object Pooling in standard like in Java EE?

。_饼干妹妹 提交于 2019-12-23 18:42:10
问题 I read this C# Object Pooling Pattern implementation so my question: does one have to implement own Object Pooling strategy in ASP.NET whereas this exists in Java EE? Well I'm upset as I prefer .net platform to java, but here in java it's done without being a guru. I'm surprised ASP.NET didn't implement at least the same and even better. 回答1: Recently I've learned that .NET covers this for atleast some scenarios. BufferManager Class Is an object pool for buffers. I don't see any readily