Author Archives: Robins

[Solved] react native TypeError: Network request failed Unable to symbolicate stack trace: The stack is null

TypeError: Network request failed

Unable to symbolicate stack trace: The stack is null

Through the analysis, it can be seen that it is a network request problem. In react native, try to find the problem caused by the fetch sending request.

Code for fetch:

fetch('http://localhost:8083/user/getAllUser', {
    method: 'POST',
    headers: {
        "Accept": "application/json",
        "Content-Type": 'application/json',
        "Connection": "close",
        "type": "getUserData",
    },
    mode : "cors",
    body : JSON.stringify({
        page : 1,
        type :0
    })
}) .then((response) => response.json())
    .then((responseJson) => {
        console.log(responseJson);
        return responseJson.movies;
    })
    .catch((error) => {
        console.error(error);
    });
During the test, the error is prompted.
1. the http request received by the Android side must be an ip, i.e. the access address must be an IP address

2. The request header must contain the following

[Solved] Jenkins++:Jenkins Deploy war Pack to tomcat8 Error

The error information is as follows:

End of compilation and packaging
[DeployPublisher][INFO] Attempting to deploy 1 war file(s)
[DeployPublisher][INFO] Deploying /var/lib/jenkins/workspace/web_demo_boot_freestyle/target/web_demo_boot-0.0.1-SNAPSHOT.war to container Tomcat 8.x Remote with context null
ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy [/var/lib/jenkins/workspace/web_demo_boot_freestyle/target/web_demo_boot-0.0.1-SNAPSHOT.war]
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:176)
    at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:81)
    at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:167)
    at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:136)
    at hudson.FilePath.act(FilePath.java:1171)
    at hudson.FilePath.act(FilePath.java:1154)
    at hudson.plugins.deploy.CargoContainerAdapter.redeployFile(CargoContainerAdapter.java:133)
    at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeployFile(PasswordProtectedAdapterCargo.java:95)
    at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:113)
    at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
    at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:47)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:806)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:755)
    at hudson.model.Build$BuildExecution.post2(Build.java:178)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:699)
    at hudson.model.Run.execute(Run.java:1913)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:99)
    at hudson.model.Executor.run(Executor.java:432)
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The username you provided is not allowed to use the text-based Tomcat Manager (error 403)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:710)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:882)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:895)
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:161)
    ... 19 more
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://192.168.1.101:8886/manager/text/list
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:577)
    ... 22 more
org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The username you provided is not allowed to use the text-based Tomcat Manager (error 403)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:710)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:882)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:895)
    at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:161)
    at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:81)
    at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:167)
    at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:136)
    at hudson.FilePath.act(FilePath.java:1171)
    at hudson.FilePath.act(FilePath.java:1154)
    at hudson.plugins.deploy.CargoContainerAdapter.redeployFile(CargoContainerAdapter.java:133)
    at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeployFile(PasswordProtectedAdapterCargo.java:95)
    at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:113)
    at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
    at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
    at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:47)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:806)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:755)
    at hudson.model.Build$BuildExecution.post2(Build.java:178)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:699)
    at hudson.model.Run.execute(Run.java:1913)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:99)
    at hudson.model.Executor.run(Executor.java:432)
Caused by: java.io.IOException: Server returned HTTP response code: 403 for URL: http://192.168.1.101:8886/manager/text/list
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1894)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
    at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:577)
    ... 22 more
Build step 'Deploy war/ear to a container' marked build as failure
Finished: FAILURE

Solution:

The permission of the deployment user must be defined as “manager-script” before successful deployment.

You need to modify tomcat-xml.file under the conf files in tomcat.

Restart later

[Solved] Workflow Module jar package startup error: liquibase – waiting for changelog lock

1. Abnormal

Workflow module jar package startup error:

2021-02-14 13:45:13.735 [main] INFO  liquibase - Waiting for changelog lock....
2021-02-14 13:45:23.739 [main] INFO  liquibase - Waiting for changelog lock....
2021-02-14 13:45:33.744 [main] INFO  liquibase - Waiting for changelog lock....
2021-02-14 13:45:43.750 [main] INFO  liquibase - Waiting for changelog lock....
2021-02-14 13:45:53.755 [main] INFO  liquibase - Waiting for changelog lock....
2021-02-14 13:46:03.762 [main] INFO  liquibase - Waiting for changelog lock....
2021-02-14 13:46:13.767 [main] INFO  liquibase - Waiting for changelog lock....
2021-02-14 13:46:23.773 [main] INFO  liquibase - Waiting for changelog lock....

2. Reasons

Some log tables of the workflow table are locked, which may be caused by the exception that the program was not terminated normally last time.

3. Learn from the online saying that the table is locked. Just unlock it. You can execute the following statement, but you will be prompted that the table cannot be found or does not exist

#Check the locked sheet
SELECT * FROM DATABASECHANGELOGLOCK;
#Unlock
UPDATE DATABASECHANGELOGLOCK SET locked=0, lockgranted=null, lockedby=null WHERE id=1

4. Solution (check all tables ending with databasechangelock, and modify as shown in Figure 2)

Figure 1

Figure 2

Idea Run Scala Error: Exception in thread “main” java.lang.NoSuchMethodError:com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V

I.Description

Using idea + Scala + spark, the running program code is as follows:

package cn.idcast.hello

import org.apache.spark.rdd.RDD
import org.apache.spark
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext

