小编Jua*_*ias的帖子

无法启动GlassFish 4.0(Windows) - 端口1527 - 已在使用的地址

我是Java EE 7的新手.

我有一台带有GlassFish 4.0和Java EE 7的Netbeans 7.4.在一台64位Windows 8.1 Pro机器上.我想启动GlassFish 4.0 Server,所以我点击Netbeans中的服务选项卡,然后在Servers选项中右键单击GlassFish Server 4.0,然后单击Start.

当我这样做时,我得到以下消息:"无法启动GlassFish Server 4.0:服务器未运行时HTTP或HTTPS侦听器端口被占用".我也有IIS服务器,但我停止了它.停止IIS后,我试图再次启动GlassFish,但它向我显示了相同的消息.

Netbeans中还有一个名为Output - Java DB Database Process的窗口,它向我展示了以下内容:

Tue May 06 22:03:11 GMT-05:00 2014 : Security manager installed using the Basic server security policy.
Tue May 06 22:03:11 GMT-05:00 2014 Thread[main,5,main] java.io.FileNotFoundException: D:\Users\Juan Jose\.netbeans-derby\derby.log (Access is denied)
Tue May 06 22:03:12 GMT-05:00 2014 : Could not listen on port 1527 on host localhost:
 java.net.BindException: Address already in use: JVM_Bind
Tue May 06 22:03:12 …
Run Code Online (Sandbox Code Playgroud)

java windows glassfish java-ee netbeans-7

9
推荐指数
1
解决办法
2万
查看次数

fgets()使我的程序崩溃

我是C编程的新手。我正在尝试打开一个文件(juanjo2.klb),该文件是我使用同一程序创建的二进制文件,我将在此处显示。事情是,我正在尝试使用fprintf()函数将字符串打印到文件,然后使用fgets()将字符串写入“ cad”字符串,并使用函数printf()打印到屏幕上我从文件中读取的字符串。

当我运行该程序时,该程序崩溃了,Windows(Windows 7)给我一个消息框,提示我的程序停止工作并且正在寻找问题的解决方案。所以我真的不知道我在做什么错,因为我认为我正确地使用了这些功能。我需要你的帮助。这是源代码:

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

#define MAXCHARS 20

int main()
{
    char cad[MAXCHARS];
    FILE *pf;
    char *nombre = "\\juanjo2.klb";
    if(pf = fopen(nombre, "a+b") == NULL)
    {
       printf("Error opening file\n");
       exit(-1);
    }

    fprintf(pf, "%s", "Hola como estas");

    while(feof(pf) == 0)
    {
        fgets(cad, 13, pf);
        printf("%s", cad);//Here I print the string to the screen.
    }

    fclose(pf); //Closing file.

    system("PAUSE");
    return 0;
Run Code Online (Sandbox Code Playgroud)

}

我正在使用Codeblocks IDE 10.05。谢谢你的帮助。

c fgets

0
推荐指数
1
解决办法
2084
查看次数

标签 统计

c ×1

fgets ×1

glassfish ×1

java ×1

java-ee ×1

netbeans-7 ×1

windows ×1