Using WLST script how to create DbAdapter EIS Connection Factory (remotely) - jython

I am trying to create Create DbAdapter in Admin Server using WLST sript.
def createDbAdapter():
connect('weblogic', 'welcome1','t3://asdf-pdm:7001')
edit()
startEdit()
planPath = get('/AppDeployments/DbAdapter/PlanPath')
#D:\Oracle\Middleware\home_ps2\Oracle_SOA1\soa\connectors\Plan.xml
appPath = get('/AppDeployments/DbAdapter/SourcePath')
# D:/Oracle/Middleware/home_ps2/Oracle_SOA1/soa/connectors/DbAdapter.rar
wpPlan=loadApplication(appPath, planPath) # got exception here
...
...
...
While i am trying to load in to memory DbAdapter.rar with Plan.xml it throws following error
wls:/base_domain/serverConfig> loadApplication(appPath, planPath)
Loading application from D:/Oracle/Middleware/home_ps2/Oracle_SOA1/soa/connectors/DbAdapter.rar ...
Plan for your application will be written to D:\Oracle\Middleware\home_ps2\Oracle_SOA1\soa\connectors\Plan.xml
Traceback (innermost last):
File "<console>", line 1, in ?
File "<iostream>", line 290, in loadApplication
Use dumpStack() to view the full stacktrace
at weblogic.management.scripting.ExceptionHandler.handleException(ExceptionHandler.java:59)
at weblogic.management.scripting.WLSTUtils.throwWLSTException(WLSTUtils.java:181)
at weblogic.management.scripting.JSR88DeployHandler.loadApplication(JSR88DeployHandler.java:196)
at weblogic.management.scripting.WLScriptContext.loadApplication(WLScriptContext.java:787)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
weblogic.management.scripting.ScriptException: weblogic.management.scripting.ScriptException: Error occured while performing loadApplication : Could not read confi
guration. : Exception in AppMerge flows' progression
Basically it tries to load those file from the file system where it running, rather where it connected.
while I am doing the same from the server console (locally) then everything works fine.
So, at this point i want to know, is it possible to update DbAdapter remotely?

Suvankar,
There could be path problem for the Plan.xml that using '\' instead of '/'. Please check and revert.

I too have faced the same issue looks like loadApplication() doesn't support remote loading of the application into the memory . Strangely it's not mentioned anywhere in the doc

Related

WLSTException: Error occured while performing connect : Error getting the initial context. There is no server running

Hii I am facing issue while connecting to weblogic server. The command i used to connect to it is as follows:
java -Dweblogic.security.SSL.ignoreHostnameVerification=true -
Djava.security.egd=file:/dev/./urandom -DUseSunHttpHandler=true -
Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -
Dsun.jnu.encoding=ISO-8859-1 -Dfile.encoding=ISO-8859-1 weblogic.WLST
<path>/weblogic_configuration_domain_update.py <path>/weblogic-
domain.properties
It gives following error:
javax.naming.CommunicationException [Root exception is
java.net.ConnectException: t3://<IP>:<port>: Destination
unreachable; nested exception is: java.net.ConnectException: Connection
refused; No available router to destination]
Problem invoking WLST - Traceback (innermost last):
File "/<path>/weblogic_configuration_domain_update.py", line 134, in ?
File "<iostream>", line 22, in connect
File "<iostream>", line 648, in raiseWLSTException
WLSTException: Error occured while performing connect : Error getting the
initial context. There is no server running at t3://<IP>:<port>
Please let me know is there any way to resolve this issue. Thank you in advance.
you have to insert the correct values in the script: weblogic_configuration_domain_update.py
for example: connect(t3://thelisteingadressofthehost.network.com:thelisteningportoftheAdminServer)
and be sure which protocol you are using t3 or t3s...
https://docs.oracle.com/cd/E13222_01/wls/docs92/config_scripting/reference.html
Open terminal and add mentioned below variable JVM_ARGS
[oracle#node1 bin]$ set JVM_ARGS="-Dprod.props.file='${WL_HOME}'/.product.properties ${WLST_PROPERTIES} ${JVM_D64} ${UTILS_MEM_ARGS} ${COMMON_JVM_ARGS} ${CONFIG_JVM_ARGS} -Dweblogic.security.TrustKeyStore=DemoTrust"
[oracle#node1 bin]$ wlst.sh
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
wls:/offline>

hibernate.xml not found error intellij

I have a project which is connected to a mysql database.
When I run the main class it gives me the error:
Failed to create sessionFactory object.org.hibernate.HibernateException: /hibernate.cfg.xml not found
Exception in thread "main" java.lang.ExceptionInInitializerError
at repository.Repository.<init>(Repository.java:24)
at repository.FacultyRepository.<init>(FacultyRepository.java:20)
at main.main(main.java:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: org.hibernate.HibernateException: /hibernate.cfg.xml not found
at org.hibernate.internal.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:173)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:2005)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1986)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1966)
at repository.Repository.<init>(Repository.java:19)
... 7 more
I have read other answers and my configure.xml is in src/resources like follows:
Also, as you can see in printscreen, I have two errors in my file hibernate.
Can someone tell me whats wrong?
Maybe if you put hibernate.cfg.xml out of resources folder, at main level. Also, you must see your libraries are fine.
If not, must specify a different path
sessionFactory = new AnnotationConfiguration()
.configure("resources/hibernate.cfg.xml").buildSessionFactory();
If you are working in Intellij Idea then make a folder named "resources" under src\main\java. Open Module setting of your project, select "Modules" from left and in the "sources" tab select the newly created "resources" folder and mark it as "Resources".
then this should work
Configuration con = new Configuration().configure("hibernate.cfg.xml");

