APM Java Agent : Unable to start tomcat server getting error "Failed to find Premain-Class manifest attribute"

Command Line:
java -server -showversion -XX:NewRatio=8 -Djava.net.preferIPv4Stack=true -Dintershop.HomeDirectory="C:\ish710\710\intershop-cisetup-sources\projects\corporateshop\build\server\local" -Djava.security.auth.login.config="C:/ish710/710/intershop-cisetup-sources/projects/corporateshop/build/server/share/system/tcm/config/jaas.conf" -Dserver.name="appserver0" -Dcatalina.home="C:\ish710\710\intershop-cisetup-sources\projects\corporateshop\build\server\local\engine\tomcat\tomcat_inst" -Dcatalina.base="C:\ish710\710\intershop-cisetup-sources\projects\corporateshop\build\server\local\engine\tomcat\servers\appserver0" -Djava.io.tmpdir="C:\ish710\710\intershop-cisetup-sources\projects\corporateshop\build\server\local\engine\tomcat\servers\appserver0\temp" -cp ";C:\ish710\710\intershop-cisetup-sources\projects\corporateshop\build\server\local/lib/ish-runtime.jar;C:\Program Files\Java\jdk1.8.0_151/lib/tools.jar;C:\ish710\710\intershop-cisetup-sources\projects\corporateshop\build\server\local\engine\tomcat\tomcat_inst/bin/bootstrap.jar;C:\ish710\710\intershop-cisetup-sources\projects\corporateshop\build\server\local\engine\tomcat\tomcat_inst/bin/tomcat-juli.jar" -javaagent:C:\ish710\710\intershop-cisetup-sources\projects\corporateshop\build\server\local/lib/ish-runtime.jar -javaagent:"C:\ish710\710\intershop-cisetup-sources\projects\corporateshop\build\server\local/lib/elastic-apm-agent-1.0.1-sources.jar" -Delastic.apm.service_name=salmon-test-service -Delastic.apm.application_packages=com.intershop -Delastic.apm.server_urls=http://localhost:8300 -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=6667,suspend=n org.apache.catalina.startup.Bootstrap start

Failed to find Premain-Class manifest attribute in C:\ish710\710\intershop-cisetup-sources\projects\corporateshop\build\server\local/lib/elastic-apm-agent-1.0.1-sources.jar
Error occurred during initialization of VM
agent library failed to init: instrument

Hi,

seems like you are using elastic-apm-agent-1.0.1-sources.jar instead of elastic-apm-agent-1.0.1.jar.

BTW, we have already released 1.1.0 :slight_smile:

Cheers,
Felix

Hi Felix,

Before this I tried with apm-agent-api-1.1.0.jar

I got same error.
Failed to find Premain-Class manifest attribute in C:\ish710\710\intershop-cisetup-sources\projects\corporateshop\build\server\local/lib/apm-agent-api-1.1.0.jar Error occurred during initialization of VM agent library failed to init: instrument

Hi,

this is also not the correct file :wink:

See https://www.elastic.co/guide/en/apm/agent/java/current/intro.html#get-started for a download link.

I hope this helps.

Cheers,
Felix

Thanks for help,
Not getting that error anymore ,guess I made a mess in selecting JAR :woozy_face:. Not sure from where I clicked that link,but found it in
https://search.maven.org/search?q=g:co.elastic.apm%20AND%20a:apm-agent-api

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.