Weblogic Migration to TOmee - EJB
We have migrated a weblogic applictation to Tomee. Ear file has 2 web modules and 1 ejb module.
Deployment is successful in Tomee without any errors or warning.
But when we try to hit the wsdl end point , it gives 404.
please help us with any inputs, we have been trying this for many weeks now , no luck so far
Uncommented values from system.properties as well for remotesupport,blacklist, whitelist
Thank you -AD
do you know?
how many words do you know
See also questions close to this topic
-
Call RestApi endpoint resource from EJB
I have been looking around for sample code how to call a Restful service written in Spring boot (deployed in different server/ip) from an EJB client.
I couldn't find a simple example or reference to guide me on how to implement an EJB client that can call a restful service(deployed in different server/ip). Could you please point me to a document or example that shows or describe how the two can interface/talk to each other.
I need to call the endpoint by passing two header parameters for authentication, if authentication is success then only retrieve the details from Rest and send back the response to EJB client.
-
Failed to read response with EJB Remote when using wildfly 26
i am facing problem that client cannot read response from server with Class Entity(ETC List, Entity). Also with Objects of type String, int, Double it still works normally.
Project EJBServer
Class Entity: AnimalEntity.java
public class AnimalEntity {
private String animalName; private String animalCountry; private String animaltype; private double animalWeigth; public AnimalEntity(String animalName, String animalCountry, String animaltype, double animalWeigth) { super(); this.animalName = animalName; this.animalCountry = animalCountry; this.animaltype = animaltype; this.animalWeigth = animalWeigth; } public String getAnimalName() { return animalName; } public void setAnimalName(String animalName) { this.animalName = animalName; } ..............
}
Interface: AnimalServiceRemote.java.
import com.ejb.entity.AnimalEntity;
public interface AnimalServiceRemote { public String findByName(String strName); public AnimalEntity Request(String strName); }
- Bean Class: AnimalService.java
import jakarta.ejb.LocalBean; import jakarta.ejb.Remote; import jakarta.ejb.Stateless;
@Stateless @LocalBean @Remote(AnimalServiceRemote.class) public class AnimalService implements AnimalServiceRemote { @Override public String findByName(String strName) { List<AnimalEntity> lst= new ArrayList<AnimalEntity>(); AnimalEntity ani= new AnimalEntity("Dog", "Japan", "Type1", 30); AnimalEntity ani1= new AnimalEntity("Cat", "USA", "Type2", 150); AnimalEntity ani2= new AnimalEntity("Fish", "Ger", "Type3", 3); lst.add(ani); lst.add(ani1); lst.add(ani2); for (int i = 0; i < lst.size(); i++) { if (lst.get(i).getAnimalName().equals(strName)){ return "Name: "+ lst.get(i).getAnimalName() +" - Country: "+ lst.get(i).getAnimalCountry() +" - Weigth: "+lst.get(i).getAnimalWeigth(); } } return null; } @Override public AnimalEntity Request(String strName) { List<AnimalEntity> lst= new ArrayList<AnimalEntity>(); AnimalEntity ani= new AnimalEntity("Dog", "Japan", "Type1", 30); AnimalEntity ani1= new AnimalEntity("Cat", "USA", "Type2", 150); AnimalEntity ani2= new AnimalEntity("Fish", "Ger", "Type3", 3); lst.add(ani); lst.add(ani1); lst.add(ani2); AnimalEntity animal= new AnimalEntity(); for (int i = 0; i < lst.size(); i++) { if (lst.get(i).getAnimalName().equals(strName)){ animal=lst.get(i); return animal; } } return null; } }
AppClient
- Main Class: Myclient.java
import javax.naming.Context; import javax.naming.InitialContext; import com.ejb.entity.AnimalEntity; import com.ejb.remote.AnimalServiceRemote;
public class Myclient { public static void main(String[] args) { try { System.out.println("Proccessing...!" ); // Setting Config InitContext Properties props = new Properties(); props.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory"); props.put(Context.PROVIDER_URL, "remote+http://localhost:8080"); props.put("wildfly.naming.client.ejb.context", true); InitialContext ctx = new InitialContext(props); AnimalServiceRemote animal= (AnimalServiceRemote) ctx.lookup("ejb:/EJBServer/AnimalService!com.ejb.remote.AnimalServiceRemote"); System.out.println("Lookup completeted..." ); System.out.println(animal.findByName("Cat")); // => It's working normally AnimalEntity ani= new AnimalEntity(); ani=animal.Request("Fish"); // => error occurs here ctx.close(); } catch (Exception e) { System.out.println(e.getMessage()); } } }
with return type as String, Int, Double: it is working normally with return type List<EntityClass>, EntityClass: it throws an error, I still don't understand why.
Error Message:
16:13:28,617 WARN [org.jboss.ejb.client.remoting] (default task-1) EJBCLIENT000519: Exception occurred when writing EJB response to invocation 61367 over channel Channel ID 79beb44f (inbound) of Remoting connection 38289bc4 to 127.0.0.1/127.0.0.1:58770 of endpoint "desktop-sanolu2" <1d50c57e>: java.io.NotSerializableException: com.ejb.entity.AnimalEntity at org.jboss.marshalling.river@2.0.12.Final//org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:274) at org.jboss.marshalling@2.0.12.Final//org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58) at org.jboss.marshalling@2.0.12.Final//org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111) at org.jboss.ejb-client@4.0.44.Final//org.jboss.ejb.protocol.remote.EJBServerChannel$RemotingInvocationRequest$1.writeInvocationResult(EJBServerChannel.java:986) at org.jboss.as.ejb3@26.1.0.Final//org.jboss.as.ejb3.remote.AssociationImpl.lambda$receiveInvocationRequest$0(AssociationImpl.java:291) at org.jboss.as.ejb3@26.1.0.Final//org.jboss.as.ejb3.remote.AssociationImpl.execute(AssociationImpl.java:344) at org.jboss.as.ejb3@26.1.0.Final//org.jboss.as.ejb3.remote.AssociationImpl.receiveInvocationRequest(AssociationImpl.java:297) at org.jboss.ejb-client@4.0.44.Final//org.jboss.ejb.protocol.remote.EJBServerChannel$ReceiverImpl.handleInvocationRequest(EJBServerChannel.java:473) at org.jboss.ejb-client@4.0.44.Final//org.jboss.ejb.protocol.remote.EJBServerChannel$ReceiverImpl.handleMessage(EJBServerChannel.java:208) at org.jboss.remoting@5.0.24.Final//org.jboss.remoting3.remote.RemoteConnectionChannel.lambda$handleMessageData$3(RemoteConnectionChannel.java:432) at org.jboss.remoting@5.0.24.Final//org.jboss.remoting3.EndpointImpl$TrackingExecutor.lambda$execute$0(EndpointImpl.java:991) at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990) at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486) at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377) at org.jboss.xnio@3.8.6.Final//org.xnio.XnioWorker$WorkerThreadFactory$1$1.run(XnioWorker.java:1280) at java.base/java.lang.Thread.run(Thread.java:833) Caused by: an exception which occurred: in object com.ejb.entity.AnimalEntity@45251eee
please help me. Thank you very much
-
why does command /tmp/.weblogic/javae takes 100% CPU and sever goes to very slow performance
My previous question was closed by the lack of debugging details. So I am trying to add/explain maximum details related to this issue.
Apache is using as HTTP server and hosted all applications are hosted as PHP scripts. MySql is the Database. But, for report purpose I have to use JasperReports. So I have installed Java (1.7.0_80) and Apache Tomcat (7.0.105). and added .jasper files inside /opt/tomcat/webapps/reports/WEB-INF/reports and calling them from jsp file. This is the only purpose of Java/Tomcat and jsp files which I hosted. I mean the generation of PDF reports. and I am calling the jsp report from PHP using Curl. So the jsp will stream the PDF and we can show the report in browser. This is the flow and its happening successfully. But after 4 to 5 days from the restart of server, we can see command /tmp/.weblogic/javae using more memory space and its happening from multiple process IDs ans its leads to server slowness. It will back to normal once I restart the server. But still it show same issue after 4 to 5 days.
Versions Ubuntu | 18.04 | bionic | Ubuntu 18.04.6 LTS
java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode) Server version: Apache Tomcat/7.0.105 JVM Version: 1.7.0_80-b15 JVM Vendor: Oracle Corporation
htop response from terminal
1 [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||100.00%] 2 [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||100.00%] 3 [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||100.00%] 4 [|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||100.00%] Mem [|||||||||||||||||||||||| |4.14G/15G] Swp [||||||||| 117M/1024M] ------------------------------------------------------------------------------------------ PID USER PRI NI VIRT RES SHR S CPU% MEM% TIME+ Command ------------------------------------------------------------------------------------------ 1534 tomcat 20 0 4155M 2375M 8656 S 256. 14.8 146h /tmp/.weblogic/javae 1572 tomcat 20 0 4155M 2375M 8656 R 18.4 14.8 8h53:10 /tmp/.weblogic/javae 1567 tomcat 20 0 4155M 2375M 8656 R 13.9 14.8 8h53:21 /tmp/.weblogic/javae 1574 tomcat 20 0 4155M 2375M 8656 R 15.2 14.8 8h52:46 /tmp/.weblogic/javae 1561 tomcat 20 0 4155M 2375M 8656 R 17.1 14.8 8h53:50 /tmp/.weblogic/javae 1560 tomcat 20 0 4155M 2375M 8656 R 16.5 14.8 10h48:16 /tmp/.weblogic/javae 1573 tomcat 20 0 4155M 2375M 8656 R 14.6 14.8 8h52:19 /tmp/.weblogic/javae 1559 tomcat 20 0 4155M 2375M 8656 R 15.2 14.8 10h52:37 /tmp/.weblogic/javae 1570 tomcat 20 0 4155M 2375M 8656 R 17.1 14.8 8h53:32 /tmp/.weblogic/javae 1563 tomcat 20 0 4155M 2375M 8656 R 19.0 14.8 8h54:30 /tmp/.weblogic/javae 1562 tomcat 20 0 4155M 2375M 8656 R 17.1 14.8 8h52:57 /tmp/.weblogic/javae 1564 tomcat 20 0 4155M 2375M 8656 R 16.5 14.8 8h52:39 /tmp/.weblogic/javae 1566 tomcat 20 0 4155M 2375M 8656 R 15.8 14.8 8h52:50 /tmp/.weblogic/javae 1568 tomcat 20 0 4155M 2375M 8656 R 13.9 14.8 8h52:18 /tmp/.weblogic/javae 1565 tomcat 20 0 4155M 2375M 8656 R 17.7 14.8 8h54:32 /tmp/.weblogic/javae 1569 tomcat 20 0 4155M 2375M 8656 R 15.8 14.8 8h52:10 /tmp/.weblogic/javae 1571 tomcat 20 0 4155M 2375M 8656 R 13.3 14.8 8h53:46 /tmp/.weblogic/javae
JSP code to generate PDF and stream to browser
<%@ page import="java.util.*" %> <%@ page import="java.text.*" %> <%@ page import="java.io.*"%> <%@ page import="java.sql.*" %> <%@ page import="Connect.to.db.*" %> <%@ page import="java.lang.Object.*" %> <%@ page import= "net.sf.jasperreports.engine.JREmptyDataSource"%> <%@ page import= "net.sf.jasperreports.engine.JRException"%> <%@ page import= "net.sf.jasperreports.engine.JasperExportManager"%> <%@ page import= "net.sf.jasperreports.engine.JasperFillManager"%> <%@ page import= "net.sf.jasperreports.engine.*"%> <%@ page import= "net.sf.jasperreports.engine.export.*"%> <%@ page import= "net.sf.jasperreports.engine.util.*"%> <%@ page import= "net.sf.jasperreports.view.*"%> <%@ page import= "net.sf.jasperreports.engine.xml.JRXmlLoader"%> <%@ page import= "net.sf.jasperreports.engine.base.JRBaseReport"%> <%@ page import= "net.sf.jasperreports.engine.design .*"%> <%@ page import= "net.sf.jasperreports.engine.data.*"%> <%@ page import="java.net.URLDecoder"%> <%@ page import="java.util.*" %> <%@ page import="java.text.*" %> <%@ page import="java.io.*"%> <%@ page import="java.sql.*" %> <%@ page import="java.lang.Object.*" %> <%@page import="javax.activation.DataSource"%> <%@page contentType="application/pdf"%> <%@page trimDirectiveWhitespaces="true"%> <%@page pageEncoding="UTF-8"%> <% try { System.setProperty("java.awt.headless", "true"); String connectionURL = "jdbc:mysql://localhost:3306/project"; Connection con = null; try { Class.forName("com.mysql.jdbc.Driver").newInstance(); con=DriverManager.getConnection(connectionURL, "username", "password"); } catch (Exception ex) { ex.printStackTrace(); } DateFormat formatter ; java.util.Date date ; String caption1=request.getParameter("caption1"); String caption2=request.getParameter("caption2"); String month_id=request.getParameter("month_id"); String mill_id=request.getParameter("comp_id"); Map parameters = new HashMap(); parameters.put("caption1",request.getParameter("caption1")); parameters.put("caption2",request.getParameter("caption2")); parameters.put("month_id",Integer.parseInt(month_id.trim())); parameters.put("comp_id",Integer.parseInt(comp_id.trim())); File reportFile = new File(application.getRealPath("/WEB-INF/reports/project/report.jasper")); byte[] bytes = JasperRunManager.runReportToPdf(reportFile.getPath(), parameters, con); response.reset(); response.setContentType("application/pdf"); response.setContentLength(bytes.length); ServletOutputStream outStream = response.getOutputStream(); outStream.write(bytes, 0, bytes.length); outStream.flush(); outStream.close(); } catch (Exception ex) { ex.printStackTrace(); } %>
Getting only one exception from all reports repeatedly
catalina.log
Apr 30, 2022 11:56:53 PM org.apache.coyote.http11.AbstractHttp11Processor process INFO: Error parsing HTTP request header Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Invalid character found in the HTTP protocol [HTTP/1.10x0aHost:] at org.apache.coyote.http11.InternalInputBuffer.parseRequestLine(InternalInputBuffer.java:269) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1108) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:654) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:317) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)
localhost.log
Apr 30, 2022 11:57:49 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [jsp] in context with path [/reports] threw exception [java.lang.IllegalStateException: getOutputStream() has already been called for this response] with root cause java.lang.IllegalStateException: getOutputStream() has already been called for this response at org.apache.catalina.connector.Response.getWriter(Response.java:643) at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:213) at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:128) at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:121) at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:194) at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:124) at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:78) at org.apache.jsp.udmc_005fhealthcare.bill_005freceipt_005fprint_jsp._jspService(bill_005freceipt_005fprint_jsp.java:208) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:71) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:477) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:165) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:452) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1201) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:654) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:317) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)
-
Weblogic Log4j2 setup not printing Debug messages
So i have a simple properties handler java code which prints these loggers . I am using commons logging and log4j2
import org.apache.commons.vfs2.FileObject; import org.apache.commons.vfs2.FileSystemException; import org.apache.commons.vfs2.FileSystemManager; import org.apache.commons.vfs2.VFS; import org.apache.commons.vfs2.impl.DefaultFileMonitor; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** * Provides functions to get the property file from cache or load it into cache. * */ public final class PropertiesHandler { private static final Log logger = LogFactory.getLog(PropertiesHandler.class); public static void main(String[] args) throws Exception { logger.debug("(((((New debug logger used in Log4j2)))))"); logger.warn("(((((New warn logger used in Log4j2)))))"); logger.info("(((((New info logger used in Log4j2)))))"); logger.error("(((((New error logger used in Log4j2)))))"); logger.debug("Entering getPropertyValue"); logger.debug("propertyKey : [" + propertyKey + "]"); logger.debug("propertyFile : [" + propertyFile + "]"); } .... <<Some other code>>
which is packaged as a jar and used inside a service inside weblogic server.
my log4j2.xml which is packaged as part of the jar looks like hthis
<Configuration status="error"> <Appenders> <Console name="consoleLogger" target="SYSTEM_OUT"> <PatternLayout pattern="%-7p %d [%t] %c %x - %m%n" /> </Console> <RollingFile name="fileLogger" fileName="propertieshelper.log" filePattern="${filename}.%d{yyyy-MM-dd}" append="true"> <PatternLayout pattern=" %-7p %d [%t] %c %x - %m%n" /> <SizeBasedTriggeringPolicy size="102400KB" /> <DefaultRolloverStrategy max="5" /> </RollingFile> </Appenders> <Loggers> <Logger name="ca.bell" level ="debug"> <AppenderRef ref="fileLogger" /> <AppenderRef ref="consoleLogger" /> </Logger> <Root level="error"> <AppenderRef ref="fileLogger" /> </Root> </Loggers> </Configuration>
now when i run my jar as a standalone in eclipse it prints my needed loggers.
. . . ERROR 2022-04-29 13:45:36,705 [main] ca.bell.dao.properties.handler.PropertiesHandler [] - Unable to lookup startup property appConfigPath, using propertieshelper.properties embedded in the jar DEBUG 2022-04-29 13:45:36,712 [main] ca.bell.common.utlis.PropertiesLoader [] - Loading properties from class path : propertieshelper.properties DEBUG 2022-04-29 13:45:36,712 [main] ca.bell.common.utlis.PropertiesLoader [] - Loading properties using input stream DEBUG 2022-04-29 13:45:36,713 [main] ca.bell.dao.properties.handler.PropertiesHandler [] - Derived default properties file : /opt/oracle/OSM/env.properties DEBUG 2022-04-29 13:45:36,713 [main] ca.bell.dao.properties.handler.PropertiesHandler [] - (((((New debug logger used in Log4j2))))) WARN 2022-04-29 13:45:36,714 [main] ca.bell.dao.properties.handler.PropertiesHandler [] - (((((New warn logger used in Log4j2))))) INFO 2022-04-29 13:45:36,714 [main] ca.bell.dao.properties.handler.PropertiesHandler [] - (((((New info logger used in Log4j2))))) ERROR 2022-04-29 13:45:36,714 [main] ca.bell.dao.properties.handler.PropertiesHandler [] - (((((New error logger used in Log4j2))))) DEBUG 2022-04-29 13:45:36,714 [main] ca.bell.dao.properties.handler.PropertiesHandler [] - Entering getPropertyValue DEBUG 2022-04-29 13:45:36,718 [main] ca.bell.dao.properties.handler.PropertiesHandler [] - propertyKey : [text] DEBUG 2022-04-29 13:45:36,718 [main] ca.bell.dao.properties.handler.PropertiesHandler [ . . .
but when i use this jar within my service and deploy the app to weblogic jar it does NOT print the "debug" logs ONLY. it does Prints the rest. So what am i doing wrong ?
-- server side logs for this properties handler app
. . . 5:19 AM EDT> <Warning> <ca.bell.dao.properties.handler.PropertiesHandler> <BEA-000000> <(((((New warn logger used in Log4j2)))))> <Apr 29, 2022 3:15:19 AM EDT> <Info> <ca.bell.dao.properties.handler.PropertiesHandler> <BEA-000000> <(((((New info logger used in Log4j2)))))> <Apr 29, 2022 3:15:19 AM EDT> <Error> <ca.bell.dao.properties.handler.PropertiesHandler> <BEA-000000> <(((((New error logger used in Log4j2)))))> <Apr 29, 2022 3:15:19 AM EDT> <Warning> <ca.bell.dao.properties.handler.PropertiesHandler> <BEA-000000> <(((((New warn logger used in Log4j2)))))> <Apr 29, 2022 3:15:19 AM EDT> <Info> <ca.bell.dao.properties.handler.PropertiesHandler> <BEA-000000> <(((((New info logger used in Log4j2)))))> <Apr 29, 2022 3:15:19 AM EDT> <Error> <ca.bell.dao.properties.handler.PropertiesHandler> <BEA-000000> <(((((New error logger used in Log4j2)))))> . . .
-
Problem when deploying PF 11 app with CDI (weld) on Tomee Plume 8.0.9
I'm trying to migrate a PF6 app to PF11, and, after deploying it on tomee 8.0.9, I've got the following error:
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]] at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726) ... 37 more Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type GeronimoOpenAPIExtension with qualifiers @Default at injection point [BackedAnnotatedField] @Inject private org.apache.geronimo.microprofile.openapi.jaxrs.OpenAPIFilter.extension at org.apache.geronimo.microprofile.openapi.jaxrs.OpenAPIFilter.extension(OpenAPIFilter.java:0) Possible dependencies: - Extension [class org.apache.geronimo.microprofile.openapi.cdi.GeronimoOpenAPIExtension] with qualifiers [@Default]; jar:file:/home/chiritda/Software/ntv_3.0/apache-tomee-plume-8.0.9/lib/geronimo-openapi-impl-1.0.12.jar!/META-INF/services/javax.enterprise.inject.spi.Extension@1[org.apache.geronimo.microprofile.openapi.cdi.GeronimoOpenAPIExtension@10c433f7], - Extension [class org.apache.tomee.microprofile.config.TomEEOpenAPIExtension] with qualifiers [@Default]; jar:file:/home/chiritda/Software/ntv_3.0/apache-tomee-plume-8.0.9/lib/mp-common-8.0.9.jar!/META-INF/services/javax.enterprise.inject.spi.Extension@17[org.apache.tomee.microprofile.config.TomEEOpenAPIExtension@a21441e] at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:386) at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:290) at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:143) at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:164) at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:526) at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:64) at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:62) at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62) at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:833)
Both Geronimo and TomeeOpenApi extensions are present in the tomee's lib directory.
I'm using a standalone tomee plume server, java 17.0.1, PF11, WELD 3.1.4.
Any ideas would be appreciated.
Thanks!
-
Tomcat 10.0.4 fails to start: "Caused by: java.lang.NoClassDefFoundError: org/apache/xbean/asm9/ClassVisitor"
I'm having some classpath issues when starting up a new Tomcat install (TomEE) using tomcat 10 and JDK 18 on Linux. What I'm noticing is that, whereas usually on startup Tomcat prints out the entire classpath first thing, in this case it isn't printing anything, and the first lines are instead like this (truncated)
NOTE: Picked up JDK_JAVA_OPTIONS: ......... 30-Apr-2022 18:49:54.191 INFO [main] java.lang.reflect.Method.invoke Server version name: Apache Tomcat/10.0.4
Then the error
` 30-Apr-2022 18:35:05.674 SEVERE [main] java.lang.reflect.Method.invoke Error deploying web application directory [/opt/apache-tomee-webprofile-9.0.0-M7/webapps/host-manager] java.lang.IllegalStateException: Error starting child Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/host-manager]] at ... Caused by: java.lang.NoClassDefFoundError: org/apache/xbean/asm9/ClassVisitor at
Caused by: java.lang.ClassNotFoundException: org.apache.xbean.asm9.ClassVisitor ... 45 more
`
This the only dependency in my pom
<groupId>jakarta.platform</groupId> <artifactId>jakarta.jakartaee-web-api</artifactId> <version>9.0.0</version> <scope>provided</scope>
What is the right way to inform tomcat as to where all my WEB-INF/lib libraries are? I was having the same error message in Maven when my WEB-INF/lib was not populated properly with the jars, so I am near certain this is just a classpath issue for tomcat.
I've tried setting the classpath in setenv.shh but it didn't solve anything:
export CLASSPATH="$CLASSPATH":/home/______/dev/_____/src/main/webapp/WEB-INF/lib
Adding the ASM9 dependency does not fix anything
Also, I'm not using Spring or Gradle
-
"no main manifest attribute, in server.war" not using a main class
What I'm trying to do is have Docker run a TomEE 8.0.0 application with Maven. However when compiling the application, it gives me the error from the title
no main manifest attribute, in server.war
.pom.xml
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>org.example</groupId> <artifactId>server</artifactId> <version>0.1-SNAPSHOT</version> <properties> <maven.compiler.source>12</maven.compiler.source> <maven.compiler.target>12</maven.compiler.target> </properties> <build> <plugins> <plugin> <groupId>org.apache.tomee.maven</groupId> <artifactId>tomee-embedded-maven-plugin</artifactId> <version>8.0.0</version> <configuration> <context>ROOT</context> <containerProperties> <tomee.mp.scan>true</tomee.mp.scan> </containerProperties> </configuration> <dependencies> <dependency> <groupId>org.apache.tomee</groupId> <artifactId>mp-common</artifactId> <version>8.0.0</version> </dependency> </dependencies> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.10.1</version> <configuration> <source>8</source> <target>8</target> </configuration> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>3.0.0</version> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>2.22.1</version> </plugin> </plugins> </build> <packaging>war</packaging> <repositories> <repository> <id>jitpack.io</id> <url>https://jitpack.io</url> </repository> </repositories> <dependencies> <dependency> <groupId>org.apache.tomee</groupId> <artifactId>javaee-api</artifactId> <version>8.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.eclipse.microprofile</groupId> <artifactId>microprofile</artifactId> <version>2.0</version> <type>pom</type> <scope>provided</scope> <exclusions> <exclusion> <groupId>javax.json</groupId> <artifactId>javax.json.bind-api</artifactId> </exclusion> <exclusion> <groupId>javax.enterprise</groupId> <artifactId>cdi-api</artifactId> </exclusion> <exclusion> <groupId>javax.ws.rs</groupId> <artifactId>javax.ws.rs-api</artifactId> </exclusion> <exclusion> <groupId>javax.json</groupId> <artifactId>javax.json-api</artifactId> </exclusion> <exclusion> <groupId>javax.annotation</groupId> <artifactId>javax.annotation-api</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.myfaces.core</groupId> <artifactId>myfaces-api</artifactId> <version>2.3.6</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>8.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.5.13</version> </dependency> <dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <version>3.0.0-M5</version> <scope>test</scope> </dependency> </dependencies> </project>
I've tried the following solutions without avail
- https://www.javatpoint.com/no-main-manifest-attribute
- http://www.skylit.com/javamethods/faqs/createjar.html
- Can't execute jar- file: "no main manifest attribute"
My question is, because I'm not using any "main" class within the application, but have TomEE running the application, how can I include the manifest.mf correctly?
Or, if this is not the case, how should I start the application, because currently I run the application with Docker through doing the following command
ENTRYPOINT ["java","-jar","server.war"]