Opened 13 years ago

Closed 13 years ago

#27298 closed defect (fixed)

tomcat6 @6.0.29 cannot start using tomcatctl, must use startup.sh

Reported by: portigs@… Owned by: ghosthound
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: jsvc Cc: blair (Blair Zajac)
Port: tomcat6

Description

When using "tomcatctl start" or "sudo port load tomcat6" to start the server the command line shows:

$ sudo ./tomcatctl start
Starting Tomcat.................. giving up.

The log shows more details:

12/11/2010 20:06:45 12548 jsvc error: Cannot dynamically link to /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/../Libraries/libclient.dylib
12/11/2010 20:06:45 12548 jsvc error: dlopen(/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/../Libraries/libclient.dylib, 10): no suitable image found.  Did find:
	/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/../Libraries/libclient.dylib: mach-o, but wrong architecture
12/11/2010 20:06:45 12547 jsvc error: Service exit with a return value of 1

When using startup.sh and shutdown.sh the server starts and shuts down normally.

This is on a recent MacBook Pro running Snow Leopard 10.6.5 with the latest Java update 1.6.0_22-b04-307.

Change History (7)

comment:1 Changed 13 years ago by jmroot (Joshua Root)

Cc: blair@… added
Owner: changed from macports-tickets@… to ricci@…

Please remember to cc the maintainers. That library is i386-only on my system too.

comment:2 Changed 13 years ago by blair (Blair Zajac)

I see a

/System/Library/Frameworks/JavaVM.framework/Versions/1.6/libclient64.dylib

Can you try patching the startup scripts to point to that version and see if that works?

Ideally, the patch should check for which Java is being run and pick libclient64.dylib or libclient.dylib. Using java -version looks like a way to check for the Java version, grepping for 64-Bit.

Running java with -d32 or -d64 could be a way to test the patch.

I don't have the cycles to fix this, so if you want it in MacPorts, you'll need to help out.

comment:3 Changed 13 years ago by portigs@…

Here is a workaround that succeeded and at this time it doesn't appear to affect other Java applications such as NetBeans 6.9.1 and several applications being developed in that IDE.
The change amounts to moving the existing libclient.dylib to a temporary subdirectory and then creating the soft link "libclient.dylib -> libclient64.dylib". Now command "sudo port load tomcat6" succeeds as well as tomcatctl commands. Interestingly, libclient64.dylib is also a link, "libclient64.dylib -> libserver.dylib"
I am concerned now that future updates of Java by Apple will not work properly because of the change in directory structure. Any thoughts on this?
Thanks for your help.

comment:4 in reply to:  3 ; Changed 13 years ago by kevin.barnard@…

Replying to portigs@…:

Add the following option to jsvc options line 115 in tomcatctl

-jvm server

no need to change the filesystem. Hope that helps

comment:5 in reply to:  4 Changed 13 years ago by portigs@…

Replying to kevin.barnard@…:

Your suggestion indeed works, allowing me to undo the change to the filesystem. Thanks.

comment:6 in reply to:  4 Changed 13 years ago by info@…

Replying to kevin.barnard@…:

Replying to portigs@…:

Add the following option to jsvc options line 115 in tomcatctl

-jvm server

no need to change the filesystem. Hope that helps

10.6.5 This worked for me as well, with tomcat6 @6.0.29, OS 10.6.5

Here's a patch.

diff --git a/tomcatctl.dist b/tomcatctl
index c441e0f..eb31fc8 100755
--- a/tomcatctl.dist
+++ b/tomcatctl
@@ -123,6 +123,7 @@ start()
             -Dcatalina.base="$CATALINA_BASE" \
             -Djava.io.tmpdir="$CATALINA_TMPDIR" \
             -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \
+            -jvm server \
             org.apache.catalina.startup.Bootstrap "$@" start
             
         # Wait for it to really start


comment:7 Changed 13 years ago by blair (Blair Zajac)

Resolution: fixed
Status: newclosed

Thanks, fixed in r75203. Let's hope this change works on all different Mac OS X versions and architectures.

Note: See TracTickets for help on using tickets.