glassfish-3

Connecting two MySQL data source using a single Connection object

时光总嘲笑我的痴心妄想 提交于 2019-12-13 21:18:58
问题 Actually I need to connect two mysql datasource which are created in my application server. I'm using JPA2.0 I tried the following code. but i'm getting exception " java.lang.IllegalStateException: Local transaction already has 1 non-XA Resource: cannot add more resources. ". import com.google.common.collect.Lists; import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; import java.util.List; import javax.annotation.Resource; import javax.sql.DataSource; public

Glassfish crash(stop) with no debugging information

做~自己de王妃 提交于 2019-12-13 18:40:26
问题 I am runnning a glassfish 3.0.1, the server start up normally, but when i execute some webservice method the server crash(shutdown) without log or debug information. The files server.log no have exception and jvm.log eihter. have i other log for debug error in glassfish? 回答1: I solve the problem increasing the -Xss memory in the virtual machine options. -Xss256k to -Xss512k 来源: https://stackoverflow.com/questions/24895424/glassfish-crashstop-with-no-debugging-information

How to use multipart/form-data encoding in application running on GlassFish 3.1.1

余生颓废 提交于 2019-12-13 18:16:16
问题 I have a JSF 2.0 application running under GlassFish 3.1.1, and I wish to use the new FileUpload component in PrimeFaces 3.0.1, which requires that form data be encoded as multipart/form-data , as in: <h:form id="quoteform" enctype="multipart/form-data"> However, as soon as I add the above enctype attribute to my form, it no longer works - the bean methods tied to my submit and cancel buttons are never invoked. I did find a reference to an issue with Mojarra (part of GlassFish I believe) and

Looking up an EJB dynamically

百般思念 提交于 2019-12-13 16:23:02
问题 I'm developing an application on Glassfish 3. I have an EJB that looks like this: @LocalBean @Stateless public class MyBean { public void doSomething() {} } My client code (running inside the same application) looks like this: MyBean mb = (MyBean) InitialContext.doLookup(MyBean.class.getName()); According to a few sources, this should be a valid lookup method, but it throws a NameNotFoundException. What am I doing wrong? 回答1: According to what sources? I would personally use portable JNDI

using an EJB 3.1 bean through a remote java stand-alone application

早过忘川 提交于 2019-12-13 16:06:59
问题 I have been trying to use Java EE 6 to create an Application Server based app which is to receive Job objects from a GWT Web Application and those Jobs would be pulled from a Java stand-alone application. I have been thinking that the EJB model would provide me with easy way to do remoting because my client app should be able to run on a different machine. I am using Glassfish 3.1 and Netbeans 7.0.1 as my IDE, I have also used eclipse Java EE to reproduce same problem. I have been facing the

Need to find the web application path

こ雲淡風輕ζ 提交于 2019-12-13 05:40:35
问题 I created a web application using netbeans and glassfish server. I created a new java file inside that application. I want to find the current application path in that java file. 回答1: You can get path information from a servlet with methods of HttpServletRequest class: public class RequestInfoExample extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String requestURI = request.getRequestURI(); String

How to send multiple JMS messages in blocks (each in a new transaction)

99封情书 提交于 2019-12-13 04:57:45
问题 My Java EE 6 Web application has reached the maximum number of JMS messages that can be sent in a single transaction and I need to do it in several transactions. What would be the best way of doing this when transactions are managed by the container? Is it OK to use the same MessageProducer across different transactions (using an EJB method annotated with @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) ) I'm using Glassfish v3 and OpenMQ. The problem with the maximum number of

Error while serializing Timestamp element occured while performing canonicalization

非 Y 不嫁゛ 提交于 2019-12-13 04:50:48
问题 I have webservice developed in metro 2.1 , glassfish-server 3.1. Exception at the server side. [#|2015-01-30T08:00:37.325- 0500|SEVERE|glassfish3.1.1|com.sun.xml.wss.logging.impl.opt|_ThreadID=26;_ThreadName=Thread-2;|WSS1609: Error while serializing Timestamp element|#] [#|2015-01-30T08:00:37.330-0500|SEVERE|glassfish3.1.1|com.sun.xml.wss.logging.impl.opt.signature|_ThreadID=26;_ThreadName=Thread-2;|WSS1759: Following error com.sun.xml.wss.XWSSecurityException: WSS1609: Error while

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

Glassfish logging suddenly stops

倖福魔咒の 提交于 2019-12-13 03:23:01
问题 We're running many instances of glassfish in a linux box and suddenly they stop logging (a blank server.log file is created and no logging data is appended to it). it happens after something like a week of normal logging. How can I fix it? How can I diagnose the problem -there's something like a log of the logger internals :p-? 回答1: Check the logging properties of your domain (domain-dir/config/logging.properties). If there is nothing logged at all the GFFileHandler logging level might be set