将Java 6升级到Java 8

时间:2017-11-24 07:29:51

标签: java jboss

根据项目要求,我需要将JDK1.6.0_45升级到JDK1.8。

我正在使用JBOSS 4.2.3.GA,一旦我指向JDK1.8 bin并尝试编译项目,它会抛出以下错误: 错误[org.jboss.deployment.MainDeployer]无法启动部署:file:/ C:/jboss-4.2.3.GA/jboss-4.2.3.GA/server/default/deploy/web.ear/facade.jar java.lang.IllegalStateException:无法构建JAXB上下文

我该如何解决这个问题?

或者从JDK1.6迁移到JDK1.8的任何想法,我需要采取什么行动?

2 个答案:

答案 0 :(得分:0)

对于初学者,您还需要升级到更新的JBoss。 JBoss AS 7的所有功能都不能在Java 8上运行,因此您至少需要Wildfly 8。

同样,如果你想要Java 9,你将需要Wildfly 11。

答案 1 :(得分:0)

从1.6迁移到1.8时会出现许多其他问题,但这看起来像是在使用JAXB不兼容的类。

请使用以下maven依赖关系或切换到jaxb版本2.3.0

if (textField.tag==Jobdatetxt.tag)
        {
            [Jobdatetxt resignFirstResponder];
            [data.toolbar removeFromSuperview];

            UITextField *lagFreeField = [[UITextField alloc] init];
            [self.view.window addSubview:lagFreeField];
            [lagFreeField becomeFirstResponder];
            [lagFreeField resignFirstResponder];
            [lagFreeField removeFromSuperview];
            //////////////////////////////////////////////// DATE OF JOB////////////////////////////////////////////////

            pickerDate   = [[UIDatePicker alloc] initWithFrame:CGRectMake(0,result.height - 216, result.width, 216)];
            [pickerDate setDatePickerMode:UIDatePickerModeDate];
            pickerDate.backgroundColor = [UIColor whiteColor];

            [self.view.window addSubview:pickerDate];

            toolbar = [[UIToolbar alloc] init];
            toolbar.barStyle = UIBarStyleBlackOpaque;

            toolbar.frame=CGRectMake(0,result.height - 266,result.width,50);

            cancel = [UIButton buttonWithType:UIButtonTypeRoundedRect];
            [cancel setTitle:@"Cancel" forState:UIControlStateNormal];
            cancel.backgroundColor = [UIColor clearColor];
            [cancel.titleLabel setFont:[UIFont boldSystemFontOfSize:18]];
            cancel.titleLabel.textColor = [UIColor whiteColor];
            [cancel addTarget:self action:@selector(CancelClicked:) forControlEvents:UIControlEventTouchUpInside];
            cancel.tag = textField.tag;
            cancel.frame = CGRectMake(10, 10, 70, 30);

            [toolbar addSubview:cancel];

            doneButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
            [doneButton setTitle:@"Done" forState:UIControlStateNormal];
            doneButton.backgroundColor = [UIColor clearColor];
            [doneButton.titleLabel setFont:[UIFont boldSystemFontOfSize:18]];
            doneButton.titleLabel.textColor = [UIColor whiteColor];
            [doneButton addTarget:self action:@selector(DoneClicked:) forControlEvents:UIControlEventTouchUpInside];
            doneButton.tag = textField.tag;
            doneButton.frame = CGRectMake(result.width - 80, 10, 70, 30);

            [toolbar addSubview:doneButton];

            [self.view.window addSubview:toolbar];
        }