java-ee

WAR deployment to JBoss fails because it calls a SAR packaged in an EAR

允我心安 提交于 2019-12-25 08:02:30
问题 I'm packaging a JBoss service archive (SAR) and WAR together in an EAR with Maven for deployment to JBoss. The problem I have is that another standalone WAR running on this server calls a service provided by the aforementioned SAR on JBoss startup. Because JBoss deploys the standalone WAR before the EAR containing the SAR, the standalone WAR throws errors because the service it's calling has not been deployed yet. Is there a way to get JBoss to deploy the EAR first? Is that even the correct

my java code disappears from java file eclipse

本小妞迷上赌 提交于 2019-12-25 07:59:23
问题 I am working on android project. since i was editing specific java file my laptop shutdown unexpectedly. when i switch on my laptop and open eclipse the file in which i was working show empty. there is no code :( what should i do now ?? please help :( for example i write this code but now its empty after computer unexpectedly shutdown public class ResourcesManager{ private BaseScene splashScene; private BaseScene menuScene; private BaseScene gameScene; private BaseScene loadingScene;} 回答1:

JBoss7.1.0: Can't find a persistence unit named null in subdeployment

北慕城南 提交于 2019-12-25 07:59:05
问题 I have a project with 3 modules inside: factory-ear, factory-ejb and factory-web. It deployed to JBoss7 as EAR with ejb.jar and web.war inside. When I trying to get EntityManager in my EJB class @PersistenceContext(unitName = "manager1") private EntityManager em; I get error JBAS011440: Can't find a persistence unit named manager1 in subdeployment "factory-ejb-1.0-SNAPSHOT.jar" of deployment "factory.ear" My persistence.xml <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0"

how to store a Jpeg file in a database?

那年仲夏 提交于 2019-12-25 07:49:12
问题 Is it possible to store a Jpeg file in a database using a Web Application? can you share some code on how to do it? or share some links for some tutorial regarding with my problem? thanks a lot :) 回答1: storing an image in a blob i don't use java, i don't know what database structure you are using but the principle is to store the image in a binary large object. (blob) it does require reading the object in and out using streams. (or at least in c# this is the case) the alternative(if it works)

org.hibernate.internal.util.config.ConfigurationException: Could not locate cfg.xml resource [C:\Users\marvi\workspace1\LoginApp\hibernate.cfg.xml]

别等时光非礼了梦想. 提交于 2019-12-25 07:37:50
问题 I am trying to make a maven login application using hibernate to persist the data onto a mysql database. I am deploying the application on a glassfish server. I am able to start the server and fill in data on the html form but once I submit the form, I get the following error logs: 2016-11-21T22:40:05.371-0500|Info: HHH000412: Hibernate Core {5.2.4.Final} 2016-11-21T22:40:05.379-0500|Info: HHH000206: hibernate.properties not found 2016-11-21T22:40:05.385-0500|Info: HHH000021: Bytecode

pageContext.request.contextPath and generic linking

时间秒杀一切 提交于 2019-12-25 07:27:05
问题 In reference to my older unanswered question, I have a further error / problem that is partially related to it. generic linking, variables and paths in jsp When I include my header.jsp like this: <%@include file="/WEB-INF/view/jsp/common/header.jsp" %> It works fine. But does not if I do it like this: <%@include file="${pageContext.request.contextPath}/view/jsp/common/header.jsp" %> Error: HTTP Status 500 - /WEB-INF/view/jsp/common/login/login.jsp (line: 8, column: 1) File "${pageContext

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<

Process.execute() throws exception when trying to run command on shell using java

南笙酒味 提交于 2019-12-25 07:08:28
问题 I have written this code which should execute a command on shell to search pattern ">" in a text file , when I try same command on shell it works fine but when I try execute same command using java , it doesn't work for me as buffered reader returns null.Can somebody tell that what I have done wrong in this. Code: String filename="/home/abhijeet/sample.txt"; Process contigcount_p; String command_to_count="grep \">\" "+filename+" | wc -l"; System.out.println("command for counting contigs "

WAR outside the EAR, not able to reference JAR inside EAR. In wildfly 8

会有一股神秘感。 提交于 2019-12-25 06:47:00
问题 I am migrating to Wildfly 8.2 from JBoss 5.1, I am deploying a Web Service using the resteasy and some EAR which has the code to get the requested data from the DB. Both the EAR which has multiple (6) JARs, but when I call the Web Service, it is not able to find the EAR and refer it's JARs 14:57:48,183 INFO [stdout] (default task-4) InitialContextFactory not defined - using default: org.jnp.interfaces.NamingContextFactory 14:57:48,184 ERROR [stderr] (default task-4) javax.naming

Struts 2 action class not working

﹥>﹥吖頭↗ 提交于 2019-12-25 06:46:42
问题 I am using struts2 for developing a web application. I have include the required jars for struts2 but when it is going to call the struts action class it is throwing 404 error. There is no error on console and browser does not showing .action extension whitch it shows when struts.xml call an action class. I am using jdk 1.6 and struts 2.0 . Am I missing any jar who is responsible for all this. In jsp I am simply calling the function from <s:form action = "Mergexmlaction" method = "post"/>