glassfish

Java EE and JPA under Glassfish, NoClassDefFound com/mysql/jdbc/ResultSetMetaData

末鹿安然 提交于 2019-12-25 10:50:16
问题 I have a problem when I acces my MySql Database from an EJB. After deploying my EAR to the Glassfish server, and calling the method that use the entity class I get an exception like this: java.lang.NoClassDefFoundError: com/mysql/jdbc/ResultSetMetaData I am using a local MySql Database, the connection to these still works. To acces the tables of these Databese I am using entity classes generated by Netbeans. This classes are situated in external Library (OthelloLibrarie). Here you can also

How to automatically update a file on every git commit?

有些话、适合烂在心里 提交于 2019-12-25 08:52:48
问题 I want a file in my repository to be automatically updated (with any value, I just want its timestamp to be changed) with every git commit. How can I do this? My reason is to force my Glassfish appserver to reload my webapp when I build it on the server. I need to touch a file called .reload for this to happen. Rather than doing so manually, I want git pull origin; mvn build on my server to also touch the .reload file. 回答1: You could just use the Maven Antrun Plugin or the Groovy Maven Plugin

Grails - trying to deploy a nojars application into glassfish 3.0.1

坚强是说给别人听的谎言 提交于 2019-12-25 07:47:09
问题 Because of memory constraint i am trying to build a grails app with smaller memory footprint. I build the war with this argument "--nojars". I created a war file without all the jar and when i deploy within the glassfish i encounter this error Exception while loading the app : java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: org.codehaus.groovy

WELD-001408: Unsatisfied dependencies for type HttpSession

时间秒杀一切 提交于 2019-12-25 07:39:30
问题 I have this (notorious by now) @SessionScoped bean in my JSF project: @Named(value = "appointmentFormBean") @SessionScoped public class AppointmentFormBean implements Serializable { @Inject private transient AppointmentService service; public AppointmentFormBean() { bookedAlready = new ArrayList<>(); types = new LinkedHashMap<>(4, (float) 0.75); } public AppointmentService getService() { return service; } public void setService(AppointmentService service) { this.service = service; } ... /

Glassfish 4.1.1 and offline JSP compiler (JSP and OSGI)

荒凉一梦 提交于 2019-12-25 07:15:37
问题 As everyone knows jsp can't work with classes outside current osgi web archive bundle. This is a bug in GF. The developers of glassfish for workaround of this bug https://java.net/jira/browse/GLASSFISH-11208 offer to use offline jsp compiler (by other words to compile jsp files not during deployment time but during archive building time). Ok, and I used jspc-maven-plugin to compile my jsp during wab building. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>jspc-maven-plugin<

java mail keeping Transport object connected

六眼飞鱼酱① 提交于 2019-12-25 07:02:20
问题 How do i keep the java mail transport object alive or connected. I have written this in my code in a simple class file inside a web application : - @Resource(name = "myMailServer") private Session mailSession; Transport transport ; public boolean sendMail(String recipient, String subject, String text) { boolean exe = false; Properties p = new Properties(); String username = "someone@gmail.com"; String password = "password"; InitialContext c = null; try { c = new InitialContext(); mailSession

Weird java.io.IOException: Server returned HTTP response code: 503 for URL

丶灬走出姿态 提交于 2019-12-25 06:55:08
问题 I am writing a servlet jsp under Glassfish to download a file from a website, do some processing and display the result in webpage. When I deploy the servlet, it get this error : java.io.IOException: Server returned HTTP response code: 503 for URL: www.websitename.com error. I check the status code 503 out and it turns out to be a server overload indicator. However, if I write a standalone program, accessing the same website, it works fine. What can be the reason of the IOException? 回答1: I

What to put into jta-data-source of persistence.xml that works on all vendors?

风格不统一 提交于 2019-12-25 06:25:29
问题 Similar to What to put into jta-data-source of persistence.xml? and How to map jpa datasources in WildFly? However, I am asking for something that would work on all vendors or at least WildFly, Glassfish/Payara, WebSphere Application Server classic, WebSphere Application Server Liberty, TomEE. I am not looking for something that works in a Java SE Unit test. So far I found that java:comp/env/jdbc/xxx works in WebSphere Application Server and TomEE. There's a mapping exercise (which is

Glassfish - Application name is already in use

不问归期 提交于 2019-12-25 05:32:20
问题 I’ve come to an hold with my programing because I’m getting an error from glassfish. I’m using NetBeans IDE 7.3 for this project. And I’ve built a simple program which runs over the web(jsp file etc). But I keep on getting the weirdest error display from glassfish. I’ve searched the internet for my solution and found people posting similar things, but I never seem actually manage to fix it because I don’t really understand the post which I’ve read. So what is the error that I get at startup?

Glassfish Tools plugin for Eclipse Luna SR2 not working

 ̄綄美尐妖づ 提交于 2019-12-25 05:32:18
问题 I always install Glassfish Tools using Eclipse Marketplace or just downloading additional adapters in Eclipse Servers > New > Server . For some reason, when moving from Eclipse Luna SR1 to SR2, the new plugin doesn't install the adapter (the "New Server" window doesn't shows Glassfish as an option), and when trying to manually download the Glassfish adapter, clicking at Download additional server adapters... , the Glassfish adapter is not shown. Is there any bug in this version? Something has