Glassfish startup failure

I have set up a glassfish server for learning about it. After setting up and configuring depending on the quickstart guide, I was able to run the server and domain1 without any problems. after some time, it started to log the lines below:
[#|2013-01-11T15:43:45.246+0800|WARNING|glassfish3.1.2|java.util.prefs|_ThreadID=105;_ThreadName=Thread-2;|Could not lock User prefs. Unix error code 5.|#]
[#|2013-01-11T15:43:45.246+0800|WARNING|glassfish3.1.2|java.util.prefs|_ThreadID=105;_ThreadName=Thread-2;|Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.|#]
And I made a little googling about this and found this link and applied the option which was recommended there. After restarting glassfish although the server log says it started, I am seeing this in the commandline:
./asadmin start-domain domain1
Waiting for domain1 to start .............Error starting domain domain1.
The server exited prematurely with exit code 1.
Before it died, it produced the following output:
Launching GlassFish on Felix platform
ERROR: Error creating bundle cache. (java.lang.Exception: Unable to lock bundle cache: java.io.IOException: Input/output error)
java.lang.Exception: Unable to lock bundle cache: java.io.IOException: Input/output error
at org.apache.felix.framework.cache.BundleCache.<init>(BundleCache.java:176)
at org.apache.felix.framework.Felix.init(Felix.java:629)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:88)
Exception in thread "Thread-1" java.lang.RuntimeException: org.osgi.framework.BundleException: Error creating bundle cache.
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:90)
Caused by: org.osgi.framework.BundleException: Error creating bundle cache.
at org.apache.felix.framework.Felix.init(Felix.java:634)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiFrameworkLauncher$1.run(OSGiFrameworkLauncher.java:88)
Caused by: java.lang.Exception: Unable to lock bundle cache: java.io.IOException: Input/output error
at org.apache.felix.framework.cache.BundleCache.<init>(BundleCache.java:176)
at org.apache.felix.framework.Felix.init(Felix.java:629)
... 1 more
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: org.glassfish.embeddable.GlassFishException: java.lang.NullPointerException
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:164)
at org.glassfish.embeddable.GlassFishRuntime._bootstrap(GlassFishRuntime.java:157)
at org.glassfish.embeddable.GlassFishRuntime.bootstrap(GlassFishRuntime.java:110)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:112)
... 6 more
Caused by: java.lang.NullPointerException
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.newFramework(OSGiGlassFishRuntimeBuilder.java:230)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishRuntimeBuilder.build(OSGiGlassFishRuntimeBuilder.java:133)
... 9 more
Error stopping framework: java.lang.NullPointerException
java.lang.NullPointerException
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher$1.run(GlassFishMain.java:203)
Command start-domain failed.
I have tried to find a solution, removing the cache folder in the domain directory or changing access permissions but the problem keeps occuring and i cant start my domain.
any ideas how to fix this problem?
I had the same IO Error as in that stack after installing Glassfish and found out the following:
Glassfish 3.1.2 is using the felix library for OSGI stuff and this one wants to lock files using the core Java method java.nio.channels.FileChannel.tryLock(). This appears not to work when the file to be locked is on a filesystem residing on certain kinds of NAS and leads to an IO error after a long timeout.
Make sure to install critical parts or all of the Glassfish on local disks and this error will disappear.
The error can easily be reproduced running the following Java class:
import java.io.File;
import java.io.FileOutputStream;
import java.nio.channels.FileChannel;
public class TryLock {
/**
* #param args
*/
public static void main(String[] args) {
// name of a file is the only parameter
File lockFile = new File(args[0]);
FileChannel fc = null;
FileOutputStream fos = null;
try {
fos = new FileOutputStream(lockFile);
fc = fos.getChannel();
// This is the code that fails on some NAS (low-level operation?):
fc.tryLock();
} catch( Throwable th) {
th.printStackTrace();
}
System.out.println("Success");
}
}

