Показаны сообщения с ярлыком Java. Показать все сообщения
Показаны сообщения с ярлыком Java. Показать все сообщения

30 января, 2012

WLST jython: smtplib ImportError: no module named locale


$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.6 (Tikanga)

Python 2.4.3 (#1, Apr 14 2011, 20:41:59)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2

import smtplib
from email.MIMEText import MIMEText
..
s.sendmail('email@email.com', ['email@email.com'], msg.as_string())

File "/home/user/scripts/script.py", line 75, in ?
File "$WL_HOME/common/wlst/modules/jython-modules.jar/Lib/email/Message.py", line 127, in as_string
File "$WL_HOME/common/wlst/modules/jython-modules.jar/Lib/email/Generator.py", line 10, in ?
ImportError: no module named locale

I've modified $WL_HOME/common/wlst/modules/jython-modules.jar/Lib/email/Generator.py. Just replaced one line "import locale" with "import java.util.Locale" and now my script works!

11 августа, 2011

JDeveloper - java.lang.UnsatisfiedLinkError libX11.so.6

$ uname -a
Linux localhost.localdomain 2.6.32-71.29.1.el6.x86_64 #1 SMP Mon Jun 27 19:49:27 BST 2011 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/redhat-release
CentOS Linux release 6.0 (Final)


Installation done with instructions on Installation Guide for Oracle JDeveloper

But when I run /home/oracle/Middleware/jdeveloper/jdev/bin/jdev

it gives me lines

Oracle JDeveloper 11g Release 2 (11.1.2.0.0)
Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.

Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/oracle/Middleware/jdk160_24/jre/lib/i386/libsplashscreen.so: libX11.so.6: cannot open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1806)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1723)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.SplashScreen.getSplashScreen(SplashScreen.java:91)
at oracle.ide.osgi.boot.OracleIdeLauncher.getSimpleSplashImage(OracleIdeLauncher.java:539)
at oracle.ide.osgi.boot.OracleIdeLauncher.main(OracleIdeLauncher.java:82)
at oracle.ide.osgi.boot.JDeveloper.main(JDeveloper.java:14)

SOLUTION

# rpm --query --whatprovides 'libX11.so.6'
# yum install libX11-1.3-2.el6.i686
# rpm --query --whatprovides 'libXext.so.6'
# yum install libXext-1.1-3.el6.i686
# rpm --query --whatprovides 'libXtst.so.6'
# yum install libXtst-1.0.99.2-3.el6.i686

Done!
And here you run JDeveloper $/home/oracle/Middleware/jdeveloper/jdev/bin/jdev