java-ee

tomcat restart webapp from command line

…衆ロ難τιáo~ 提交于 2019-12-30 01:54:07
问题 I have a PCI DSS compliant environment which runs several apps and I want to restart only one app without restarting the server. I don't have the manager because apparently it's not allowed in this environment. How do I go about restarting a single web app via command line? 回答1: I know I am late to the party, but a little trick you can do in order to reload the app from the command line is to go to the web.xml of the application and simply touch it. touch web.xml tomcat reloads the

WELD-001408: Unsatisfied dependencies for type Customer with qualifiers @Default

那年仲夏 提交于 2019-12-30 01:34:33
问题 I'm a Java EE-newbie. I want to test JSF and therefore made a simple program but can not deploy it. I get the following error message: cannot Deploy onlineshop-war deploy is failing=Error occurred during deployment: Exception while loading the app : CDI deployment failure:WELD-001408: Unsatisfied dependencies for type Customer with qualifiers @Default at injection point [BackedAnnotatedField] @Inject private de.java2enterprise.onlineshop.RegisterController.customer at de.java2enterprise

Relationship between EJB 3.0 and JPA?

淺唱寂寞╮ 提交于 2019-12-30 00:54:10
问题 That may seem obvious but I've seen contradictory statements: Is JPA part of EJB 3.0? I'm no specialist and it's quite confusing for me. If so, JPA manipulates Entity Beans? These entity beans being the interface between the persistence layer and the business layer implementing the logic with stateless beans? The underlying question for me is how to implement a "search for user based on various criteria" function, where the "search" request -its string representation- should be built? I mean,

Accessing Hibernate Session from EJB using EntityManager

余生颓废 提交于 2019-12-29 18:42:47
问题 Is it possible to obtain the Hibernate Session object from the EntityManager? I want to access some hibernate specific API... I already tried something like: org.hibernate.Session hSession = ( (EntityManagerImpl) em.getDelegate() ).getSession(); but as soon as I invoke a method in the EJB I get "A system exception occurred during an invocation on EJB" with a NullPointerException I use glassfish 3.0.1 回答1: Bozho and partenon are correct, but: In JPA 2, the preferred mechanism is entityManager

Get rid of org.jboss.weld.context.NonexistentConversationException, when a query-string parameter named cid is appended to the URL

和自甴很熟 提交于 2019-12-29 08:57:31
问题 Take a simple CDI (it could also be a JSF managed bean) bean as follows. import java.io.Serializable; import javax.inject.Named; import javax.faces.view.ViewScoped; @Named @ViewScoped public class TestManagedBean implements Serializable { private static final long serialVersionUID=1L; public TestManagedBean() {} } If this bean is accessed by an XHTML page with a query-string parameter named cid which is needed for a @ConversationScoped CDI managed bean (which may accidently/deliberately be

Java - Exception in thread “main” java.lang.Error: Unresolved compilation problems

喜你入骨 提交于 2019-12-29 08:51:30
问题 I have some problem in my JDBC code. I am trying to connect through MySQL but it gives me an error. My error log is given below if you have some time. Exception in thread "main" java.lang.Error: Unresolved compilation problems: BLOB cannot be resolved to a type BLOB cannot be resolved to a type at serialize.SerializeDeserialze.main(SerializeDeserialze.java:73) My code is given below. I am using mysql-connector-java-5.1.20.jar driver: package serialize; /* By vivek */ import java.io

Java - Exception in thread “main” java.lang.Error: Unresolved compilation problems

爷,独闯天下 提交于 2019-12-29 08:51:10
问题 I have some problem in my JDBC code. I am trying to connect through MySQL but it gives me an error. My error log is given below if you have some time. Exception in thread "main" java.lang.Error: Unresolved compilation problems: BLOB cannot be resolved to a type BLOB cannot be resolved to a type at serialize.SerializeDeserialze.main(SerializeDeserialze.java:73) My code is given below. I am using mysql-connector-java-5.1.20.jar driver: package serialize; /* By vivek */ import java.io

Transaction is required to perform this operation (either use a transaction or extended persistence context)

一曲冷凌霜 提交于 2019-12-29 08:35:09
问题 I'm using Wildfly 10.0.0 Final, Java EE7, Maven and JPA 2.1. When I am querying my database for records it works fine and lists out the employees, but when I am trying to persist a new employee it gives me the following exception: javax.servlet.ServletException: WFLYJPA0060: Transaction is required to perform this operation (either use a transaction or extended persistence context) javax.faces.webapp.FacesServlet.service(FacesServlet.java:671) io.undertow.servlet.handlers.ServletHandler

p:commandButton not working inside c:forEach [duplicate]

烂漫一生 提交于 2019-12-29 08:17:05
问题 This question already has answers here : commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated (12 answers) Closed 4 years ago . i am trying to use p:commandButton inside c:forEach tag but this commandButton not invoked: <c:forEach items="#{carnetOrdreBean.selectedOrdreList}" var="ordre"> <p:commandButton action="#{carnetOrdreBean.annulerOrdreChoisi}" value="Annuler" rendered="#{ordre.voirAnnulerOuNon}"> <f:setPropertyActionListener value="#{ordre}"

Jersey-request for authentication

╄→гoц情女王★ 提交于 2019-12-29 08:16:28
问题 I have a working JavaEE 6 web application on Glassfish, this application already has a JSF frontend and has its authentication mechanism((Using CDI and annotation based security) So there is a login screen, user enters username password, press login button and Java EE authentication process begins. Now I want to "also" expose some of my service classes as a REST service (I will use Jersey probably), so it can also be reached from a mobile device. But what worries me is the login part. I will