/**
 * Author itcast
 * Desc Demo Spark Starter Case-WordCount
 */
object WordCount_bak {
  def main(args: Array[String]): Unit = {
    //TODO 1.env/preparesc/SparkContext/SparkContext execution environment
    val conf: SparkConf = new SparkConf().setAppName("wc").setMaster("local[*]")
    val sc: SparkContext = new SparkContext(conf)
    sc.setLogLevel("WARN")

    //TODO 2.source/read data
    //RDD:A Resilient Distributed Dataset (RDD): Resilient Distributed Dataset, simply understood as a distributed collection! It is as simple to use as an ordinary collection!
    // RDD [is a row of data]
    val lines: RDD[String] = sc.textFile("data/input/words.txt")

    //TODO 3.transformation/data manipulation/transformation
    //cut:RDD[one word]
    val words: RDD[String] = lines.flatMap(_.split(" "))
    //record as 1:RDD[(word, 1)]
    val wordAndOnes: RDD[(String, Int)] = words.map((_,1))
    //group aggregation:groupBy + mapValues(_.map(_. _2).reduce(_+_)) ===>group+aggregate inside Spark in one step:reduceByKey
    val result: RDD[(String, Int)] = wordAndOnes.reduceByKey(_+_)

    //TODO 4.sink/output
    //direct output
    result.foreach(println)
    //collect as a local collection and then output
    println(result.collect().toBuffer)
    //output to the specified path (can be a file/folder)
    result.repartition(1).saveAsTextFile("data/output/result")
    result.repartition(2).saveAsTextFile("data/output/result2")
    result.saveAsTextFile("data/output/result3")

    // For easy viewing of the Web-UI you can let the program sleep for a while
    Thread.sleep(1000 * 60)

    //TODO 5. Close the resource
    sc.stop()
  }
}

(forget the screenshot) an error is reported in the result: exception in thread “main” Java lang.NoSuchMethodError:com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;) V

It is said on the Internet that the jar package conflicts, but it does not solve the problem


II.Solution

Root cause of the problem: the scala version of windows is inconsistent with the scala version of spark, as shown in the figure:

This is spark’s own version, 2.12.10

I installed 2.12.11 on windows (forgot the screenshot), and later replaced it with 2.12.10 (reinstallation):

After that, it runs successfully without error

 

zookeeper is not a recognized option [How to Solve]

zookeeper is not a recognized option

An error is reported when creating a consumer:

.\bin\windows\kafka-console-consumer.bat --zookeeper localhost:2181 --topic ads_log 
zookeeper is not a recognized option

Cause of problem:

In the new version Kafka, -zookeeper has been deleted.

Solution:

The method of starting consumers after version 0.90 is as follows:

.\bin\windows\kafka-topics.bat  --bootstrap-server localhost:9092 --topic ads_log --from-beginning
 --bootstrap-server para

Create theme: you can

.\bin\windows\kafka-topics.bat --create  --bootstrap-server localhost:9092 --replication-factor 1 --partitions 3 --topic ads

.\bin\windows\kafka-topics.bat --create  --zookeeper localhost:2181 --replication-factor 1 --partitions 3 --topic ads

end!

There is no Action mapped for namespace [/] and action name [abc_show] associated with context path [/helloStruts].

There is no Action mapped for namespace [/] and action name [abc_show] associated with context path [/helloStruts].

problem found: the page cannot be found

analysis problem: the page cannot be found. The prompt is my mapping problem. But when I was in struts When the XML file is changed from normal naming to wildcard, an error will appear, and the prompt is as follows

environment: struts 2 (version 2.5)

problem solving: it may be because of the 2.5 version, so it is more rigorous

<!--Allow dynamic method calls, wildcard + placeholder combinations, must add this line of code Version 2.5-->
	<constant name="struts.enable.DynamicMethodInvocation"
		value="true" />
	<constant name="struts.devMode" value="false"/>

<!--Error Method for action Action is not allowed Add global-allowed-methods 
			Indicates a method that allows dynamic invocation Version 2.5-->
		<global-allowed-methods>regex:.*</global-allowed-methods>

Save and restart the server.

[Modified] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:3.0.0

Error reporting reason:

From is not preceded by a space

An extra space is added after row

After looking for the error for a long time, I thought it was an environmental problem or a problem with the POM. As a result, I was careless. Now I don’t know why the first from added a space less. Why would I report an error

If you encounter this problem, in addition to the methods given online, you can take a look at your own code

The first line is the wrong codes:
"select * from" +"(select * ,ROW_NUMBER() over(partition by windowEnd order by cnt desc)as row_num" +"from agg)" +"where row _num <= 5");

"select * from " +"(select * ,ROW_NUMBER() over (partition by windowEnd order by cnt desc) as row_num" +" from agg) " +" where row_num <= 5 ");


[Solved] Jenkins Machine install kubelet Error: authentication failed

1. Look at jenkinsfile

2. Check the error message and the authentication fails

I can see that the authentication failed, but my Jenkins machine was successful in executing the kubectl command
[root@devops ~]# kubectl get pod 
NAME                                      READY   STATUS    RESTARTS   AGE
nexus3-7b7598945f-njgpn                   1/1     Running   1          6d6h

3. Modified

My authorization file is validated by environment variables, which are placed in /etc/profile, and /etc/profile is only loaded when the user logs in, Jenkins uses Non-login when running the command