w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Java EE 7 GlassFish 4.0 Restful Webservices using and Netbean and deploying on Glassfish 4.0
To Fix First problem, open your glassfish-resource.xml file from your project, it will look something like this. if you don't have glassfish-resource.xml in server-configuration folder you can also check the these details by clicking on services tab in netbeans and furhter clicking on connection pools as shown in this screenshot. Based on the information in it, and using Glassfish 4.0 web interface http://localhost:4848 Firstly Create new JDBC connection pool by navigating Common Tasks -> Resources -> JDBC -> JDBC Connection Pools. It will look something like this. Then Secondly create Connection resource by navigating Common Tasks -> Resources -> JDBC -> JDBC Resources It will look somehting like this. First Problem is sorted. you can test it using Ping button in connect

Categories : Web Services

Maven Glassfish plugin for glassfish 4
If you installed a default GlassFish 4 instance, then there is only the admin user with no password. The password file for that user is in the domain configuration directory named "admin-keyfile". In this situation when you access the GlassFish admin console no authentication is required. In your plugin configuration just provide the user and the password file (delete the adminPassword entry): <user>admin</user> <passwordFile>[...]domainsdomain1configadmin-keyfile</passwordFile> If you decide to change the admin password with the asadmin utility then change the plugin configuration in your pom.xml as follows: <user>admin</user> <adminPassword>YOUR_NEW_PASSWORD</adminPassword> For further details check the Security Guide

Categories : Maven

