java-ee

Liferay Service Builder throwing three weird errors

纵然是瞬间 提交于 2020-01-05 03:48:11
问题 (Old question bump) I'm doing some tests on Liferay. For this, I'm following the MVC tutorial, and got stuck in the services stuff. I created a simple entity for testing purposes, "Miclase": public class Miclase { int num1; String string1; } Pretty simple, huh. Well, after this, I started the service builder and created a file like this, with the Overview pane: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.2.0//EN" "http://www

How to remotely connect to multiple Glassfish 4+ instances simultaneously?

左心房为你撑大大i 提交于 2020-01-05 03:08:24
问题 I am looking for a way to connect to multiple instances of Glassfish 4+ (JDK7-EE) simultaneously from a stand-alone Swing-based client (JDK7-SE). I successfully connect to a single instance by the following way: That's the construction of the initial context: private void connect(String address, String port) { System.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory"); System.setProperty("com.sun.corba.ee.transport.ORBTCPTimeouts", "500:30000:20:"

Can't get correct ID of an entity in ConfigBean - Java EE

假装没事ソ 提交于 2020-01-04 21:40:19
问题 I'm building a pharmacy management application. Each Pharmacy requires an administrator. The constraints are like so: public class Pharmacy implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; @NotNull private String name; @NotNull private String city; @NotNull private String streetAdress; @OneToOne private Stock stock; @NotNull @OneToOne private Administrator administrator; //... Notice how there's a not null constraint in the Administrator field.

Can't get correct ID of an entity in ConfigBean - Java EE

二次信任 提交于 2020-01-04 21:36:30
问题 I'm building a pharmacy management application. Each Pharmacy requires an administrator. The constraints are like so: public class Pharmacy implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; @NotNull private String name; @NotNull private String city; @NotNull private String streetAdress; @OneToOne private Stock stock; @NotNull @OneToOne private Administrator administrator; //... Notice how there's a not null constraint in the Administrator field.

How to implement backward compatible soap webservice (java based)?

本小妞迷上赌 提交于 2020-01-04 18:18:51
问题 One of our product publishes a webservice using contract-last approach. This has becoming a real problem as all of our clients (ws clients) have to rebuild their client apps as soon as we release a new version of our product. This is due to all namespace changes that comes as a cost with auto-generated wsdls. We use Axis1 for javatowsdl. I've been seeking for a good methodology/ tool to develop backward compatible webservice for this. i.e. version 9.3 clients can still hit the 10.0 service,

JPA manytomany transient collection

半世苍凉 提交于 2020-01-04 16:25:28
问题 I would like to have a queriable collection in my entity that does not persist. In other words, a transient ManytoMany relationship. I have tried: @Transient @ManyToMany(fetch = FetchType.EAGER) @JoinTable(name="QuestionSetClass_Link", schema = "SVY", joinColumns={@JoinColumn(name="QuestionSetID", referencedColumnName="QuestionSetID")}, inverseJoinColumns={@JoinColumn(name="QuestionSetClassID", referencedColumnName="ID")}) private Collection<QuestionSetClass> questionSetClasses; public

send parameter to Java Server Pages (JSP) using jQuery

别来无恙 提交于 2020-01-04 15:59:11
问题 I want to send different parameters to JSP. Is it possible to send multiple parameter to JSP in jQuery? Because jQuery is client side and JSP is server side. Update me! 回答1: You can make an ajax request passing parameters For example: $.ajax({ type: "POST", url: "userNameCheck.jsp", data: { username: "John"} }).done(function( msg ) { alert( msg ); //do other processing }); See jQuery.ajax 回答2: Simplest case: you want to open some page with javascript (jQuery). In this case you can send

Is there a means by which to configure Hibernate Dialect Based on jta-data-source?

ぃ、小莉子 提交于 2020-01-04 13:43:21
问题 Assuming an ejb-jar with the following persistence.xml configuration: <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0"> <persistence-unit name="com.mystrotv.mdn.admanager.entity"> <jta-data-source>/dataSource/MystroDS_Tx</jta-data-source> <properties>

java.lang.ClassFormatError: Illegal class name “groovy/jmx/builder/package-info” in class file groovy/jmx/builder/package-info

五迷三道 提交于 2020-01-04 09:28:31
问题 after adding the groovy-all dependency in my pom file: <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> <version>1.7.5</version> </dependency> i am getting the following exception, when running the application: WARNING: Unable to load class [groovy.jmx.builder.package-info] to check against the @HandlesTypes annotation of one or more ServletContentInitializers. java.lang.ClassFormatError: Illegal class name "groovy/jmx/builder/package-info" in class file

EJB Interceptors and transaction lifecycle OR how to intercept a commit/failure event?

好久不见. 提交于 2020-01-04 07:01:06
问题 I have an EJB interceptor and I follow the BCE pattern suggested by Adam Bien, that is, all EJB calls on the boundary starts and finish a transaction which means there is no nested EJB calls (there might be nested CDI injected Bean calls though, but those should be inside the same transaction started at the ejb Boundary). So in those ejb Boundaries I have an interceptor and I want to intercept or know if after the method call of the EJB the transacction commited already? (that is, if a