JDeveloper 11g Not Opening

I am trying to open up jdeveloper 11g and it is doing nothing. I am getting the following error when I run jdev.exe
IDE boot startup failed.
java.lang.NoClassDefFoundError: oracle/classloader/SharedCodeSourceURL
at oracle.ide.boot.IdeLauncher.initURLStreamHandlerFactory(IdeLauncher.j
ava:146)
at oracle.ide.boot.IdeLauncher.launchImpl(IdeLauncher.java:87)
at oracle.ide.boot.IdeLauncher.launch(IdeLauncher.java:65)
at oracle.ide.boot.IdeLauncher.main(IdeLauncher.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.ide.boot.Launcher.invokeMain(Launcher.java:713)
at oracle.ide.boot.Launcher.launchImpl(Launcher.java:115)
at oracle.ide.boot.Launcher.launch(Launcher.java:68)
at oracle.ide.boot.Launcher.main(Launcher.java:57)
Caused by: java.lang.ClassNotFoundException: oracle.classloader.SharedCodeSource
URL
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
I attempted to install oracle servicce bus and oracle database express edition, is it possible that some file was overwritten?
Try removing JDeveloper's system directory
Should be under C:\Users\yourUser\AppData\Roaming\JDeveloper
and then restarting JDeveloper
Looks like it is trying to open a file that it has no access to over the network.
Next thing to do after deleting the system11.1.x.x.x.x folder is to remove or uninstall the whole JDev and after that install it again. Then all files which might be overwritten by the other installations should be back in their original version.
You should install JDev into a path without spaces in.
Timo
In my case, I need update JDevepoper to newest. It will fix this issue
Another option is setting proxy for Jdeveloper. Choose Window/Preference, search proxy, choose Proxy Setting. Enter proxy information.

Amazon Elastic MapReduce: Exception from FileSystem

I run my application using ruby client:
ruby elastic-mapreduce -j j-20PEKMT9BRSUC --jar s3n://sakae55/lib/edu.cit.som.jar --main-class edu.cit.som.hadoop.SOMDriver --arg s3n://sakae55/repository/input/ecoli/ --arg s3n://sakae55/repository/output/ecoli/pl/ --arg s3n://sakae55/repository/data/ecoli/som.txt
Then, I am seeing the following error:
java.lang.IllegalArgumentException: This file system object (file:///) does not support access to the request path 'hdfs://i
-10-195-207-230.ec2.internal:9000/mnt/var/lib/hadoop/tmp/mapred/system/job_201004221221_0017/job.jar' You possibly called Fi
eSystem.get(conf) when you should of called FileSystem.get(uri, conf) to obtain a file system supporting your path.
at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:320)
at org.apache.hadoop.fs.RawLocalFileSystem.pathToFile(RawLocalFileSystem.java:52)
at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:416)
at org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:259)
at org.apache.hadoop.fs.FileSystem.isDirectory(FileSystem.java:676)
at org.apache.hadoop.fs.FileUtil.copy(FileUtil.java:200)
at org.apache.hadoop.fs.FileSystem.copyFromLocalFile(FileSystem.java:1184)
at org.apache.hadoop.fs.FileSystem.copyFromLocalFile(FileSystem.java:1160)
at org.apache.hadoop.fs.FileSystem.copyFromLocalFile(FileSystem.java:1132)
at org.apache.hadoop.mapred.JobClient.configureCommandLineOptions(JobClient.java:662)
at org.apache.hadoop.mapred.JobClient.submitJob(JobClient.java:729)
at org.apache.hadoop.mapred.JobClient.runJob(JobClient.java:1026)
at edu.cit.som.hadoop.SOMDriver.runIteration(SOMDriver.java:106)
at edu.cit.som.hadoop.SOMDriver.train(SOMDriver.java:69)
at edu.cit.som.hadoop.SOMDriver.run(SOMDriver.java:52)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
at edu.cit.som.hadoop.SOMDriver.main(SOMDriver.java:36)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:155)
at org.apache.hadoop.mapred.JobShell.run(JobShell.java:54)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:65)
at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:79)
at org.apache.hadoop.mapred.JobShell.main(JobShell.java:68)
I am not sure why the error references to "file:///" even though all the arguments I pass do not use the schema.
It turned out that the reuse of the JobConf object was causing this issue. Changing the code to create a new instance for each iteration solved the problem.