I'm unable to run my group's web application on my local machine with the AntiSamy filter in place. The filter works on WebSphere on our development and production servers, and also runs fine on one of my colleagues' machine with what should be the same setup as mine, using Tomcat. However, on my machine and several other colleagues', if we try to start our server with AntiSamy filter in place, we get this error:
Oct 12, 2015 11:06:32 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter AntiSamyFilter
java.lang.IllegalStateException: java.io.FileNotFoundException: C:\Users\myUsername\Documents\myWorkspaceDirectory.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\mobile3\WEB-INF\classes\antisamy-default.xml (The system cannot find the path specified)
I've looked in the directory cited, and there is an "antisamy-default.xml" file there, so I'm not sure where to begin to figure out what's causing the error.
Any help will be much appreciated!
Related
I'm trying to add a AS400 jar to WebLogic classpath. I'm putting the jt400.jar inside $domain/lib/ as indicated by the readme.txt found in there. And when server starts I can see the line:
<Sep 14, 2017 7:12:28 PM CST> <Notice> <WebLogicServer> <BEA-000395> <The following extensions directory contents added to the end of the classpath:
{$domain}/lib/jt400.jar.>
But, when I'm testing my datasource stills throws the error message:
weblogic.common.resourcepool.ResourceSystemException: Cannot load driver class com.ibm.as400.access.AS400JDBCDriver for datasource 'MyDataSource'
I have verified that the class is indeed inside the given jar.
What am I doing wrong?
Finally I understand what was happening. I forgot to add to the question that the WebLogic had several managed cluster servers. After trying various approachs, I realized the error only occured when I selected one of the clusters I wanted that datasource to serve.
So in the end, the servers from that cluster also need the jar to connect to the selected datasource.
There is sample java code for Hbase connectivity program which is the famous "HbaseTest" class sample, which is available in the internet for long time.
I have compiled the code in my server and compiling was successful. When i run my Java class file, i am able to see that it is getting hanged in the particular line. "HTable table = new HTable(conf, tableName);"
It throws the below alert when running.
Jun 18, 2015 12:16:14 PM org.apache.hadoop.util.NativeCodeLoader WARNING: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Jun 18, 2015 12:16:15 PM org.apache.hadoop.hbase.zookeeper.RecoverableZooKeeper INFO: The identifier of this process is pid#servername
I have identified it has stuck in that particular lines by giving Print statements.
Please do let me know what to do for the same. I have checked that the Hbase is running properly.
Kindly share your thoughts and idea's.
#hive #hbase #hadoop
Thanks in Advance Sam
I had a similar problem before it was network issues. Try setting retry and timeout parameters, e.g.
hbase.client.retries.number=2
zookeeper.session.timeout=2000
zookeeper.recovery.retry=0
hbase.rpc.timeout=100
ipc.socket.timeout=100
hbase.client.pause=100
zookeeper.recovery.retry.intervalmill=100
timeout=100
You may need to modify your network settings according to the errors that are thrown.
I have an application in which a client component is run in a "managed" environment (as an Adobe InDesign plugin). In this "managed" environment, it doesn't seem possible to create threads during execution, but only at application startup.
This client component connects to a Glassfish server through JNDI and RMI/IIOP to perform various EJB method calls that all work perfectly (except for some cumbersome CORBA serialization issues that are not important here). I would like to have it also connect using JMS, to perform some topic reading. The code I use to perform those topic reading is already under unit tests, making sure it can start, read the topic, and perform required integration (this is more an integration test than an unit test, but I have to be sure of my application communication layer, no ?). This code, when run in a unit test, perfectly works. Unfortunatly, when run from my client component (embedded in Indesign, and having no ability to create threads), it fails with a NullPointerException the following way :
29 mai 2012 18:07:22 com.sun.enterprise.connectors.ActiveRAFactory getActiveRA
INFO: Deployed RAR [ jmsra ] has inbound artifacts, but the runtime does not support it. Providing only outbound support
29 mai 2012 18:07:22 org.hibernate.validator.util.Version <clinit>
INFO: Hibernate Validator 4.2.0.Final
29 mai 2012 18:07:24 com.sun.messaging.jms.ra.ResourceAdapter start
INFO: MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter: Version: 4.5 (Build 29-b) Compile: Wed Feb 9 22:53:30 PST 2011
29 mai 2012 18:07:24 com.sun.messaging.jms.ra.ResourceAdapter start
INFO: MQJMSRA_RA1101: GlassFish MQ JMS Resource Adapter starting: broker is EMBEDDED, connection mode is Direct
29 mai 2012 18:12:58 com.sun.messaging.jms.blc.LifecycleManagedBroker start
GRAVE: MQJMSRA_RA4001: start:Aborting:Exception starting EMBEDDED broker=java.lang.NullPointerException
29 mai 2012 18:12:58 com.sun.messaging.jms.blc.LifecycleManagedBroker start
INFO: SJSMQ LifecycleManagedBroker configuration=
brokerInstanceName =imqbroker
brokerBindAddress =null
brokerPort =7676
brokerHomeDir =C:\Java-ext\glassfish3\mq
brokerLibDir =C:\Java-ext\glassfish3\mq\lib
brokerVarDir =C:\Java-ext\glassfish3\glassfish\domains\autocat\imq
brokerJavaDir =C:\Program Files\Java\jdk1.6.0_30\jre
brokerArgs =null
MasterBroker =null
brokerId =null
adminUsername =admin
adminPassword =<default>
adminPassFile =null
ConnectionURL =mq://localhost:7676/
dbType =null
dbProps ={}
dsProps ={}
useJNDIRmiServiceURL =true
useSSLJMXConnector =true
brokerEnableHA =false
clusterId =null
rmiRegistryPort =7776
startRmiRegistry =true
brokerStartTimeout = jmxServiceURL =null
60000
29 mai 2012 18:12:58 com.sun.enterprise.connectors.ActiveOutboundResourceAdapter init
GRAVE: RAR6035 : Resource adapter start failed.
javax.resource.spi.ResourceAdapterInternalException: MQJMSRA_RA4001: start:Aborting:Exception starting EMBEDDED broker=java.lang.NullPointerException
at com.sun.messaging.jms.blc.LifecycleManagedBroker.start(LifecycleManagedBroker.java:458)
at com.sun.messaging.jms.ra.ResourceAdapter.start(ResourceAdapter.java:380)
at com.sun.enterprise.connectors.ActiveOutboundResourceAdapter.startResourceAdapter(ActiveOutboundResourceAdapter.java:182)
at com.sun.enterprise.connectors.ActiveOutboundResourceAdapter.init(ActiveOutboundResourceAdapter.java:129)
at com.sun.enterprise.connectors.ActiveRAFactory.instantiateActiveResourceAdapter(ActiveRAFactory.java:135)
at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:106)
at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:212)
at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:379)
at com.sun.enterprise.resource.naming.AdministeredObjectFactory.getObjectInstance(AdministeredObjectFactory.java:107)
at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
at com.sun.enterprise.naming.impl.SerialContext.getObjectInstance(SerialContext.java:556)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:514)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
at javax.naming.InitialContext.lookup(Unknown Source)
at fr.perigee.autocat.indesign.remoting.jndi.jms.AdapterJMSListener.getConsumer(AdapterJMSListener.java:261)
at fr.perigee.autocat.indesign.remoting.jndi.jms.AdapterJMSListener$AdapterJMSListenerRunnable.run(AdapterJMSListener.java:50)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
at com.sun.messaging.jmq.jmsclient.runtime.impl.BrokerInstanceImpl.start(BrokerInstanceImpl.java:211)
at com.sun.messaging.jms.blc.EmbeddedBrokerRunner.start(EmbeddedBrokerRunner.java:331)
at com.sun.messaging.jms.blc.LifecycleManagedBroker.start(LifecycleManagedBroker.java:454)
... 24 more
Caused by: java.lang.NullPointerException
at com.sun.messaging.jmq.jmsserver.data.TransactionList.<init>(TransactionList.java:182)
at com.sun.messaging.jmq.jmsserver.Broker._start(Broker.java:1170)
at com.sun.messaging.jmq.jmsserver.Broker.start(Broker.java:456)
at com.sun.messaging.jmq.jmsserver.BrokerProcess.start(BrokerProcess.java:164)
at com.sun.messaging.jmq.jmsserver.DirectBrokerProcess.start(DirectBrokerProcess.java:92)
at com.sun.messaging.jmq.jmsclient.runtime.impl.BrokerInstanceImpl.start(BrokerInstanceImpl.java:206)
... 26 more
From what I have discovered so far, client code obtains connection to JMS server (connection to mq://localhost://7676), but then fail to start a TransactionList. Uncompiled source code (thanks Jad !) shows that it fails there :
/* 182*/Globals.getClusterManager().addEventListener(((ClusterListener) (this)));
Trying to debug that, I also found that my client can't start the org.glassfish.enterprise.iiop.util.S1ASThreadPoolManager due to the same impossibility to create threads.
I guess there is something wrong somewhere, but what ? I don't know.
So, how can I tell the glassfish client environment that threads can only obtained from my personnal thread pool (created at application startup) instead of trying to create its own and failing miserably ?
Short version
I deployed my aplication using maven forgotting the jms-core.jar of Glassfish, as it is a runtime dependency of gf-client-module.jar, and my maven build only copied compile dependencies. Fixing the maven build fixed the issue.
Long version
Long version is more a story of fear, tears, and blood.
How did that clusterManager got null ?
As I initially had problems with that TransactionList associated ClusterManager, I tried to look into com.sun.messaging.jmq.jmsserver.Globals code how it was initialized. I foun d it was in a method aptly called Globals#initCLusterManager(MQAddress) which, using various class parameters (including a Properties object), loaded a ClusterManager that was to be used by my application. What ? A ClusterManager ? In client code ? What the hell is that (more on that later) ?
Anyway, that ClusterManager was loaded, but set to null afterwards (mainly due to a a use of loopback address in cluster config - once again, incredibly weird in a JMS client) ... So looking how it was initialized was apparently not the correct path to bug solving, which left me puzzled.
What to do when test pass, but production code stills bugs ?
As I said in question, I have a test, which does (to my understanding) exactly the same thing. Test always succeed, and production always fail. So there must be something different there, no ?
So i did something new to me : I put a breakpoint in that Globals#initClusterManager code, and tried to reach it using both code : production and test. As one may guess, breakpoint was reached in prod, but not in test ! So I moved my breakpoint at some place where I already knew it would be reached : ActiveRAFactory#getActiveRA(ConnectorDescriptor, String) ... (oh wait, no, I didn't put it there, but the place where I put that breakpoint told me the point where execution path became different was that method call, so I finally put my breakpoint there).
With that breakpoint, I immediatly noticed something strange : the call to
Collection<ActiveResourceAdapter> activeRAs = activeRAHabitat.getAllByContract(ActiveResourceAdapter.class);
returned different results depending upon the fact I was in test or in prod : I got 4 elements in my list in test (including the ActiveJmsResourceAdapter), but only 3 in production.
Different ResourceAdapter, but why ?
Then I was puzzled : I then tended to blame Glassfish HK2 for no other reason than being an IoC container I didn't yet know ... Turned out I was wrong, oh so wrong !
Revelation came from an expression eval in Eclipse debugger : I typed as an expression
com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.class
And all i got was a ClassNotFoundException ... wait ... a ClassNotFoundException ? And this class is in jms-core.jar ? I'm pretty sure that jar is in my production folder, no ? ... No ? NO ?
God damn it !
Turned out the maven-dependency-plugin I use to copy jars in that folder uses copy-dependencies with an includeScope configured to "compile".
Crazy bug with simple solution
So I added an other execution to copy-dependencies, configured to incldueScope "runtime", and all worked OK.
I'm using tomcat to run a web application. Without any projects added to my Tomcat v6.0 Server at localhost, I start the server and an exception is being thrown. It says there isn't a mapping for class sun.awt.AppContext I'm using jre6 as my runtime. I have my JAVA_HOME environmental variation set to the jre6 folder and I have Eclipse set to the same one. Do you know why I am getting this exception and how to resolve?
Here is my stack trace:
Nov 1, 2011 5:21:36 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre6/bin/client;C:/Program Files/Java/jre6/bin;C:\oracle\Ora11g\BIN\;C:\Program Files\Serena\Dimensions 2009 R1\CM\prog;C:\Program Files\Serena\Dimensions 2009 R1\CM\prog\Microsoft.VC80.MFC;C:\Program Files\Serena\Dimensions 2009 R1\CM\prog\Microsoft.VC80.CRT;C:\Program Files\Serena\Dimensions 2009 R1\CM\prog\Microsoft.VC80.ATL;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\OTG;C:\Program Files\Windows Imaging\;C:\Program Files\IBM\Personal Communications\;C:\Program Files\IBM\Trace Facility\;C:\Program Files\HP\QuickTest Professional\bin;c:\PROGRA~1\IBM\SQLLIB\BIN;c:\PROGRA~1\IBM\SQLLIB\FUNCTION;c:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL;C:\Program Files\Eclipse 3.7\apache-maven-3.0.3\bin; C:\Program Files\Java\jre6\bin;C:\Program Files\HP\QuickTest Professional\bin
Letting agent QTJA do the transformation
Letting agent QTOR do the transformation
java.util.NoSuchElementException: No mapping for class sun.awt.AppContext
at com.mercury.bcel.TransformerXmlFile$MappingLocator.setMapping(TransformerXmlFile.java:96)
at com.mercury.bcel.TransformerFactory.createTransformer(TransformerFactory.java:56)
at com.mercury.bcel.TransformerMainImpl.transform(TransformerMainImpl.java:33)
at com.mercury.bcel.TransformerMain.transform(TransformerMain.java:35)
at com.mercury.javashared.transform.TransformersChain.transform(TransformersChain.java:32)
at com.mercury.javashared.transform.CommunicationThread.processTransformRequest(CommunicationThread.java:61)
at com.mercury.javashared.transform.CommunicationThread.run(CommunicationThread.java:38)
Thank you for your thoughts!
I'm pretty sure your problem is HP QuickTest.
HP QuickTest sets up JVM options which modify the java bootclasspath - nasty.
I'm not sure exactly how it works, but I'm guessing that it sets an environment variable JAVA_OPTS (which is picked up by Tomcat's startup scripts)
3 options (first is definite, second & third are based on my guess above):
Try uninstalling HP QuickTest
Open up bin\catalina.bat inside your Tomcat installation, and try resetting JAVA_OPTS at the start of the script.
Something like this:
echo "Current JAVA_OPTS (resetting to ''):"
echo %JAVA_OPTS%
set JAVA_OPTS=""
3: Or, try setting JAVA_OPTS variable (to empty string) in your Eclipse server startup dialog
i also faced the same issue, but my Apache Tomcat loaded through Cargo Container wrapper.
So I removed these 2 env. variable to fix the issue
JAVA_TOOL_OPTIONS -agentlib:jvmhook
_classload_hook jvmhook
I downloaded the examples of latest version for chapter 09 of “Mahout in Action”. I can successfully run several examples, but for three files, NewsKMeansClustering.java, ReutersToSparseVectors.java, and NewsFuzzyKMeansClusteing.java. Running these three programs gives similar error messages:
Aug 3, 2011 2:03:54 PM org.apache.hadoop.metrics.jvm.JvmMetrics init
INFO: Initializing JVM Metrics with processName=JobTracker, sessionId=
Aug 3, 2011 2:03:54 PM org.apache.hadoop.mapred.JobClient configureCommandLineOptions
WARNING: Use GenericOptionsParser for parsing the arguments. Applications should
implement Tool for the same.
Aug 3, 2011 2:03:54 PM org.apache.hadoop.mapred.JobClient configureCommandLineOptions
WARNING: No job jar file set. User classes may not be found. See JobConf(Class) or
JobConf#setJar(String).
Exception in thread "main" org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: file:/home/user1/workspaceMahout1/recommender/inputDir
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.listStatus(FileInputFormat.java:224)
at org.apache.hadoop.mapreduce.lib.input.SequenceFileInputFormat.listStatus(SequenceFileInputFormat.java:55)
at org.apache.hadoop.mapreduce.lib.input.FileInputFormat.getSplits(FileInputFormat.java:241)
at org.apache.hadoop.mapred.JobClient.writeNewSplits(JobClient.java:885)
at org.apache.hadoop.mapred.JobClient.submitJobInternal(JobClient.java:779)
at org.apache.hadoop.mapreduce.Job.submit(Job.java:432)
at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:447)
at org.apache.mahout.vectorizer.DocumentProcessor.tokenizeDocuments(DocumentProcessor.java:93)
at mia.clustering.ch09.NewsKMeansClustering.main(NewsKMeansClustering.java:54)
For the above messages, I do not quite understand what do those two warnings mean? Moreover, it looks like that “input path” should have been created, how can I create this type of input? Thanks.
You can ignore the warnings. The error is that the input directory you have specified does not exist. Does it exist? What is your command line?
I ran into a similar mismatch. The MiA files at https://github.com/tdunning/MiA have some cases where a .csv file is left in the same dir as the Java source. For example https://github.com/tdunning/MiA/tree/master/src/main/java/mia/recommender/ch02 ... however via Eclipse, loading it using DataModel model = new FileDataModel(new File("intro.csv")); ...doesn't find it.
Adding
System.out.println("CWD: "+System.getProperty("user.dir"));
...will reveal where Eclipse is looking (in my case, a couple levels up the filetree, but this might vary depending on how exactly you've set things up).