Any way configure to configure visual studio mvc build views release mode
Are you specifically setting something to compile the views like the Razor Generator? (http://razorgenerator.codeplex.com/) If not views in MVC are not compiled.

Categories : Asp Net Mvc

TFS 2012 Configure Features Error - Unable to configure Planning Tools
Try this: Rename your User Story to "Product Backlog Item". Set the Initial State of you "Bug" to "Active". Try the Upgrade Rename your User Story Type back to "User Story". Remove the "Active" Initial State. Export your Common Process Config and add in your "Proposed" State into the Bug Configuration (see below). Import your Common Process Config. Example BugWorkItems <BugWorkItems category="Microsoft.BugCategory"> <States> <State type="Proposed" value="Proposed" /> <!-- more --> </States> </BugWorkItems>

Categories : Tfs

Cannot use JPA in Glassfish v4
You have two persistence.xml both at incorrect location : META-INF/persistence.xml WEB-INF/classes/persistence.xml The correct location relative to your war package root is WEB-INF/classes/META-INF/persistence.xml Avoid the ambiguity, do not place more than 1 persistence.xml. Also if you use maven you have to put persistence.xml on src/main/resources to have it assembled at the correct location on the war

Categories : Java

jsf 2.2 not supported on glassfish 3.1.2?
You can manually update the .jar file located at the Glassfish's /modules directory. More information: How do I upgrade Glassfish JSF api?

Categories : JSF

Does Glassfish v4 support SSL SNI?
According to the Glassfish 4 security guide, https://glassfish.java.net/docs/4.0/security-guide.pdf, there is NOT support for SNI. However, it's generally bad practice IMO (though still debated by many), to expose Glassfish directly to the internet. I usually solve this problem by running an Apache server with mod_ajp_proxy, connected to a jk-listener on Glassfish.

Categories : Ssl

glassfish v4 ClassNotFoundException
I had the same problem and according to this, you need to change the servlet class from com.sun.jersey.spi.container.servlet.ServletContainer to org.glassfish.jersey.servlet.ServletContainer in the web.xml config file.

Categories : Java

Glassfish - Application name is already in use
here are some steps you can try: Fix your projects name :3 If your problem is the one the question title suggests, undeploy your application first, then redeploy. You can easily undeploy and force redeploy in the Glassfish Admin Gui (http://localhost:4848). If your application still does not work, update your question with proper formatted log messages of the actual problem.

Categories : Java

how to install ssl on glassfish 3.1.2.2
This configuration works for me: (on the SSL tab of http-listener-2) SSL3 - [enabled] TLS - [enabled] Client Authentication - [enabled] Certificate NickName: s1as Key Store: [empty] Trust Algorithm: [empty] Max Certificate Length: 5 Trust Store: [empty] Cipher Suites: [all selected] Hope it helps.

Categories : Java

GlassFish Quandary
The 404 error is the HTTP page not found error. This means, the page you are trying to access does not exist. I believe your application is not deployed on the server. To deploy your application, go to server admin page localhost:4848 click on application from the navigation menu. From there click on Deploy and browse to the file location. You can also specify the context root where your application should be deployed. However, your application might be deployed on the server with a different context root. If you have a glassfish descriptor, then you can check your context root from there. However, If you do not have a glassfish descriptor then you need to create one. In this descriptor you need to define your context root name. <context-root>/foobar</context-root> this

Categories : Java

Java EE EJB 3.0 Glassfish
As Java EE 6 comes with different profiles (i.e. Web/Lite profile and Full) not all functionality is supported in the Web/Lite profile. Especially the web profile only supports "EJB Lite" which comes without support for asynchronous EJBs have a look at the following article which comes with a table describing the features in EJB Lite and 'regular' EJB So what you'd have to do is create a project with the full profile in Netbeans. This will give you access to @Asynchonous.

Categories : Java

Arquillian with Glassfish V4
Latest 3.1 container adapter (CR4) should work with 4.x without any problems, as indicated on this blog entry.

Categories : Java

Can't get glassfish to connect to mysql
If you are using a Glassfish-initiated JDBC connection (I think you are since you say you sucessfully pinged the datasource), then you don't want to define the properties as you have them in the persistence.xml. You'll want to just specify a data-source by JNDI name. <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" 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"> <persistence-unit name="HelloWorld"> <non-jta-data-source>jdbc/myds</non-jta-data-source> <class>model.HelloWorld</class> <properties> </properties> </persistence-uni

Categories : Mysql

Glassfish and JSF: Singleton not set for WebappClassLoader
JSF plugin works fine in IDEA for me. Make sure you have the JSF facet enabled on your project settings. Would also make sure that under idea the source directories are marked as such (usually src/main/java, src/main/webapp, src/main/resources, each separately). Hard to tell on the rest without taking a look at your pom.xml and project structure.

Categories : JSF

glassfish not logging after deploy
The problem arises after these lines in the log: INFO: HHH000227: Running hbm2ddl schema export INFO: HHH000230: Schema export complete INFO: HHH000030: Cleaning up connection pool [jdbc:hsqldb:mem:richfaces_showcase] so, I guess the problem is caused by richfaces-showcase, when Hibernate is trying to clean up the connection pool. If you're not using the richfaces-showcase anyway (which you're probably not), you could exclude it from your dependencies, so it cannot cause any trouble. By running the dependency:tree goal, you can see, that the richfaces-distribution contains the following: +- org.richfaces.ui:richfaces-components-api:jar:4.3.2.Final:compile +- org.richfaces.ui:richfaces-components-ui:jar:4.3.2.Final:compile +- org.richfaces.core:richfaces-core-api:jar:4.3.2.Final

Categories : Maven

migrate from glassfish 3 to tomcat 7
Right click your existing project and click "Properties." Go to "Targed Runtimes" and add Tomcat 7 as a new Runtime Environment. You should be able to deploy your project with Tomcat after this. EDIT: The "Targed Runtimes" section in Properties is located here:

Categories : Tomcat

glassfish 4 & MySQL & JSTL
Include the following resource definition in your web.xml and it should work properly. <resource-ref> <res-ref-name>jdbc/SOMETHING</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <mapped-name>jdbc/SOMETHING</mapped-name> </resource-ref>

Categories : Mysql

Is there a way to use Hibernate 4.2.2 with Java EE 7 and Glassfish 4?
Simply adding Hibernate as a dependency to your application won't work. You either have to add the Hibernate JARs to GlassFish's server classpath (in which case Hibernate would be available as a JPA provider for all applications), or you bundle the Hibernate JARs in the lib directory of an EAR (in which case only that application would use Hibernate). See this blog for an example of the later case: http://javafromthetrenches.wordpress.com/2011/01/15/using-hibernate-jpa-with-glassfish/ You don't need to do anything special to use JTA and an EclipseLink (or Hibernate) datasource. Session beans are automatically transactional, so inject an entity manager instance into your session bean and use it from the business methods. I should also point out that you'll need to add JDBC resources to Gl

Categories : Misc

Cassandra-jdbc and glassfish
It seems that slf4j wasn't loading correctly because it depends on log4j.jar. Add it in classpath, and make sure that all jars is there: apache-cassandra-{version}.jar apache-cassandra-clientutil-{version}.jar apache-cassandra-thrift-{version}.jar cassandra-jdbc-{version}.jar commons-lang-{version}.jar guava-{version}.jar libthrift-{version}.jar log4j-{version}.jar slf4j-api-{version}.jar slf4j-log4j12-{version}.jar

Categories : Cassandra

Distributed sessions with GlassFish
Obviously you want to have some sort of Single Sign-On. Have a look here for a description using an authentication realm in GlassFish: User Authentication for Single Sign-on The blog post Session Sharing between Java Web Applications explains how to not violate standards (Servlet, Java EE) and advises to use some backend like Memcached.

Categories : Java

Glassfish increase maxParameterCount
I'm going to put the answer here for public knowledge, but it was someone else who I know who figured it out: I changed web-core.jar to be web-core.zip and then opened the zip and went into the org/apache/catalina/connector folder. I extracted the Connector.class file and opened it in a hex editor, searched for 0x2710 (10,000) and changed it to 0xFFFF (-1) Then I copied the Connector.class back into the zip file and renamed back to .jar I also opened the jar with java-decompiler to verify that the java code did actually look correct after manually editing the class file.

Categories : Java

Glassfish javax.ejb.EJBException
I have worked recently with EJB and I can tell you to check the JNDI that you are setting to connect to the EJB. Properties props = new Properties(); props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory"); props.setProperty("org.omg.CORBA.ORBInitialHost", "*hostname*"); props.setProperty("org.omg.CORBA.ORBInitialPort", "*3700*");//default port InitialContext ctx = new InitialContext(props); FirstBeanRemote bean = (FirstBeanRemote) ctx.lookup("java:global/*EARNAME/EJBJARNAME*/FirstBean!*fullyqualifiedpackage*.FirstBeanRemote"); The most important thing is to check if you are setting the ctx.lookup argument. Check also the EJB jar if is deploying correctly. I don't know If its a bug, but in Eclipse and Glassfish, The EJB can't have external jar

Categories : Java

run Spring 3 application on Glassfish 4
It seems to be an issue with the class loading of Hibernate Validator library - it's likely that you have another version of this library installed on your Glassfish. You can read more about classloading order in Glassfish 4.0 at GlassFish Server Development Guide 4.0 there is a whole Chapter 2 - Classloaders.

Categories : Java

glassfish full gc once an hour
I suspect your RMI is triggering a Full clean up. http://docs.oracle.com/javase/6/docs/technotes/guides/rmi/sunrmiproperties.html both sun.rmi.dgc.server.gcInterval When it is necessary to ensure that unreachable remote objects are unexported and garbage collected in a timely fashion, the value of this property represents the maximum interval (in milliseconds) that the Java RMI runtime will allow between garbage collections of the local heap. The default value is 3600000 milliseconds (one hour). and sun.rmi.dgc.client.gcInterval When it is necessary to ensure that DGC clean calls for unreachable remote references are delivered in a timely fashion, the value of this property represents the maximum interval (in milliseconds) that the Java RMI runtime will allow between

Categories : Java

Primefaces push with GlassFish 4.0
Atmosphere-2.0.0.RC5, Primefaces-4.0.RC1 I managed to do a workaround which isnt nice really, but pushing to all, made it work. Might be enough for your usecase pushContext.push("/*", facesMsg); Edit: So i did some further debuging and added some more logging if (BroadcasterFactory.getDefault() != null) { Collection<Broadcaster> list = BroadcasterFactory.getDefault().lookupAll(); for (Broadcaster b : list) { logger.warn("id={}", b.getID() ); } } output: Info: 2013-09-17 22:43:10,010 - id=/* Info: 2013-09-17 22:43:10,010 - id=/notificationsprimepush so finally i tried: pushContext.push("/notifications" + "primepush", facesMsg); WORKED! :)

Categories : JSF

Spring 3.2.4, EclipseLink 2.5, Glassfish 3.1.2 and JPA 2.1
I notice a couple of things with your configuration You have multiple <tx:annotation-driven ../> tags, this is at least confusing <context:annotation-driven ../> already implies the PersistenceAnnotationBeanPostProcessor, PersistenceExceptionTranslationPostProcessor and utowiredAnnotationBeanPostProcessor. The DefaultAdvisorAutoProxyCreator is also already present (your config can lead to proxing a proxy) What is it you want JTA or not? Your persistence.xml gives the impression you want JTA however you fail to configure a JtaTransactionManager, you have a JpaTransactionManager which is to be used for local transactions. Either remove JTA from persistence.xml or configure a JtaTransactionManager. When you want JtaTransaction you need to set the jtaDataSource property of the Lo

Categories : Java

Error deploying JSF app in Glassfish
Unable to parse document 'jar:file:/opt/glassfish3/glassfish/domains/domain1/applications/[name-of-the-application]/WEB-INF/lib/javax.faces.jar!/META-INF/mojarra_ext.taglib.xml The path to the taglib file suggests that you shipped JSF 2.2 along with the webapp inside its /WEB-INF/lib instead of upgrading GlassFish itself. As GlassFish 3 itself ships with a JSF 2.1 implementation out the box, you need to instruct it to not load it in order to avoid version conflicts. You didn't state anywhere that you were doing that, so I guess that this is the whole cause of your problem. Glassfish itself already ships with JSF bundled which get by default classloading precedence over the one bundled in the webapp. You basically need to tell Glassfish to use the webapp bundled JSF instead. In order

Categories : JSF

GlassFish connection pool
A Driver and a DataSource are not the same. It looks from your configuration that you're setting a Driver class as the DataSource classname? Do you really need XA? Are you doing any distributed transaction? If so, set the data source to com.mysql.jdbc.jdbc2.optional.MysqlXADataSource If not, select a regular DataSource type and then set the classname to com.mysql.jdbc.jdbc2.optional.MysqlDataSource

Categories : Mysql

How should I deploy PrimeFaces 3.5 into Glassfish 3.1.2?
Primefaces is a JSF library, not an EAR/WAR/EJB-jar module. It is supposed to be deployed along with the application (i.e. within an EAR/WAR), not separately on the server. Include it in you application and it will available after deployment.

Categories : JSF

Weblogic and Glassfish Jax-RS Jersey
I guess you moved some of the jars from WLS to GF. If so, remove the com.sun.jersey.server_*.jar that was moved from WLS from your GF installation (or from your WAR if it's there) and you should be fine. You don't need this jar to run your JAX-RS service in GF 3.1.2 (GF should have all needed dependencies bundled in it).

Categories : Java

How to upgrade Jersey 2.2 to Glassfish 4?
the approach you did is correct. The problem is that Glassfish 4.0 might not work with newest Jersey version as there might be incompatibilities. Jersey is used internally in Glassfish and when there is a problem with incompatible Jersey versions, Glassfish might not even start (like in your case). You can try using one of the Glassfish night builds which have already Jersey 2.2 integrated. http://dlc.sun.com.edgesuite.net/glassfish/4.0.1/nightly/ The link is accessible from http://glassfish.org (Download->Work in progress). Night build versions might be unstable. You can try for example build: http://dlc.sun.com.edgesuite.net/glassfish/4.0.1/nightly/glassfish-4.0.1-b02-08_22_2013.zip Mira EDIT 1 In the following article you can find a script that does the update of Jersey 2 in Glas

Categories : Java

GlassFish: email log handler
Looks like a bug was reported for this NoSuchMethodException when attempting to install log handler in GlassFish server. This issue was raised with the JavaMail team under Bug 6668 - skip unusable Store and Transport classes which is fixed in JavaMail 1.5.3. Upgrading the JavaMail module in glassfish should correct the issue. It is also helpful to start glassfish with "glassfish/bin/asadmin start-domain -v" so you can see all bootstrapping messages. •Are we deploying the handler to the correct location (domain/lib/ext) Yes. You can deploy to domain/lib/ext but you have to include JavaMail 1.5.3 so you find the correct transport service. Otherwise, you can deploy the jar to the modules dir and add the HK2 metadata to make the smtphandler look like a service. Another option is

Categories : Java

Glassfish 3.1.2.2 file upload
Finally, I found a solution : $.ajax({ type : 'POST', url : '/processUpload', data : formData, dataType : 'text', cache : false, processData : false, contentType : false, xhr : function () { ... progress things ... } }); instead of using native XHR. Working with : org.springframework.web.multipart.commons.CommonsMultipartResolver last commons-io / commons-fileupload librairies default glassfish web-core.jar

Categories : Java

Jdeveloper 12c and Glassfish libs
When you are running your code in JDeveloper it uses WebLogic - are you sure your classes don't interfere with the default WebLogic classes for InitialContext for example? Another option is to try running your project from JDeveloper on a Glassfish server and see if it works there. https://blogs.oracle.com/shay/entry/glassfish_extension_for_oracle_jdeveloper

Categories : Java

Glassfish 4 with EMF Texo - JPA No persistence provider
There may be a classloader conflict. Glassfish4 includes EclipseLink in the container library path. Try removing your explicit <provider> tag and any jpa implementation jars from WEB-INF/lib folder. The standard Glassfish javax.persistence.jar should be all you need.

Categories : Java

@EJB and @Inject both causing NPE in Glassfish 3.1.2 and Java 6
Make your JAX-RS service a stateless session bean: @Path("generic") @Stateless // <- It's an EJB public class GenericResource { @EJB NewSessionBean nsb; @GET @Produces("application/xml") public String getXml() { nsb.helloWorld(); return "<hello>World</hello>"; } }

Categories : Misc

Glassfish v4 Transaction Manager not found
Have you tried deploying to GlassFish directly ? Does the redeploy fail outside of InteilliJ too ? Any particular reason you are explicitly including Entity classes in your persistence.xml. Ditto with persistence provider as well. Why have you added GlassFish's LIB as provided. That should not even be required for a standard Java EE 6 application.

Categories : Java

Lost Date-Information with JAX-RS 2.0 and Glassfish 4
It depends on the different versions of Jackson-Provider inside the glassfish 4, not correct initialize the provider. See REST webservice don't use my JsonSerializer

Categories : Json

What is org.glassfish.webservices.monitoring.WebServiceTesterServlet?
Reading the Source Code it looks to be a utility servlet for testing webservices as the name would imply. As far as how to use it? Probably best to play with it by creating an instance and playing with it some. It looks like it's designed for easy local testing, one of the constructors takes an endpoint: public WebServiceTesterServlet(WebServiceEndpoint ep) { svcEP = ep; } Read some of the comments in the source code, it seems to explain what most of the methods are for. The source itself is relatively easy to follow. I'm not sure how useful the class is overall for testing webservices but something like Soap UI is very useful for web services testing.

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.