glassfish

Stateless session bean with instance variables

I have a stateless session bean that contains one public method, several private methods, and some instance level variables. Below is a pseudo code example. private int instanceLevelVar public void methodA(int x) { this.instanceLevelVar = x; methodB(); } private void methodB() { System.out.println(instanceLevelVar); } What I'...

Requirements for HTTPS URl connection using Glassfish

What should we do for https connection using glassfish in both client and server side ...

setAttribute: Non-serializable attribute (Java Object Serialization)

We just switched to Glassfish V2. We are now getting errors when setting a session attribute. Error is: java.lang.IllegalArgumentException: PWC2788: setAttribute: Non-serializable attribute Code is: getRequest().getSession().setAttribute("questionsForUser", getQuestions()); getQuestions() is just a simple getter which is inside a...

Persistence.createEntityManagerFactory() in J2EE ignores jta source

I have a perfectly working application client deployed to a glassfish v2 server inside an ear with some EJBs, Entities, etc. I'm using eclipselink. Currently I have in my persistence.xml: <persistence-unit name="mysource"> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <jta-data-source>jdbc/mysource</jta-d...

Persistence Unit SQLException No suitable driver

I have a j2ee application deployed on GlassFish. I have mysql jars in GlassFish's lib directory. I am trying to use JPA, and my persistence file is: <persistence-unit name="teamPU" transaction-type="RESOURCE_LOCAL"> <provider> oracle.toplink.essentials.PersistenceProvider </provider> <class>com.team.dao.Roles</class> <properties>...

Does anyone have a beginners guide to installing and using glassfish?

I am after a all round installation and introduction to Glassfish. (ie Your boss has told you need to develop your web applications for glassfish instead of tomcat) ...

Glassfish in a production environment?

Do you use Glassfish 2 or v3 in a production environment? Do you find it robust? Have you ever been able to find a complete set of documentation? What do you do when you find that Glassfish ignores J2EE standards, like class and anotation scanning? ...

What is the glassfish alternative to context.xml

I am used to configuring web application in context.xml, including jdbc resorces, and application configuration parameters. Under glassfish, what is considered the standard place to store application configuration information? We used to store it in the context.xml file as follows: <Resource url="jdbc:mysql://localhost:3306/db?useUnic...

Glassfish doesn't load jdbc

I've a application in swing and ejb3 inside glassfish v2ur2 and until one week ago all was ok. in sometime, the glassfish never more load the jdbc driver of postgresql and the connection with the bd fail, but the jdbc driver is in the project and in the classpath. the only way to fix it was put the jar inside lib folder of glassfish doma...

Help I don't know how to handle this error (java.lang.RuntimeException: EMBEDDED Broker start failure:code = 1)

I follow this tutorial (http://www.netbeans.org/kb/docs/websvc/rest-mysql.html) and it's success, but when i try with my database, it become error. I already follow step by step , but still error, anyone know how to handle this error? or it's bug too? MQJMSRA_RA4001: start:Aborting:Exception starting EMBEDDED broker=EMBEDDED Brok...

New URLStreamHandlers in glassfish

I have a legacy application that I'm trying to port to Java EE. Presently this application calls URL.setURLStreamHandlerFactory() to register some custom URL protocol handlers. This call fails under Glassfish v 2.1 and 3 because glassfish has already registered a factory. I've tried using the java.protocol.handler.pkgs system property...

NoClassDefFoundError exception when deploying dynamic web app from eclipse

I have a small Dynamic web project in Eclipse gallileo that references another project. When I deploy my project to Glassfish v2.1, as soon as I try instantiating the class that is located in the other project I get a NoClassDefFoundError. I can't figure out what setting I am missing to make sure that the referenced project is also deplo...

EJB help needed

public void runTest() throws Exception { InitialContext ctx = new InitialContext(); ResourceManager bean = (ResourceManager) ctx.lookup("ejb/ResourceManagerJNDI"); System.out.println(bean.DummyText()); } Hello. So i'm trying to create an EJB application, and this is the test client for it. the JNDI lookup is successful b...

com iplanet ias JAR

I've been struggling with this for past couple of days. I am trying to test a DAO outside the container but while running the test case I am getting the error: Error creating bean with name 'SqlMapClient' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is java.l...

Maximum number of messages sent to a Queue in OpenMQ ?

I am currently using Glassfish v2.1 and I have set up a queue to send and receive messages from with Sesion beans and MDBs respectively. However, I have noticed that I can send only a maximum of 1000 messages to the queue. Is there any reason why I cannot send more than 1000 messages to the queue? I do have a "developer" profile setup fo...

GlassFish SSL not working in Mac

I cannot surf to my localhost via https on any port. On my Windows boxes, it works fine, and GlassFish comes standard with an SSL port set. Anyone know why it would be different on Mac? ...

GlassFish System.getProperty() not working on Mac

I have GlassFish installed on a Windows box and a MacBook Pro. The simple call System.getProperty() works, able to get a property value, but always returns null on the Mac. I have triple checked installations between the two, and the only difference is the OS. Any ideas? ...

Teaching javax.mail, javax.activation to recognize mime type of mail attachment in web application

Im sending mails from a web application running on a glassfish server, which was quite easy with the java mail API. I'm starting now to attach files (mainly pdf and odt) to the mail, which works to, but the mime type of the attachment is not correctly set (application/octet-stream). I tried to attach the file with: MimeBodyPart mimeBod...

Turn off TRACE in GlassFish v2

I need to turn off TRACE to help close XST security vulnerabilities. I've been looking, nothing obvious so far. Any help? ...

Web service client close connection

I have a Glassfish app server hosting my web service (jax-rs with apache cxf). I have a Java client consuming this web service using code: Service service = JAXRSClientFactory.create("http://localhost/service", Service.class); The service is consumed x number of times at run time. x can vary. All is good - the code runs fine and as...